Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2717

Exceptions returnd from remote ejb calls create ClassCastException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 8.0.0.CR1, 8.1.0.Final
    • Fix Version/s: None
    • Component/s: Remoting
    • Labels:
      None

      Description

      An exception thrown by an ejb is not marshalled correctly to the calling remote client. Instead a ClassCastException is raised.

      Stack trace on client:

      java.lang.AssertionError: 
      Expected: class java.lang.UnsupportedOperationException as (in)directly causing exception
           but: was <java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.String>
      Stacktrace was: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.String
      	at org.jboss.ejb.client.remoting.ProtocolMessageHandler.readAttachments(ProtocolMessageHandler.java:55)
      	at org.jboss.ejb.client.remoting.InvocationExceptionResponseHandler$MethodInvocationExceptionResultProducer.getResult(InvocationExceptionResponseHandler.java:82)
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272)
      	at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocationResult(EJBObjectInterceptor.java:64)
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
      	at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocationResult(EJBHomeInterceptor.java:88)
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
      	at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:46)
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:274)
      	at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:129)
      	at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:262)
      	at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:437)
      	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:202)
      	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
      	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
      	at com.sun.proxy.$Proxy6.getException(Unknown Source)
      	at de.gedoplan.beantrial.wildflyejbremote.DemoTest.testGetException(DemoTest.java:60)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:168)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
      	at org.junit.Assert.assertThat(Assert.java:865)
      	at org.junit.Assert.assertThat(Assert.java:832)
      	at org.junit.rules.ExpectedException.handleException(ExpectedException.java:198)
      	at org.junit.rules.ExpectedException.access$500(ExpectedException.java:85)
      	at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:177)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      

      Stack trace on server:

      14:50:47,688 ERROR [org.jboss.as.ejb3.invocation] (EJB default - 3) JBAS014134: EJB Invocation failed on component DemoBean for method public abstract void de.gedoplan.beantrial.wi
      ldflyejbremote.Demo.getException(): javax.ejb.EJBException: java.lang.UnsupportedOperationException: Not implemented
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:190) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79) [wildfly-ejb3-8.0.0.CR1.jar:8.0
      .0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.0.0.CR1.jar:8
      .0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:325)
              at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:437)
              at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:325)
              at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
              at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
              at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:329) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_40]
              at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
              at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
              at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: java.lang.UnsupportedOperationException: Not implemented
              at de.gedoplan.beantrial.wildflyejbremote.DemoBean.getException(DemoBean.java:17) [wildfly-ejbremote-demo.jar:]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_40]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_40]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_40]
              at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
              at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
              at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406)
              at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) [wildfly-weld-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) [wildfly-weld-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
              at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:406)
              at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) [weld-core-impl-2.1.1.Final.jar:2013-1
      2-03 09:59]
              at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:84) [wildfly-weld-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
              at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.0.0.CR1.jar:8.0.0.CR1]
              ... 39 more
      

        Attachments

          Activity

            People

            Assignee:
            Takis Panagiotis Sotiropoulos
            Reporter:
            dweil Dirk Weil
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: