This content has been marked as final.
Show 2 replies
-
1. Re: java:comp NameSpace in EJB 3.0
bill.burke Aug 29, 2006 9:06 PM (in response to tshuynh)we changed the ENC implementation for EJB3 to be ThreadLocal based instead of keyed by classloader. We can't change the implementation for java:comp for JBoss 4, so there is a new java:comp namespace for now:
"java:comp.ejb3"
You can get this as a constant via org.jboss.ejb3.Container.ENC_CTX_NAME
we'll change the value of this constant back to java:comp for JBoss 5. -
2. Re: java:comp NameSpace in EJB 3.0
tshuynh Aug 30, 2006 10:25 AM (in response to tshuynh)Thanks for your quick reply.
The question now is how to add a EJB Ref to that namespace (java:comp.ejb3). I have 2 EJBs: myEjb1 and myEjb2. The myEjb1 has a ref to myEJB2 like this:<?xml version="1.0" encoding="UTF-8"?> <jboss 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://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="3.0"> <enterprise-beans> <session> <ejb-name>MyBean1</ejb-name> <local-jndi-name>ejb/myEJB1</local-jndi-name> <ejb-local-ref> <ejb-ref-name>ejb/myEJB2</ejb-ref-name> <local-jndi-name>ejb/myEJB2</local-jndi-name> </ejb-local-ref> </session> </enterprise-beans> <resource-managers></resource-managers> </jboss>
And the MyBean2 binds to the JNDI name 'ejb/myEJB2'.
When I deploy both EJBs in a EAR file to JBoss 4.0.4GA/EJB3.0, I get the exception:javax.naming.NamingException: Could not bind statless proxy with ejb name MyBean1 into JNDI under jndiName: /ejb/myEJB2 [Root exception is javax.naming.NameAlreadyBoundException]
And in the JNDIView, it shows that the MyBean2 was already bound to 'ejb/myEJB2'.
I don't understand why.
Thank you