wsjdbcconnection incompatible with oracle.jdbc.oracleconnection - Websphere

This is a discussion on wsjdbcconnection incompatible with oracle.jdbc.oracleconnection - Websphere ; java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.wsjdbcconnection incompatible with oracle.jdbc.oracleconnection I am getting this Exception when running my code on Websphere6.1 using JNDI.However this same code is running fine on Weblogic 8.1,Tomcat 5.5,JBoss 4.2.x. The Code also runs fine via *JNDI* using *Data sources (WebSphere ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: wsjdbcconnection incompatible with oracle.jdbc.oracleconnection

  1. wsjdbcconnection incompatible with oracle.jdbc.oracleconnection

    java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.wsjdbcconnection incompatible with oracle.jdbc.oracleconnection

    I am getting this Exception when running my code on Websphere6.1 using JNDI.However this same code is running fine on Weblogic 8.1,Tomcat 5.5,JBoss 4.2.x.
    The Code also runs fine via *JNDI* using *Data sources (WebSphere Application Server V4)*

    And the code also works fine when I am Running the application via non JNDI.But the below mentioned Exception is coming when I am using the *DataSource configuration* in Websphere via JNDI.

    Below is the StackTrace of the Exception coming

    com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with oracle.jdbc.OracleConnection
    *java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with oracle.jdbc.OracleConnection*
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayD escriptor.java:149)
    at oracle.sql.ArrayDescriptor.createDescriptor(ArrayD escriptor.java:115)
    at com.syfact.mo.administrator.pctr.LoadAction.loadPo stalcodes(LoadAction.java:182)
    at com.syfact.mo.administrator.pctr.LoadAction.doActi on(LoadAction.java:490)
    at com.syfact.web.servlet.Syfact.processStandardComma nd(Syfact.java:370)
    at com.syfact.web.servlet.Syfact.doPost(Syfact.java:2 91)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:966)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:907)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:145)
    at com.syfact.ConnectionFilter.doFilter(ConnectionFil ter.java:40)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:190)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:130)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._ doFilter(WebAppFilterChain.java:87)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager .doFilter(WebAppFilterManager.java:696)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager .doFilter(WebAppFilterManager.java:641)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:475)
    at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.h andleRequest(ServletWrapper.java:463)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3107)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:238)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:811)
    at com.ibm.ws.wswebcontainer.WebContainer.handleReque st(WebContainer.java:1425)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:92)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:465)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewInformation(HttpInboundLink.java:394)
    at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa llback.complete(HttpICLReadCallback.java:102)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :152)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:213)
    at com.ibm.io.async.AbstractAsyncFuture.fireCompletio nActions(AbstractAsyncFuture.java:195)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:136)
    at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:193)
    at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:725)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:847)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1498)


    i have been searching for solutions on this problem for nearly a week and found one:

    Example:

    connection = (Connection) WSJdbcUtil.getNativeConnection((WSJdbcConnection)d ataSource.getConnection());
    OracleCallableStatement ocstmt = (OracleCallableStatement) connection.prepareCall(sql); "*

    I do not want to have WAS libraries in my project because my code is not to be deployed only on websphere but it should be deployable on Tomcat,JBoss,Weblogic .etc......

  2. Re: wsjdbcconnection incompatible with oracle.jdbc.oracleconnection

    on the other hand, do you have specific Oracle packages in your app?

    Henk



+ Reply to Thread