• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Initial Context Exception

 
Nischal Tanna
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys
I have written a simple stateless session bean and am using the application server downloaded from java.sun.com
My bean has been deployed successfuly and now i am trying to access the same from a standalone client. I have the ejb client jar generated by the deploy tool in the client class path

My client code is as follows:



However i am getting an exception as :



I am sure this has relation with the Initial Context Factory or the provider url. can any 1 clarify me what should be their values for the server?
 
clive jordan
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nischal,

I am no expert here, and not used the Sun server.

It appears you are getting a COS (CORBA) error. Unless the Sun JNDI server stores everything this way (which I think unlikely), I would assume that you are loading the wrong driver.

You just want standard JNDI.

Clive
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lookups work slightly different with Sun AS. Check here.
 
clive jordan
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reference Annie.
 
Srinivas Reddy Patelu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of Standalone Java client, try it from servlet. From Servlet you can call java calss if you want. Java class will contain lookup code. Thanks
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Srinivas Reddy Patelu:
Instead of Standalone Java client, try it from servlet. From Servlet you can call java calss if you want. Java class will contain lookup code. Thanks


That shouldn't make much of a difference except for the fact that the InitialContext() would not require any environment properties, if the servelt is using the same app server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!