Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » "cannot be cast" error in Weblogic server 10.3.5 (Strange error only in Weblogic 10.3.5 container)
"cannot be cast" error in Weblogic server 10.3.5 [message #832799] Fri, 30 March 2012 15:52 Go to next message
David Mising name is currently offline David Mising nameFriend
Messages: 24
Registered: June 2010
Junior Member
Hi there,

I have a simple query like this,
List<OrderSet> emps = em
.setParameter("nameID", this.orderNo)

if (emps.size() == 0) {
throw createMsgStoreServiceException("Order is not in Message Stoer.");

OrderSet os = emps.get(0);

When I run as a java application (JUnit case), everything is fine. But when I run via a web service hosted in a WLS 10.3.5, (I think my EclipseLink version is 11) I got an exception the the highlighted line saying can not case between the same java class.

following is the exception. Any help will be appreciated!!

<S:Envelope xmlns:S="">
<S:Fault xmlns:ns4="">
<faultstring>msgstore.model.OrderSet cannot be cast to msgstore.model.OrderSet</faultstring>
<ns2:exception xmlns:ns2="//" class="java.lang.ClassCastException" note="To disable this feature, set system property to false">
<message>msgstore.model.OrderSet cannot be cast to msgstore.model.OrderSet</message>
<ns2:frame class="msgstore.service.NumberPortingBSMsgStoreService_MsgStorePortImpl" file="" line="147" method="setOrderState" />
<ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="" line="native" method="invoke0" />
<ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="" line="39" method="invoke" />
<ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="" line="25" method="invoke" />
<ns2:frame class="java.lang.reflect.Method" file="" line="597" method="invoke" />
<ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="" line="92" method="invoke" />
<ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="" line="74" method="invoke" />
<ns2:frame class="$2" file="" line="151" method="invoke" />
<ns2:frame class="" file="" line="268" method="invoke" />
<ns2:frame class="" file="" line="100" method="processRequest" />
<ns2:frame class="" file="" line="866" method="__doRun" />
<ns2:frame class="" file="" line="815" method="_doRun" />
<ns2:frame class="" file="" line="778" method="doRun" />
<ns2:frame class="" file="" line="680" method="runSync" />
<ns2:frame class="$2" file="" line="403" method="process" />
<ns2:frame class="$HttpToolkit" file="" line="532" method="handle" />
<ns2:frame class="" file="" line="253" method="handle" />
<ns2:frame class="" file="" line="140" method="handle" />
<ns2:frame class="weblogic.wsee.jaxws.WLSServletAdapter" file="" line="171" method="handle" />
<ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="" line="708" method="run" />
<ns2:frame class="" file="" line="363" method="doAs" />
<ns2:frame class="" file="" line="146" method="runAs" />
<ns2:frame class="weblogic.wsee.util.ServerSecurityHelper" file="" line="103" method="authenticatedInvoke" />
<ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$3" file="" line="311" method="run" />
<ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="" line="336" method="post" />
<ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="" line="95" method="doRequest" />
<ns2:frame class="weblogic.servlet.http.AbstractAsyncServlet" file="" line="99" method="service" />
<ns2:frame class="javax.servlet.http.HttpServlet" file="" line="820" method="service" />
<ns2:frame class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction" file="" line="227" method="run" />
<ns2:frame class="weblogic.servlet.internal.StubSecurityHelper" file="" line="125" method="invokeServlet" />
<ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="" line="300" method="execute" />
<ns2:frame class="weblogic.servlet.internal.TailFilter" file="" line="26" method="doFilter" />
<ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="" line="56" method="doFilter" />
<ns2:frame class="$1" file="" line="111" method="run" />
<ns2:frame class="" file="" line="native" method="doPrivileged" />
<ns2:frame class="" file="" line="313" method="doAsPrivileged" />
<ns2:frame class="" file="" line="413" method="runJaasMode" />
<ns2:frame class="" file="" line="94" method="runJaasMode" />
<ns2:frame class="" file="" line="161" method="doFilter" />
<ns2:frame class="" file="" line="71" method="doFilter" />
<ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="" line="56" method="doFilter" />
<ns2:frame class="oracle.dms.servlet.DMSServletFilter" file="" line="136" method="doFilter" />
<ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="" line="56" method="doFilter" />
<ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="" line="3715" method="wrapRun" />
<ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="" line="3681" method="run" />
<ns2:frame class="" file="" line="321" method="doAs" />
<ns2:frame class="" file="" line="120" method="runAs" />
<ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="" line="2277" method="securedExecute" />
<ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="" line="2183" method="execute" />
<ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="" line="1454" method="run" />
<ns2:frame class="" file="" line="209" method="execute" />
<ns2:frame class="" file="" line="178" method="run" />
Re: "cannot be cast" error in Weblogic server 10.3.5 [message #834937 is a reply to message #832799] Mon, 02 April 2012 15:20 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems to be a class loader issue. Have you deployed that same classes/jar in two different places or apps?

Are you using a container managed or application managed persistence unit? If you are redeploying, ensure that you have closed the old EntityManagerFactory.
Previous Topic:JDBC_SEQUENCE_CONNECTION_POOL deprecated but alternative not working
Next Topic:Problems with cascade delete doing update instead
Goto Forum:

Current Time: Fri Jan 20 16:39:17 GMT 2017

Powered by FUDForum. Page generated in 0.03108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software