Hi, not sure to understand how you deploy your app. For instance, you jar module (if alone as I understood) should be in apps/ (see deployment tag in tomee.xml). If you wanna call components between Java EE modules (separate jar file for example), you have to use global JNDI names.
As a side note, using beanName is not portable at all. If you have a small example to share, we can git it a try. JLouis 2013/5/31 AndrewClarke <s...@clarke.ca> > I should explain my subject a bit better. In addition to what I described > below, code like this in a bean just populates the variable with null: > > @EJB( beanName = "MessageManager" ) > private MessageManager messageManager; > > I assumed it's the same basic issue as I wrote below, although maybe that's > not the case. > > Thanks again, > - Andrew. > > > AndrewClarke wrote > > 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. > > > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/EJB-within-JAR-tp4663375p4663376.html > Sent from the OpenEJB User mailing list archive at Nabble.com. > -- Jean-Louis