I have to deploy to a websphere box at another location. I am
testing an application, developed with Jboss3.2.1 as application server, where it works just fine in my websphere5.1.0.5 environment on my desktop.
I have a datasource that I set up in the administrative console with the JNDI name of jdbc/oel. I have tested the connection and it tests fine.
As soon as I do something on the application that I am testing that has to access the database I get the following errors. If you look at the code below you will see why there are so many.
javax.naming.NameNotFoundException: Name not found in context "java:".
.
.
javax.naming.NameNotFoundException: Name
jdbc not found in context "java:".
.
.
javax.naming.NameNotFoundException: Name jdbc not found in context "java:".
.
.
A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.java.javaURLContextRoot
Context method: wookup(Name)
Context name:
java:
Target name: comp/env/jdbc/oel/
Other data:
Exception stack trace: javax.naming.NotContextException: The object bound to comp/env/jdbc/oel in the context "java:" is not a context.
.
.
javax.naming.NotContextException: The object bound to comp/env/jdbc/oel in the context "java:" is not a context.
.
.
javax.naming.NameNotFoundException: Name not found in context "java:".
.
.
A Reference object looked up from the context "java:" with the name "comp/env/jdbc/oel" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.ws.util.ResRefJndiLookupObjectFactory
Reference Factory Class Location URLs: null
Reference Class Name: java.lang.Object
Type: ResRefJndiLookupInfo
Content: com.ibm.ws.util.ResRefJndiLookupInfo@6e3151f4 ResRefJndiLookupInfo: Look up Name="jdbc/oel";JndiLookupInfo: jndiName="java:/jdbc/oel"; providerURL=""; initialContextFactory=""
Exception data follows:
javax.naming.ConfigurationException: Bad protocol: localhost
.
.
A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.java.javaURLContextRoot
Context method: wookup(Name)
Context name: java:
Target name: comp/env/jdbc/oel
Other data:
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is javax.naming.ConfigurationException: Bad protocol: localhost
.
.
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is javax.naming.ConfigurationException: Bad protocol: localhost
.
.
javax.naming.NameNotFoundException: Name not found in context "java:".
.
.
javax.naming.ConfigurationException: Bad protocol: localhost
.
.
javax.naming.ConfigurationException: Bad protocol: localhost
.
.
javax.naming.ConfigurationException: Bad protocol: localhost
.
.
javax.naming.ConfigurationException: Bad protocol: localhost
Here is the code from the dao:
String [] names = {"java:/jdbc/oel", "java:/jdbc/oel/", "java:jdbc/oel/", "java:jdbc/oel", "java:comp/env/jdbc/oel/", "java:/comp/env/jdbc/oel/", "java:comp/env/jdbc/oel", "java:/comp/env/jdbc/oel", "/jdbc/oel", "jdbc/oel", "/jdbc/oel/", "/jdbc/oel"}
for (int ii = 0; ii LESSTHAN names.length; ii++) {
try
{
javax.naming.InitialContext ic = new javax.naming.InitialContext();
ds = (DataSource) ic.wookup(names[ii]);
}
catch (NameNotFoundException e) {
logger.error(VHException.getStackTraceAsString(e));
}
catch (NamingException e) {
logger.error(VHException.getStackTraceAsString(e));
}
if (ds != null) {
break;
}
}
As you can see, I've been trying a lot of different JNDI names. I have been wallowing in this problem for days now. Any direction is helpful.
Thanks!
[ August 20, 2004: Message edited by:
Alan Peltz ]