I'm trying to learn ejb's using Orion's web server.  I'm currently running 1.5.4.  I appreciate all the help I've gotten so far.
 
Basically, I'm trying to get the CabinBean example from O'Reilly publishings "Enterprise JavaBeans 2nd Edition" working.  I think I'm pretty close.  I just need to understand a couple things.
 
I'm basically referencing the enterprise beans from an application outside the ejb container (a regualar class with a static void main method).  I've got all the required things put together.  I have the ejb-jar.xml in the META-INF of the cabin.jar.  I have the application.xml in the META-INF of the cabin.ear.  I have an application-client.xml in a META-INF of where my application is running.  It seems to be looking at the application xml like it should.
 
The problem is, when i do:
 
Context jndiContext = new InitialContext();
Object ref = jndiContext.lookup("java:comp/env/ejb/CabinHome");
 
The client fails on the lookup statement.  I get the following error:
 
javax.naming.NamingNotFoundException: ejb/CabinHome not found in Application Client
 
Now, when I look at my beans in the orionconsole, it doesn't look like they are necessarily deployed under comp/env/ejb/.  It looks like it's listed under comp.  Maybe this doesn't matter.
 
I've done some RMI programming in the past, and understand some things about the naming lookup.  For starters, where is it specified where the beans actually get binded to??  For instance, with rmi, if I had a bean called 'whatever', I could explicitly bind it to "newbean/whatever", and then my lookup statement would be:  lookup("newbean/whatever").  Could someone explain this to me a bit...
 
Mostly, I'm just trying to get my beans located from my client program.  Any insight on this would be greatly appreciated.
 
Also, In my jndi.properties file, I'm using ApplicatonClientInitialContextFactory.  When I tried using RMIInitialContextFactory, i got errors.  Just curious as to what the differences are, and what the proper factory is, and where it should be used.
 
Thanks again for all of your help.
 
Joe

Reply via email to