Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cant access EJB from a J2SE client - Lookup Failed Error

 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What web server is your App deployed to?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic