WLS 10.0 MP1: java.lang.ClassCastException When Accessing EJB From Within Another EJB On A Different Server (Doc ID 1149336.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server - Version 10.0 and later
Information in this document applies to any platform.

Symptoms

When an EJB makes a call to another EJB that is deployed on a different server a java.lang.ClassCastException is raised.

[06/13 19:42:50 PDT] [ERROR] [org.example.saleorder.service.optionHandlers.PressKitInfoOptionHandler] $Proxy68
java.lang.ClassCastException: $Proxy68
at org.example.ejb.vnslist.VnsListClient.getRemote(VnsListClient.java:93)
at org.example.ejb.vnslist.VnsListClient.findVnsEventByVnsId(VnsListClient.java:111)
at org.example.saleorder.service.optionHandlers.PressKitInfoOptionHandler.getPressKitOptionAsXml(PressKitInfoOptionHandler.java:221)
at org.example.saleorder.service.optionHandlers.PressKitInfoOptionHandler.saveOption(PressKitInfoOptionHandler.java:99)
at org.example.saleorder.service.SaleOrderService.setOption(SaleOrderService.java:214)
at org.example.saleorder.ejb.session.SaleOrderBean.setOption(SaleOrderBean.java:371)
at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at weblogic.ejb.container.injection.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:68)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)


or

<2.6.2008 16:05:18 EEST> <Error> <HTTP> <BEA-101020> <[weblogic.servlet.internal.WebAppServletContext@d54a44 - appName:'yrp_edustusvaihto_ear', name: '/simple_war', context-path: '/simple_war'] Servlet failed with Exception java.lang.ClassCastException: Cannot narrow remote object weblogic.rmi.internal.
BasicRemoteRef - hostID: '-4148026917672359397S:127.0.0.1:[7001,7001,-1,-1,-1,-1,-1]:domain1:AdminServer', oid: '295', channel: 'null' to org.example.ejb.FEJBRemote
at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at client.MyFirstEJBClient.getRemote(MyFirstEJBClient.java:28)
Truncated. see log file for complete stacktrace

Changes

None.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms