• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting Initial Context Exception

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reference Annie.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic