wsjdbcconnection incompatible with oracle.jdbc.oracleconnection

2035 views
Skip to first unread message

Rajeev Chaudhary

unread,
Nov 26, 2009, 12:56:09 AM11/26/09
to
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(ArrayDescriptor.java:149)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115)
at com.syfact.mo.administrator.pctr.LoadAction.loadPostalcodes(LoadAction.java:182)
at com.syfact.mo.administrator.pctr.LoadAction.doAction(LoadAction.java:490)
at com.syfact.web.servlet.Syfact.processStandardCommand(Syfact.java:370)
at com.syfact.web.servlet.Syfact.doPost(Syfact.java:291)
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.service(ServletWrapper.java:966)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at com.syfact.ConnectionFilter.doFilter(ConnectionFilter.java:40)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(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.handleRequest(ServletWrapper.java:475)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3107)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1425)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:92)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:725)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)


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

Example:

connection = (Connection) WSJdbcUtil.getNativeConnection((WSJdbcConnection)dataSource.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......

HenkW

unread,
Nov 27, 2009, 4:42:17 AM11/27/09
to
on the other hand, do you have specific Oracle packages in your app?

Henk


atulp...@gmail.com

unread,
Aug 23, 2012, 10:25:02 AM8/23/12
to
Use below line to remove java.lang.ClassCastException

((oracle.jdbc.OracleConnection)WSCallHelper.getNativeConnection(( WSJdbcConnection)connection))

srivenk...@gmail.com

unread,
Nov 2, 2018, 10:39:13 AM11/2/18
to
Hi did you got solution for this ? I also facing the same problem. I need to deploy in different server. Application is running successfully in Weblogic server but facing problem in Websphere. can you please help to resolve this issue
Reply all
Reply to author
Forward
0 new messages