EJB3 session bean is not bound to JNDI if only "ejb-jar.xml" is used
--------------------------------------------------------------------
Key: EJBTHREE-1503
URL:
https://jira.jboss.org/jira/browse/EJBTHREE-1503
Project: EJB 3.0
Issue Type: Bug
Affects Versions: AS 5.0.0.CR1
Environment: jboss-5.0.0.CR2-jdk6.zip
Reporter: Wolfgang Knauf
I have a small EJB3 app (ejb and app client bundled in an EAR file, see attached file)
with one session bean and NO annotations, only deployment descriptors.
There is a stateless session bean GeometricModelBean with local and remote interfaces
GeometricModelLocal and GeometricModel.
the relevant part of ejb-jar.xml is:
<session>
...
<display-name>GeometricModelBean</display-name>
<ejb-name>GeometricModelBean</ejb-name>
<remote>de.fhw.swtvertiefung.knauf.stateless.GeometricModel</remote>
<local>de.fhw.swtvertiefung.knauf.stateless.GeometricModelLocal</local>
<ejb-class>de.fhw.swtvertiefung.knauf.stateless.GeometricModelBean</ejb-class>
<session-type>Stateless</session-type>
</session>
jboss.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">
<jboss>
<enterprise-beans>
<session>
<ejb-name>GeometricModelBean</ejb-name>
<jndi-name>Test</jndi-name>
<local-jndi-name>TestLocal</local-jndi-name>
</session>
</enterprise-beans>
</jboss>
Console output on deployment is:
21:00:35,125 INFO [JBossASKernel] installing bean:
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
21:00:35,125 INFO [JBossASKernel] with dependencies:
21:00:35,125 INFO [JBossASKernel] and demands:
21:00:35,125 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
21:00:35,125 INFO [JBossASKernel] and supplies:
21:00:35,125 INFO [JBossASKernel] jndi:Test
21:00:35,125 INFO [JBossASKernel]
Class:de.fhw.swtvertiefung.knauf.stateless.GeometricModelLocal
21:00:35,125 INFO [JBossASKernel] jndi:TestLocal
21:00:35,125 INFO [JBossASKernel]
Class:de.fhw.swtvertiefung.knauf.stateless.GeometricModel
21:00:35,125 INFO [JBossASKernel] Added
bean(jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3)
to KernelDeployment of: StatelessEJB.jar
server.log tells me more:
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation javax.ejb.Stateless to
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
org.jboss.ejb3.annotation.impl.StatelessImpl@6824d9
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) Adding @Local interface
de.fhw.swtvertiefung.knauf.stateless.GeometricModelLocal as specified in metadata
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) Adding @Remote interface
de.fhw.swtvertiefung.knauf.stateless.GeometricModel as specified in metadata
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation javax.ejb.Local to
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
org.jboss.ejb3.annotation.impl.LocalImpl@14b28ec
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation javax.ejb.Remote to
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
org.jboss.ejb3.annotation.impl.RemoteImpl@16ba2b8
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation org.jboss.ejb3.annotation.SecurityDomain
to jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
SecurityDomainImpl[value=, unauthenticatedPrincipal=anonymous]
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation org.jboss.ejb3.annotation.LocalBinding
to jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
org.jboss.ejb3.annotation.impl.LocalBindingImpl@187f139
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation
org.jboss.ejb3.annotation.LocalHomeBinding to
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
org.jboss.ejb3.annotation.impl.LocalHomeBindingImpl@1edf4be
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation
org.jboss.ejb3.annotation.RemoteHomeBinding to
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
[RemoteHomeBindingImpl:, jndi=Stateless/GeometricModelBean/home]
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) adding class annotation org.jboss.ejb3.annotation.RemoteBinding
to jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3
[RemoteBindingImpl:, jndi=Test, stack=, bindUrl=, proxyFactory=RemoteProxyFactory,
constructionPoint=org.jboss.ejb3.Ejb3DescriptorHandler.addRemoteJndiAnnotations(Ejb3DescriptorHandler.java:1783)]
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3DescriptorHandler] (RMI TCP
Connection(14)-127.0.0.1) Adding org.jboss.ejb3.annotation.RemoteBinding to
jboss.j2ee:ear=Stateless.ear,jar=StatelessEJB.jar,name=GeometricModelBean,service=EJB3:
[RemoteBindingImpl:, jndi=Test, stack=, bindUrl=, proxyFactory=RemoteProxyFactory,
constructionPoint=org.jboss.ejb3.Ejb3DescriptorHandler.addRemoteJndiAnnotations(Ejb3DescriptorHandler.java:1783)]
2008-09-24 21:00:35,093 DEBUG [org.jboss.ejb3.Ejb3AnnotationHandler] (RMI TCP
Connection(14)-127.0.0.1) found EJB3: ejbName=GeometricModelBean,
class=de.fhw.swtvertiefung.knauf.stateless.GeometricModelBean, type=STATELESS
But I do not find an entry for my bean in the JNDI view, and a lookup from the application
client fails with "Test not bound". The client ENC works and can be found in
JNDI view.
The same code with annotations and no deployment descriptor files works fine, and this
deployment descriptor version works either.
If I add a "business-local" and "business-remote" element to
"ejb-jar.xml" and remove "jboss.xml", I see the default JNDI names.
Without "business-local" and "business-remote", nothing is found in
JNDI view.
--
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