This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have been going around lots of forums to figure out how to call a Remote interface in glassfish 3.1.
I have the following:
Then, in a different package in eclipse I have the following client, which happens to be a Stateless Bean as well. Basically, I need this 'client' to reside in the same application server, but in a different package:
Whenever I call the client via a web service, which resides in the same package as the client (i.e p2 ) I am getting the following error:
<return>Lookup failed for 'java:global/p1/XbajtBean!p1.XbajtBeanRemote' in SerialContext </return>
note that when I make a jndi-list lookup on glassfish, I get the following:
so, the JNDI name DOES exist, yet, glassfish is not finding it whenever a call is issued by the cient, which happens to be on the same app server, just a different package.
( I have tried using local interfaces, and still no avail )
Your help would be really apreciated, since I have been pondering on this for days.
Ankit Garg wrote:William, checkout this page, it contains the syntax to find the JNDI name of beans...
Thanks Ankit for the reply.
However, p1 & p2 are totally different applications, therefore I have to use the java:global notation.
Moreover, my aim is to eventually call the Remote Interface from another remote application server,
but if I am unable to call remote interfaces within the same app server, then I reckon Im gonna hava a problem with that
Anyway, I did some further research and by doing the asadmin list-jndi-entries command I get the following:
Jaikiran Pai wrote:Can you post the entire exception stacktrace?
Sure. Here it goes:
(Please note that the calling remote client consists of:
p2.XbajtWS which is a simple webservice which calls p2.XbajtCaller. XbajtCaller is basically the client stateless bean invoking the initial lookup)
When you deploy an artifact (for instance an ejb-jar module), Glassfish prints in the server.log file the portable JNDI namess and non portable JNDI names. Refer to this names if you want to be sure on the right name of your component.