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

Serialization of java.time classes on EJB calls fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 8.0.0.Beta1
    • Fix Version/s: 8.0.0.Final
    • Component/s: EJB
    • Labels:
    • Environment:

      JBoss AS 7.2

      Description

      First of all: We stumbled on the issue desribed here on JBoss AS 7.2, but the relevant source coude seems to be unchanged in WildFly.

      In method org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation() a ClonerConfiguration object is programmatically created for the configuration of a org.jboss.marshalling.cloner.SerializingCloner instance.

      The default configuration causes IllegalAccessExceptions when serializing classes of the new java.time package (Java 8) respectively for the org.threeten library (Java 7 backport of JSR-310).

      Stacktrace:

      java.lang.RuntimeException: JBAS014154: Failed to marshal EJB parameters
      at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:270) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:259) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:170) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBHomeCreateInterceptor.handleInvocation(EJBHomeCreateInterceptor.java:79) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:177) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:161) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124) [jboss-ejb-client-1.0.16.Final.jar:1.0.16.Final]
      at com.sun.proxy.$Proxy124.getList(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
      at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:267) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:263) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:52) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
      at kam.cmd.boundary.access.MDListService$431771952$Proxy$$$_Weld$Proxy$.getList(MDListService$431771952$Proxy$$$_Weld$Proxy$.java) [cmd-core-boundary-0.0.10-SNAPSHOT.jar:]
      at kam.cmd.client.AbstractMasterDataClient.getData(AbstractMasterDataClient.java:57) [cmd-core-client-base-0.0.10-SNAPSHOT.jar:]
      at kam.cmd.client.ejb.EJBMasterDataClient$Proxy$$$_WeldClientProxy.getData(EJBMasterDataClient$Proxy$$$_WeldClientProxy.java) [cmd-core-client-ejb-0.0.10-SNAPSHOT.jar:]
      at kam.cmd.resourcebrowser.BackwareBrowser.getRes(BackwareBrowser.java:37) [classes:]
      at kam.cmd.resourcebrowser.BackwareBrowser$Proxy$$$_WeldClientProxy.getRes(BackwareBrowser$Proxy$$$_WeldClientProxy.java) [classes:]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
      at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.5.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.5.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.5.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.5.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.5.Final.jar:]
      ... 19 more
      Caused by: java.io.InvalidClassException: org.threeten.bp.Ser; Illegal access exception occurred accessing the constructor: java.lang.IllegalAccessException: Class org.jboss.marshalling.reflect.PublicReflectiveCreator can not access a member of class org.threeten.bp.Ser with modifiers "public"
      at org.jboss.marshalling.reflect.PublicReflectiveCreator.create(PublicReflectiveCreator.java:43)
      at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:240)
      at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:174)
      at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:134)
      at org.jboss.as.ejb3.remote.LocalEjbReceiver.clone(LocalEjbReceiver.java:268) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
      ... 57 more

      The cause of the problem is, that the default configuration of the SerializingCloner uses the class org.jboss.marshalling.reflect.PublicReflectiveCreator for the instantiation of the serialized classes, which tries to directly call the default constructor. While the class org.threeten.bp.Ser does have a public constructor, the class itself only has package visibility, causing the IllegalAccessException.

      There is another implementation org.jboss.marshalling.reflect.ReflectiveCreator, which actually forces the accessibility of the constructor to be true. If an instance of this class was configured as externalizedCreator in ClonerConfiguration, the problem would be solved. But currently there is no way to influence the ClonerConfiguration used by the class LocalEjbReceiver.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                dmlloyd David Lloyd
                Reporter:
                steven.pessall Steven Pessall
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: