I put the factory statement back in context.xml and I get the same error
again (only this time I have added code to the SQL exception logic to
display the stack trace stopping at the line that invoced the jsp that calls
JsrSQL. All the "trace" that is part of the message appears to me to be the
same as was in the previous email (which did not have the factory line in
context.xml).
FYI the factory line is:
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
The only context.xml file is in the etc directory and thus applies to all
domains.
The main difference is for 5.5 vs. 5.0 is that there is one Resource
statement in context.xml
vs. having a resource link in context.xml for each project and one Resource
statement in server.xml.
PS: Note the Stack= lines at the bottom. All the stuff before them from
"Cannot create" down is part of the getMessage() return variable. Note the
slight difference in line #s. Stack(0) has line 1225 vs. 1221 in the "stack
dump" part of the getMessage() line.
2010-01-26 05:38:29:*WARNING*Connection to jdbc/MySql:: connect SQL
exception: Cannot create PoolableConnectionFactory (Server connection
failure during transaction. Due to underlying exception:
'java.io.CharConversionException'. ** BEGIN NESTED EXCEPTION **
java.io.CharConversionException STACKTRACE: java.io.CharConversionException
at gnu.gcj.convert.Input_iconv.read(libgcj.so.81) at
java.lang.String.init(libgcj.so.81) at java.lang.String.(libgcj.so.81) at
com.mysql.jdbc.SingleByteCharsetConverter.(SingleByteCharsetConverter.java:153)
at
com.mysql.jdbc.SingleByteCharsetConverter.initCharset(SingleByteCharsetConverter.java:108)
at
com.mysql.jdbc.SingleByteCharsetConverter.getInstance(SingleByteCharsetConverter.java:86)
at com.mysql.jdbc.Connection.getCharsetConverter(Connection.java:3505) at
com.mysql.jdbc.Statement.(Statement.java:290) at
com.mysql.jdbc.Connection.createStatement(Connection.java:3123) at
com.mysql.jdbc.Connection.createStatement(Connection.java:3103) at
com.mysql.jdbc.Connection.loadServerVariables(Connection.java:4475) at
com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:4062) at
com.mysql.jdbc.Connection.createNewIO(Connection.java:2940) at
com.mysql.jdbc.Connection.(Connection.java:1555) at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at com.jsrsys.web.JsrSQL.connect(JsrSQL.java:506) at
com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86) at
com.jsrsys.web.JsrSQL.(JsrSQL.java:42) at
org.apache.jsp.AppList_jsp._jspService(AppList_jsp.java:157) at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
java.lang.reflect.Method.invoke(libgcj.so.81) at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at
java.security.AccessController.doPrivileged(libgcj.so.81) at
javax.security.auth.Subject.doAsPrivileged(libgcj.so.81) at
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:262)
at
org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:192)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:171)
at java.security.AccessController.doPrivileged(libgcj.so.81) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:167)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:544)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(libgcj.so.81) ** END NESTED EXCEPTION ** Attempted
reconnect 3 times. Giving up.)
2010-01-26
05:38:29:Stack(6)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
2010-01-26
05:38:29:Stack(5)=org.apache.jsp.AppList_jsp._jspService(AppList_jsp.java:157)
2010-01-26 05:38:29:Stack(4)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42)
2010-01-26
05:38:29:Stack(3)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86)
2010-01-26 05:38:29:Stack(2)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:506)
2010-01-26
05:38:29:Stack(1)=org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
2010-01-26
05:38:29:Stack(0)=org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
2010-01-26 05:38:24:JsrSQL: DataSource cast successfull
2010-01-26 05:38:24:JsrSQL: Context cast successfull
----- Original Message -----
From: "Konstantin Kolinko" <knst.koli...@gmail.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, January 25, 2010 3:14 PM
Subject: Re: Tomcat 5.5 org.apache.naming.ResourceRef cannot be cast to
javax.sql.DataSource
2010/1/25 Steve Ryder <sry...@jsrsys.com>:
<Resource name="jdbc/MySql" auth="Container" type="javax.sql.Datasource"
The above should be "javax.sql.DataSource"
Do you have any references to this resource in your web.xml file?
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org