I am using XDoclet to create a web app that utilizes EJBs that have multiple CMRs. In my build file, I make use of the <utilobject> tag to generate util classes for my EJBs. However, I always end up with errors when attempting to call the getLocalHome() method in these util classes. The problem lies in the initial context and the properties associated with it. The generated util classes establish an initial context by doing something like:
InitialContext initialContext = new InitialContext();
In addition, the lookup is performed using MyLocalHome.COMP_NAME. When I run this method, I get errors saying something to the effect of "ejb not bound". However, if I manually change this section to:
java.util.Hashtable props =
null;javax.naming.InitialContext initialContext =
null;props =
new java.util.Hashtable();props.put(
javax.naming.InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");props.put(
javax.naming.InitialContext.PROVIDER_URL,
"jnp://127.0.0.1:1099");initialContext =
new javax.naming.InitialContext(props);
And also specify to do the lookup using MyLocalHome.JNDI_NAME (instead of COMP_NAME), everything works just fine. Is there any way to force XDoclet to get the context and interface in this manner? I am using JBoss 3.2.2 with the embedded Tomcat servlet engine. Is this problem simply due to a misconfiguration of JBoss on my machine? I'd really apperciate any help someone could offer. Thanks!
Steve Nakhla
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
