geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xh <xhsaymyn...@yahoo.co.uk>
Subject G1.1 to G2.0-M6 migration: JDBC ClassCastException: DelegatingDriver
Date Sun, 15 Jul 2007 09:34:32 GMT
Hi All,

I'm migrating my application from G1.1 to G2.0-M6 and have very strange error...

I use for my Web application embedded Derby.

I have successfully created pool, I use the same web-application.xml and web.xml files that
were used in G1.1.

the datasource fetched from JNDI is not NULL, but getConnection() throws ClassCastException
exception when retrieving connection.

I don't have the slightest idea what is wrong...

the snippet:

public Connection getConnection() {
/*
fetching, etc.
...
*/
System.out.println(datasource);
return datasource.getConnection(); // class cast exception
}

results in:

org.tranql.connector.jdbc.DataSource@534153

11:18:11,828 ERROR [[DispatcherServlet]] Servlet.service() for servlet DispatcherServlet threw
exception
java.lang.ClassCastException: org.apache.geronimo.jdbc.DelegatingDriver
        at org.apache.derby.jdbc.EmbeddedDataSource.findDriver(Unknown Source)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown Source)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown Source)
        at org.apache.derby.jdbc.EmbeddedXADataSource.setupResourceAdapter(Unknown Source)
        at org.apache.derby.jdbc.EmbeddedXADataSource.getXAConnection(Unknown Source)
        at org.tranql.connector.jdbc.AbstractXADataSourceMCF.getPhysicalConnection(AbstractXADataSourceMCF.jav
a:74)
        at org.tranql.connector.derby.EmbeddedXAMCF.createManagedConnection(EmbeddedXAMCF.java:52)
        at org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionIntercep
tor.java:48)
        at org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterceptor.getConnection(LocalXARes
ourceInsertionInterceptor.java:41)
        at org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor.internalGetConnection(Single
PoolConnectionInterceptor.java:66)
        at org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(Abstra
ctSinglePoolConnectionInterceptor.java:78)
        at org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnl
istingInterceptor.java:46)
        at org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachi
ngInterceptor.java:95)
        at org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleIn
terceptor.java:43)
        at org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
        at org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTracki
ngInterceptor.java:66)
        at org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnect
ionManager.java:61)
        at org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56)
        at org.xh.dataweaver.common.db.DerbyConnectionFactory.getConnection(DerbyConnectionFactory.java:38)
        at org.xh.dataweaver.web.dao.WebModuleDAO.findModuleByName(WebModuleDAO.java:23)
        at org.xh.dataweaver.web.engine.RequestDispatcher.dispatchAndProcess(RequestDispatcher.java:44)
        at org.xh.dataweaver.web.engine.DispatcherServlet.processRequest(DispatcherServlet.java:40)
        at org.xh.dataweaver.web.engine.DispatcherServlet.doGet(DispatcherServlet.java:104)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
        at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
        at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:57)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.xh.dataweaver.web.filter.CharsetFilter.doFilter(CharsetFilter.java:26)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
        at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext
.java:358)
        at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)
11:18:11,953 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: org.apache.geronimo.jdbc.DelegatingDriver
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.xh.dataweaver.web.filter.CharsetFilter.doFilter(CharsetFilter.java:26)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
        at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext
.java:358)
        at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)

my deployment plan is:

<?xml version="1.0" encoding="UTF-8"?>

    
        <dep:moduleId>
            <dep:groupId>console.dbpool</dep:groupId>
            <dep:artifactId>DataWeaverWARDerby</dep:artifactId>
            <dep:version>1.0</dep:version>
            <dep:type>rar</dep:type>
        </dep:moduleId>
        <dep:dependencies>
            <dep:dependency>
                <dep:groupId>org.apache.derby</dep:groupId>
                <dep:artifactId>derby</dep:artifactId>
                <dep:version>10.2.2.0</dep:version>
                <dep:type>jar</dep:type>
            </dep:dependency>
        </dep:dependencies>
    </dep:environment>
    <resourceadapter>
        <outbound-resourceadapter>
            <connection-definition>
                <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
                <connectiondefinition-instance>
                    <name>DataWeaverWARDerby</name>
                    <config-property-setting name="Password"/>
                    <config-property-setting name="LoginTimeout"/>
                    <config-property-setting name="DatabaseName">dataweaver</config-property-setting>
                    <config-property-setting name="CreateDatabase">false</config-property-setting>
                    <config-property-setting name="UserName"/>
                    <connectionmanager>
                        <local-transaction/>
                        <single-pool>
                            <max-size>10</max-size>
                            <min-size>0</min-size>
                            <match-one/>
                        </single-pool>
                    </connectionmanager>
                </connectiondefinition-instance>
            </connection-definition>
        </outbound-resourceadapter>
    </resourceadapter>
</connector>


in web.xml I have:

    <resource-ref>
        <res-ref-name>jdbc/DataWeaverDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>

in web-application.xml I have:


            <dependency>
                <groupId>console.dbpool</groupId>
                <artifactId>DataWeaverWARDerby</artifactId>
            </dependency>
...

    <resource-ref>
        <ref-name>jdbc/DataWeaverDS</ref-name>
        <pattern>
            <groupId>console.dbpool</groupId>
            <artifactId>DataWeaverWARDerby</artifactId>
            <name>DataWeaverWARDerby</name>
        </pattern>
    </resource-ref>

any ideas?

best regards
Lukasz




		
___________________________________________________________ 
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre.
http://uk.security.yahoo.com
Mime
View raw message