Uploaded image for project: 'EJB Client Library (AS7+)'
  1. EJB Client Library (AS7+)
  2. EJBCLIENT-106

EJB3 client code swallows exceptions making it difficult to track down issues

XMLWordPrintable

    • Hide
      • Use the ejb-remote quikstart
      • create a class
        public class InputPojo implements Serializable {
        private void writeObject(ObjectOutputStream out) throws IOException { // test to ensure that this Exception is found as cause throw new IllegalStateException("mandatory things missing - this is a test failure"); }

        }

      • add a new SLSB method with this class as parameter and call it
      Show
      Use the ejb-remote quikstart create a class public class InputPojo implements Serializable { private void writeObject(ObjectOutputStream out) throws IOException { // test to ensure that this Exception is found as cause throw new IllegalStateException("mandatory things missing - this is a test failure"); } } add a new SLSB method with this class as parameter and call it
    • Hide

      To find the root cause DEBUG for "org.jboss.ejb.client.EJBInvocationHandler" can be configured.

      But it is not possible to catch the cause in the client code!

      Show
      To find the root cause DEBUG for "org.jboss.ejb.client.EJBInvocationHandler" can be configured. But it is not possible to catch the cause in the client code!

      The current retry mechanism swallow the underlying Exception in case of Serialization problems. See EJBInvocationHandler.sendRequestWithPossibleRetries(...)

      The only shown message is:
      java.lang.IllegalStateException: EJBCLIENT000032: Cannot retry a request which hasn't previously been completed

      If DEBUG is enabled at client side:

      • If one of the parameter does not implement Serializable:
        May 26, 2014 4:37:37 PM org.jboss.ejb.client.EJBInvocationHandler sendRequestWithPossibleRetries
        DEBUG: Retrying invocation org.jboss.ejb.client.EJBClientInvocationContext@3e125554 which failed on node: redhat due to:
        org.jboss.ejb.client.RequestSendFailedException: org.jboss.as.quickstarts.ejb.remote.stateless.InputPojo
        at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.processInvocation(RemotingConnectionEJBReceiver.java:234)
        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
        at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocation(EJBObjectInterceptor.java:58)
        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
        at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocation(EJBHomeInterceptor.java:83)
        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
        at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42)
        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
        at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125)
        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
        at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
        at com.sun.proxy.$Proxy0.test(Unknown Source)
        at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStatelessBean(RemoteEJBClient.java:63)
        at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(RemoteEJBClient.java:47)
        Caused by: java.io.NotSerializableException: org.jboss.as.quickstarts.ejb.remote.stateless.InputPojo
        at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:891)
        at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
        at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:119)
        at org.jboss.ejb.client.remoting.MethodInvocationMessageWriter.writeMessage(MethodInvocationMessageWriter.java:101)
        at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.processInvocation(RemotingConnectionEJBReceiver.java:231)
        ... 16 more
        Caused by: an exception which occurred:
        in object org.jboss.as.quickstarts.ejb.remote.stateless.InputPojo@241f0670

      If the customized serialization failed the case Exception is:
      Caused by: java.lang.IllegalStateException: mandatory things missing - this is a test failure
      at org.jboss.as.quickstarts.ejb.remote.stateless.InputPojo.writeObject(InputPojo.java:45)
      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.jboss.marshalling.reflect.SerializableClass.callWriteObject(SerializableClass.java:180)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1007)
      at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:885)
      at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:62)
      at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:119)
      at org.jboss.ejb.client.remoting.MethodInvocationMessageWriter.writeMessage(MethodInvocationMessageWriter.java:101)
      at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.processInvocation(RemotingConnectionEJBReceiver.java:231)

            dlloyd@redhat.com David Lloyd
            rhn-support-wfink Wolf Fink
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: