-
2. Re: Ear sufix in ejb jndi name
mireksz Feb 15, 2010 8:11 AM (in response to jaikiran)I using
jboss.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 3.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<jboss>
<enterprise-beans>
<session>
<ejb-name>AsenDaoImpl</ejb-name>
<local-jndi-name>ewan/AsenDaoImpl/local</local-jndi-name>
</session>
</enterprise-beans>
</jboss>and I have two entires in JNDI
1) ewan/AsenDaoImpl/local
2) AsenDaoImpl/local
I don't know why the second entry exists
-
3. Re: Ear sufix in ejb jndi name
jaikiran Feb 15, 2010 8:22 AM (in response to mireksz)Which version of JBoss AS are you using? Can you post the console logs when your application is deploying?
-
4. Re: Ear sufix in ejb jndi name
mireksz Feb 15, 2010 8:39 AM (in response to jaikiran)JBOSS 5.0.0 GA
log
14:37:42,425 INFO [JBossASKernel] Created KernelDeployment for: server-ewan-application-1.0.0-SNAPSHOT.ear
14:37:42,430 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=server-ewan-application-1.0.0-SNAPSHOT.ear,jar=server-ewan-application-1.0.0-SNAPSHOT.ear,name=AsenDaoImpl,service=EJB3
14:37:42,431 INFO [JBossASKernel] with dependencies:
14:37:42,431 INFO [JBossASKernel] and demands:
14:37:42,431 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
14:37:42,431 INFO [JBossASKernel] and supplies:
14:37:42,431 INFO [JBossASKernel] jndi:AsenDaoImpl/local
14:37:42,431 INFO [JBossASKernel] Class:asen.server.dao.AsenDao
14:37:42,431 INFO [JBossASKernel] jndi:AsenDaoImpl/local-asen.server.dao.AsenDao
14:37:42,431 INFO [JBossASKernel] jndi:ewan/AsenDaoImpl/local
14:37:42,432 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=server-ewan-application-1.0.0-SNAPSHOT.ear,jar=server-ewan-application-1.0.0-SNAPSHOT.ear,name=AsenDaoImpl,service=EJB3) to KernelDeployment of: server-ewan-application-1.0.0-SNAPSHOT.ear
14:37:42,659 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=server-ewan-application-1.0.0-SNAPSHOT.ear,jar=server-ewan-application-1.0.0-SNAPSHOT.ear,name=AsenDaoImpl,service=EJB3
14:37:42,667 INFO [EJBContainer] STARTED EJB: pl.com.stream.lib.asen.server.dao.AsenDaoImpl ejbName: AsenDaoImpl
14:37:42,694 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
ewan/AsenDaoImpl/local - EJB3.x Default Local Business Interface
AsenDaoImpl/local-asen.server.dao.AsenDao - EJB3.x Local Business Interface -
5. Re: Ear sufix in ejb jndi name
jaikiran Feb 15, 2010 8:46 AM (in response to mireksz)Are you talking about this one:MirekSz wrote:
AsenDaoImpl/local-asen.server.dao.AsenDao - EJB3.x Local Business InterfaceThat binding we use internally during injection for business interface specific proxies. You need not use that jndi name for lookup. You can instead use ewan/AsenDaoImpl/local
-
6. Re: Ear sufix in ejb jndi name
mireksz Feb 15, 2010 8:52 AM (in response to jaikiran)Ok,
but when I deploy two ear files with serviceName AsenDaoImpl and I set diferent prefix(ewan/AsenDaoImpl/local;next/AsenDaoImpl/local) then jboss throw my an exception that AsenDaoImpl/local is already register
-
7. Re: Ear sufix in ejb jndi name
skerstetter Dec 22, 2010 1:37 PM (in response to mireksz)Did you ever resolve this? I'm having a similar problem when using the default names. When deploying the ejbs in different ears, the ear file name is supposed to be pre-pended to the JNDI name, which ought to make the names unique, but I also get the "name already bound" issue. Even worse, at runtime, the ejbs cannot be injected because of a "not found" error.
-
8. Re: Ear sufix in ejb jndi name
mireksz Dec 23, 2010 1:51 AM (in response to skerstetter)Yes,
I discover that when I have ejb-jar.xml in META-INF of ear I have ejbs names without ear prefix but when I put ejb-jar .xml into one of my jars inside ear I have ear prefix
-
9. Re: Ear sufix in ejb jndi name
skerstetter Jan 14, 2011 9:27 AM (in response to mireksz)OK, yes. I had to do something similar. Both of my ear files had all of the ejb-jars deployed from the lib directory. Moving all of the ejb-jars in one of them to the root of the ear file resolved the issue.
-
10. Re: Ear sufix in ejb jndi name
massios Apr 17, 2012 10:30 AM (in response to skerstetter)I tried the suggestion of Shawn and of Mirek and it did not work. I have an JBoss 5.1 EAP.