Skip to main content

JNDI lookup from WebService application to another (EJB application) deployed on same Glassfish server

No replies
skorbas
Offline
Joined: 2012-05-10
Points: 0

I created EJB server application which communicates well with clients(Java desktop apps). Remote clients just use JNDI lookup to get access to EJBeans deployed on Glassfish server.
After this step I want to extend server application to be more flexible for working with non-Java based clients. I mean browser applications based on Javascript.
The best way is to implement WebService on Glassfish that will call my EJB beans. What I have tried:

Created separate "Dynamic Web Project" application in Eclipse calling via JNDI enterpsise beans from the first app. Although WebService was properly deployed it cannot lookup beans from other
application deployed on Glassfish. It was strange because I used portable JNDI names suggested by Glassfish server. Always got exception:

"SEVERE: javax.naming.NamingException: Lookup failed for 'java:global/EjbApplication/SystemIf' in SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: *SystemIf not found*]"

and my lookups from remote clients
worked. After many tries I gave up. (Now I am not sure if calling EJB from another EJB app by WebService app deployed on same Glassfish server is possible)