[
https://jira.jboss.org/jira/browse/JBMETA-208?page=com.atlassian.jira.plu...
]
Richard Kennard commented on JBMETA-208:
----------------------------------------
If you did try to describe an EJB3 bean in EJB2 deployment descriptor
you would get an error
Fair enough. But in general EJB3 beans are not described in the deployment descriptor:
they are described with an annotation on the class.
If you have a bean annotated @Stateful or @Stateless in your JAR, but your JAR has an EJB2
deployment descriptor, you should get an error. But you don't. You DO get a JBMETA-4
warning, but this is not very clear as to what the problem is.
I am sorry I haven't been explaining myself very well. I hope the problem is now
clear. What happened was I upgraded a JBoss 4.2.3.GA app to JBoss 5.1.0. The app used EJB3
annotations but forgot the namespace on the ejb-jar.xml (hence accidentally making it an
EJB2 descriptor). This worked fine on JBoss 4.2.3.GA, but JBoss 5.1.0 is clearly stricter.
This is a good thing, but throwing an error would be useful for stupid people like me!
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/p...
...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