tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: DB connection error -Tomcat 6 config
Date Thu, 18 Mar 2010 22:13:52 GMT
> From: Propes, Barry L [mailto:barry.l.propes@citi.com]
> Subject: RE: DB connection error -Tomcat 6 config
> 
> Connection connection = null;
> Context initCtx = new InitialContext();
> Context envCtx = (Context) initCtx.lookup("java:comp/env");
> DataSource ds = (DataSource) envCtx.lookup("jdbc/myoracle");

That's what you showed us earlier, but afterwards you posted this:

> An error occurred at line: 68 in the jsp file: /chngctrl/chgctrl_details.jsp
> Type mismatch: cannot convert from Object to Context
> 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");

Since things are a bit confused now, you might want to verify that the JSP source is what
it should be (using envCtx for the lookup of "jdbc/myoracle"), and clean out Tomcat's work
directory in case there's something ugly left lying around in there, and restart Tomcat, of
course.

 - 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message