Well, while I did point it to the proper factory object -
factory="org.apache.tomcat.dbcp.dbcp.DataSourceConnectionFactory"
I still get the same error -
An error occurred at line: 68 in the jsp file: /chngctrl/chgctrl_details.jsp
Type mismatch: cannot convert from Object to Context
65:
66: Connection connection = null;
67: Context initCtx = new InitialContext();
68: Context envCtx = initCtx.lookup("java:comp/env");
69: // Look up our data source
70: DataSource ds = initCtx.lookup("jdbc/myoracle");
71:
SEVERE: Servlet.service() for servlet jsp threw exception
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at
org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:97)
at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) --
this line - I even tried importing the javax.naming.spi.NamingManager class in
my JSP to see if that would help
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at
org.apache.jsp.chngctrl.chgctrl_005fdetails_jsp._jspService(chgctrl_005fdetails_jsp.java:141)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
Same error.
-----Original Message-----
From: Caldarale, Charles R [mailto:[email protected]]
Sent: Thursday, March 18, 2010 3:17 PM
To: Tomcat Users List
Subject: RE: DB connection error -Tomcat 6 config
> From: Propes, Barry L [mailto:[email protected]]
> Subject: RE: DB connection error -Tomcat 6 config
>
> Good point...I'll switch back to
> factory="org.apache.tomcat.dbcp.DataSourceConnectionFactory"
Again, that factory reference is incorrect - there's no such class. If you
insist on specifying one, and you want to use Tomcat's factory, the value is
"org.apache.tomcat.dbcp.dbcp.DataSourceConnectionFactory" (note the additional
.dbcp in the proper setting).
All the symptoms point to your <Resource> element being ignored. Check that
you don't have a <Context> element in conf/Catalina/[host]/chngctrl.xml that's
overriding the one in the webapps/chngctrl/META-INF/context.xml file.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]