ejb-jar.xml XSD validation error
ozizka Oct 9, 2010 9:41 AMHi,
I'm trying to set an env-entry for a bean,
package org.jboss.qa.simpleejb31; import javax.annotation.Resource; import javax.ejb.Stateless; import javax.ejb.LocalBean; @Stateless @LocalBean public class MySessionBean { private String injectedValue = "Default hardcoded value"; @Resource public void setInjectedValue(String injectedValue) { this.injectedValue = injectedValue; } }
so I've made a ejb-jar.xml starting with
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar version="3.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
1) JBoss AS 6 M2 says,
14:55:21,916 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd 14:55:23,164 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://java.sun.com/xml/ns/javaee/javaee_6.xsd 14:55:24,426 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://java.sun.com/xml/ns/javaee/javaee_web_services_client_1_3.xsd 14:55:25,166 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd 14:55:27,337 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://java.sun.com/xml/ns/javaee 14:55:28,224 WARN [XsdBinder] 102:47 schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/javaee', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. 14:55:28,225 ERROR [AbstractKernelController] Error installing to Parse: name=vfszip:/home/ondra/work/OneOff/5111/jboss-eap-noauth-5.0.1/server/default/deploy/SimpleEJB-31.jar/ state=Not Installed mode=Manual requiredState=Parse org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/home/ondra/work/OneOff/5111/jboss-eap-noauth-5.0.1/server/default/deploy/SimpleEJB-31.jar/ at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) ... Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 769:49 src-resolve: Cannot resolve the name 'javaee:descriptionGroup' to a(n) 'group' component. at org.jboss.xb.binding.sunday.unmarshalling.XsdBinderTerminatingErrorHandler.handleError(XsdBinderTerminatingErrorHandler.java:40) at org.apache.xerces.impl.xs.XMLSchemaLoader.reportDOMFatalError(Unknown Source) at org.apache.xerces.impl.xs.XSLoaderImpl.load(Unknown Source) at org.jboss.xb.binding.Util.loadSchema(Util.java:395) at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:176) at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.java:147) at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(AbstractMutableSchemaResolver.java:285) ... 51 more
This seems like some flaw in the downloaded XSD, which sounds improbable.
I've no idea what's going on in this case, the XSD's are to me.
How do I fix pls?
2) I'd expect I could only put the bean name and the env-entry to the bean,
<session> <ejb-name>MySessionBean</ejb-name> <env-entry>... </env-entry> </session>
but when I used ejb-jar.xml version 2.1, validation failed, needing
<ejb-class>org.jboss.qa.simpleejb31.MySessionBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type>
which seems odd to me... is that normal for 2.1 or is there some mistake in my config?
I mean, is there some way to relax the validation?
Thanks,
Ondra