0
votes

I am migrating an application from Jboss 3 to Jboss 7. I am using jboss-as-7.1.1.Final. The application is a .ear with several EJB .jars and a .war containing all the servlets and jsp pages. The EJBs are both CMP entity beans and session beans and make heavy use of Xdoclet. I am at a point where the application builds and deploys OK but the EJBs are not able to be instantiated correctly due to what are obviously JNDI issues. I know that Jboss 7 has changes in how JNDI is to be used but the documentation on how to apply these changes to EJB 2 xdoclet code is sparse to non-existant. Suppose I have session bean code UserManagerEJB.java with the following xdoclet

* @ejb.bean
*     name="UserManager"
*     jndi-name="ejb/UserManager"
*     type="Stateless"
*     view-type="remote"
*     transaction-type="Container"

UserManagerEJB references an entity bean User with the folowing xdoclet

* @ejb.ejb-ref
*     ejb-name="User"
*     view-type="local"
*     ref-name="ejb/UserLocal"

and the entity bean code UserEJB.java has the folling xdoclet declaration

* @ejb.bean
*    name="User"
*    local-jndi-name="ejb/UserLocal"
*    primkey-field="userId"
*    type="CMP"
*    view-type="local"

What is the proper Jboss AS 7 way to specify the jndi-name, local-jndi-name, and ref-name ?

What is the JNDI name to use in the web app's .war/WEB-INF/web.xml as the ejb-ref-name?

Previously ejb/EJBNAME just worked but doing that now just gets me a NamingException. Blindly changing all the JNDI names to something like java:app/myuser/User!com.myco.module.myuser.ejb.entity.UserLocal just doesn't work and I start to go down a rathole of changing things that, frankly, I don't understand too well. The change in JNDI naming scheme seems to be such a massive leap beyond what I was used to.

If anyone can offer a short concise explanation of the new JNDI naming scheme that would be very much appreciated too!

1

1 Answers

0
votes

This worked for me.

say you have a ear called "test.ear", and a stateless session bean 'com.test.SessionClass", and the SessionClass implements "com.test.SessionClassRemote"...JNDI look up would be

ctx.lookup("test/SessionBean/com.test.SessionClass!com.test.SessionRemote");