• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB JNDI look-up problem  RSS feed

 
glen quagmire
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

My question possibly relates to the very basics of handling remote EJBs in stand alone clients but since I never done it before I thought I might be doing something wrong.
I am intending to develop a small server app with remote stand alone client. I had a quick go in Netbeans 6.9, wrote a stateless EJB with remote interface, run the server all woks well.. So I'm trying to look it up using JNDI with the following code:



Now when I run the client I get the following error:

Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ejb/RemoveException

followed by the whole stack right down to the main method where the actual lookup line is.

I've already had a good look around the web and found similar threads but nothing about this particular one.

I have imported gf-client.jar as required to provide the naming service. The actual loopup seems to work but I don't know why does javax/ejbRemoveException pops up every time I try to run it.

Any pointers will be greatly appreciated.

Glen
 
Pallav Bora
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB is bound in th eJNDI contect of the server. So calling new InitialContect() in a a stand alone client will not contain any JNDI information defined in the server JNDI space. So you can try creating InitialContext() in the following way:

new InitialContext(YOUR_SERVER_JNDI_PROVIDER_URL, UID, PW)
 
glen quagmire
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pallav Bora wrote:EJB is bound in th eJNDI contect of the server. So calling new InitialContect() in a a stand alone client will not contain any JNDI information defined in the server JNDI space. So you can try creating InitialContext() in the following way:

new InitialContext(YOUR_SERVER_JNDI_PROVIDER_URL, UID, PW)


 
glen quagmire
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pallav Bora wrote:EJB is bound in th eJNDI contect of the server. So calling new InitialContect() in a a stand alone client will not contain any JNDI information defined in the server JNDI space. So you can try creating InitialContext() in the following way:

new InitialContext(YOUR_SERVER_JNDI_PROVIDER_URL, UID, PW)


Thanks four quick reply. I am a bit confused now. I followed the following GlassFish Community thread: https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB

specifically point 4:

"If the stand-alone java client is running on a different host than the server, set the -Dorg.omg.CORBA.ORBInitialHost property when starting the client JVM. E.g.
java -Dorg.omg.CORBA.ORBInitialHost=com.acme.Host1. This property defaults to localhost, so it is not necessary to set it if the java client is running on the same machine as the server."

At the moment the actual client client is actual running on the same machine so according to the above it defaults to localhost, am I right?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!