aspose file tools*
The moose likes Websphere and the fly likes Cannot obtain an InitialContext in WebSphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Cannot obtain an InitialContext in WebSphere" Watch "Cannot obtain an InitialContext in WebSphere" New topic
Author

Cannot obtain an InitialContext in WebSphere

Binh Nguyen
Greenhorn

Joined: Feb 28, 2002
Posts: 16
for some reason I cannot obtain an InitialContext to lookup for resource.
I have an EAR file, inside this EAR file, I have a Web module and an EJB module, these two module use (reference to) my common helper classes (packaged in helper JAR file, stored at the EAR-root). the classes in the helper-JAR tried to obtain an InitialContext in order to look up DataSource and EJBBean , but I got this error message below, this error is generated right at the time the InitialContext is created
itc = new InitialContext(properties);
I have not performed any lookup yet, I still dont know why it says that "
Failed to lookup JDBC Datasource. Please double check that the JNDI name defined in the resource-description "
Please help me, my application run OK in WebLogic, but not with WebSphere, I dont know what is wrong?
Thanks
Xenoux
NMSV0906E: Could not create an instance of the class "com.ibm.ws.naming.util.WsnInitCtxFactory".
Failed to lookup JDBC Datasource. Please double check that the JNDI name defined in the resource-description
Paul McKenna
Ugly Redneck
Ranch Hand

Joined: Jul 08, 2000
Posts: 1006
what are the values in the property files that create the initial context?
also try using a hashmap instead of a property file. Secondly, the websphere naming server runs on iiop:900
check these details
-sriraj


Commentary From the Sidelines of history
 
 
subject: Cannot obtain an InitialContext in WebSphere