[jboss-jira] [JBoss JIRA] Commented: (JBMETA-208) Prescence of an ejb-jar.xml without a namespace stops annotation-based metadata processing
Alexey Loubyansky (JIRA)
jira-events at lists.jboss.org
Thu Jun 18 02:18:56 EDT 2009
[ https://jira.jboss.org/jira/browse/JBMETA-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12472640#action_12472640 ]
Alexey Loubyansky commented on JBMETA-208:
------------------------------------------
The namespace is what distinguishes EJB2 descriptor from EJB3. DTDs don't have a namespace. EJB2 and EJB1 schemas are based on DTDs, so when a descriptor w/o a namespace is found it assumed to be EJB2.x one.
This is also how the metadata classes are bound with JAXB/JBossXB annotations. EJB3 metadata classes (as any Java class in principle) are bound to a specific namespace, which is http://java.sun.com/xml/ns/javaee in case of EJB3.
Although, we could make it work w/o a namespace (by copying EjbJar30MetaData class, binding it to an empty namespace and adjusting metadata version resolution logic (which will be now done outside of XB's SchemaResolver impl, but by a deployer probably)), I am so far not in favor of supporting this.
If you are writing an XML based on an XSD it is a given to include the namespace from the XSD. So, I would fix the EJB3 docs instead.
PS: the forum link is not really about this issue.
> Prescence of an ejb-jar.xml without a namespace stops annotation-based metadata processing
> ------------------------------------------------------------------------------------------
>
> Key: JBMETA-208
> URL: https://jira.jboss.org/jira/browse/JBMETA-208
> Project: JBoss Metadata
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 1.0.1.GA
> Environment: JBoss AS 5.1.0.GA
> Reporter: Richard Kennard
> Assignee: Alexey Loubyansky
>
> The presence of a META-INF/ejb-jar.xml file that is not properly namespaced, for example...
> <ejb-jar>
> </ejb-jar>
> ...instead of...
> <ejb-jar version="3.0"
> 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_0.xsd">
> </ejb-jar>
> ...stops ALL of the annotation-based metadata processing. Every session bean in the JAR reports with the JBMETA-4 warning, and therefore none of them get registered with JNDI. This is much worse than simply ignoring the ejb-jar.xml altogether, as is arguably acceptable as it isn't namespaced.
> An un-namespaced ejb-jar.xml is not uncommon. Many examples, including this one from the JBoss documentation...
> http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/partial_deployment_descriptors.html
> ...leave off the namespace, so for JBoss to fail without warning seems a little harsh. Leaving off the namespace worked fine in JBoss 4.2.3.GA.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list