I have a simple webapp named services.war. I also have a JAR file named, say,
example.jar, deployed in TomEE's lib directory. In example.jar I have the
following files (amongst others):
/com/example/ws/proxies/TestServiceProxy.class
/com/example/account/ApplicationManager.class
/com/example/account/ApplicationManagerBean.class
ApplicationManagerBean.class is set up as follows:
@Stateless( name = "ApplicationManager" )
@Local( ApplicationManager.class )
In /services, my Test web service instantiates
com.example.ws.proxies.TestServiceProxy and calls a method in there. This in
turn tries to do this:
ApplicationManager applicationManager = (ApplicationManager) (new
InitialContext()).lookup("example/ApplicationManager/local");
This in turn gives me this error:
2013-05-31 10:28:16,068 WARN [http-bio-8080-exec-1]
ws.proxies.TestServiceProxy.testGet(152): Exception getting ApplicationManager:
Name "/example/ApplicationManager/local" not found.
javax.naming.NameNotFoundException: Name "/example/ApplicationManager/local"
not found.
How do I use this naming system to refer to an object within its own JAR file?
I'm using this format in system.properties:
java.naming.factory.initial =
org.apache.openejb.client.LocalInitialContextFactory
openejb.deploymentId.format = {ejbJarId}/{ejbName}
openejb.jndiname.format = {deploymentId}/{interfaceType.annotationNameLC}
I've tried using the global JNDI name too and I haven't been able to get that
to work either.
Thanks,
- Andrew.