wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes Cant access EJB from a J2SE client - Lookup Failed Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Cant access EJB from a J2SE client - Lookup Failed Error" Watch "Cant access EJB from a J2SE client - Lookup Failed Error" New topic
Author

Cant access EJB from a J2SE client - Lookup Failed Error

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
I am using Netbeans and am experimenting with EJBs.

I have two projects (2 separate applications)

1- A J2EE Project called EnterpriseApp

2- A standard J2SE Project called Test

Now Here is what I did - in EnterpriseApp I generated a stateless EJB called TestEJB with both local and remote interfaces. For the remote project selection I selected the Test App. In short the bean code looks like this


And in the J2SE client Project here is my main class through which i am trying to access the bean



This is the contents of JNDI.properties file

java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url.pkgs = com.sun.enterprise.naming
java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
#optional. Defaults to localhost. Only needed if web server is running
#on a different host than the appserver
org.omg.CORBA.ORBInitialHost = localhost
#optional. Defaults to 3700. Only needed if target orb port is not 3700.
org.omg.CORBA.ORBInitialPort = 3700

And I get this error at
TestEjbRemote testEJB = (TestEjbRemote) ctx.lookup("stateless.TestEjbRemote");




Any suggestions on how i may resolve this issue ?


James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

What web server is your App deployed to?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cant access EJB from a J2SE client - Lookup Failed Error