java - ClassCastException of StructDescriptor on websphere but not on tomcat -
my application working fine on local tomcat server. later deployed in websphere making war file. after deployment, whenever try make call stored procedure using structdescriptor follows, getting classcastexception. following code segment:
structdescriptor projecttypedesc = structdescriptor.createdescriptor( "fra_data.region_type", st.getconnection()); struct[] structs = new struct[filterdto.getregion().size()]; (int = 0; < filterdto.getregion().size(); ++i) { int str = (int) filterdto.getregion().get(i).intvalue(); object[] objects = new object[] { str }; struct struct = new struct(projecttypedesc, st.getconnection(), objects); structs[i] = struct; } arraydescriptor arraydescriptor = arraydescriptor.createdescriptor( "fra_data.regions", st.getconnection()); arraylist.add(new array(arraydescriptor, st.getconnection(), structs));
and error thrown :
java.lang.classcastexception: com.ibm.ws.rsadapter.jdbc.wsjdbcconnection incompatible oracle.jdbc.oracleconnection @ oracle.sql.structdescriptor.createdescriptor(structdescriptor.java:169) @ oracle.sql.structdescriptor.createdescriptor(structdescriptor.java:140) @ com.citi.oprisk.cpa.repository.impl.reportrepositoryimpl.setfilterarraysfororacle(reportrepositoryimpl.java:310) @ com.citi.oprisk.cpa.repository.impl.reportrepositoryimpl.getcommonprocesssystemreportusingsp(reportrepositoryimpl.java:385) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:48) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:600) @ org.springframework.aop.support.aoputils.invokejoinpointusingreflection(aoputils.java:302) @ org.springframework.aop.framework.reflectivemethodinvocation.invokejoinpoint(reflectivemethodinvocation.java:190) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:157) @ org.springframework.transaction.interceptor.transactioninterceptor$1.proceedwithinvocation(transactioninterceptor.java:99) @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:281) @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:96) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:208) @ com.sun.proxy.$proxy2088.getcommonprocesssystemreportusingsp(unknown source) @ com.citi.oprisk.cpa.service.impl.cpareportserviceimpl.getcommonprocessreport(cpareportserviceimpl.java:271) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:48) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:600) @ org.springframework.aop.support.aoputils.invokejoinpointusingreflection(aoputils.java:302) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:202) @ com.sun.proxy.$proxy2089.getcommonprocessreport(unknown source) @ com.citi.oprisk.cpa.controller.cpadashboardcontroller.getcommonprocesssystemreport(cpadashboardcontroller.java:98) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:48) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:600) @ org.springframework.web.method.support.invocablehandlermethod.doinvoke(invocablehandlermethod.java:222) @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:137) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:110) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlermethod(requestmappinghandleradapter.java:814) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:737) @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:959) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:893) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:969) @ org.springframework.web.servlet.frameworkservlet.dopost(frameworkservlet.java:871) @ javax.servlet.http.httpservlet.service(httpservlet.java:738) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:845) @ javax.servlet.http.httpservlet.service(httpservlet.java:831) @ com.ibm.ws.webcontainer.servlet.servletwrapper.service(servletwrapper.java:1661) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:944) @ com.ibm.ws.webcontainer.servlet.servletwrapper.handlerequest(servletwrapper.java:507) @ com.ibm.ws.webcontainer.servlet.servletwrapperimpl.handlerequest(servletwrapperimpl.java:181) @ com.ibm.ws.webcontainer.webapp.webapp.handlerequest(webapp.java:3954) @ com.ibm.ws.webcontainer.webapp.webgroup.handlerequest(webgroup.java:276) @ com.ibm.ws.webcontainer.webcontainer.handlerequest(webcontainer.java:945) @ com.ibm.ws.webcontainer.wswebcontainer.handlerequest(wswebcontainer.java:1592) @ com.ibm.ws.webcontainer.channel.wcchannellink.ready(wcchannellink.java:191) @ com.ibm.ws.ard.channel.ardchannelconnlink.handlediscrimination(ardchannelconnlink.java:188) @ com.ibm.ws.ard.channel.ardchannelconnlink.ready(ardchannelconnlink.java:93) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.handlediscrimination(httpinboundlink.java:453) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.handlenewrequest(httpinboundlink.java:515) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.processrequest(httpinboundlink.java:306) @ com.ibm.ws.http.channel.inbound.impl.httpinboundlink.ready(httpinboundlink.java:277) @ com.ibm.ws.tcp.channel.impl.newconnectioninitialreadcallback.sendtodiscriminators(newconnectioninitialreadcallback.java:214) @ com.ibm.ws.tcp.channel.impl.newconnectioninitialreadcallback.complete(newconnectioninitialreadcallback.java:113) @ com.ibm.ws.tcp.channel.impl.aioreadcompletionlistener.futurecompleted(aioreadcompletionlistener.java:175) @ com.ibm.io.async.abstractasyncfuture.invokecallback(abstractasyncfuture.java:217) @ com.ibm.io.async.asyncchannelfuture.firecompletionactions(asyncchannelfuture.java:161) @ com.ibm.io.async.asyncfuture.completed(asyncfuture.java:138) @ com.ibm.io.async.resulthandler.complete(resulthandler.java:204) @ com.ibm.io.async.resulthandler.runeventprocessingloop(resulthandler.java:775) @ com.ibm.io.async.resulthandler$2.run(resulthandler.java:905) @ com.ibm.ws.util.threadpool$worker.run(threadpool.java:1656)
the object created in data base follows:
create or replace type region_type object (region number); create or replace type regions table of region_type;
i tried search on different forms , didn't solution. please help.
use wscallhelper.getnativeconnection "unwrap" oracleconnection contained in wsjdbcconnection:
structdescriptor projecttypedesc = structdescriptor.createdescriptor( "fra_data.region_type", wscallhelper.getnativeconnection(st.getconnection()));
Comments
Post a Comment