[jboss-jira] [JBoss JIRA] (WFLY-4308) Proxies created via ContextService.createContextualProxy(...) are not Serializable

Eduardo Martins (JIRA) issues at jboss.org
Tue Jul 28 10:29:03 EDT 2015


    [ https://issues.jboss.org/browse/WFLY-4308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13093488#comment-13093488 ] 

Eduardo Martins commented on WFLY-4308:
---------------------------------------

The Contextual Proxy is serializable, and that is validated by the TCK, the actual issue here is the serialization of the SecurityContext, the only field in the SecurityContextHandleFactory's handle, it fails even if the interface states that it implements Serializable, will find out if that is a bug or a feature, in the SecurityContext implementation used.

Exception stacktrace:

{code}
java.io.NotSerializableException: org.jboss.as.server.moduleservice.ServiceModuleLoader
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at org.jboss.as.ee.concurrent.handle.SecurityContextHandleFactory.writeSetupContextHandle(SecurityContextHandleFactory.java:67)
{code}

I made a WFLY branch with a modified basic integration test (DefaultContextServiceTestCase), which can be used to replicate the issue, at https://github.com/emmartins/wildfly/tree/WFLY-4308-test


> Proxies created via ContextService.createContextualProxy(...) are not Serializable
> ----------------------------------------------------------------------------------
>
>                 Key: WFLY-4308
>                 URL: https://issues.jboss.org/browse/WFLY-4308
>             Project: WildFly
>          Issue Type: Bug
>          Components: EE
>    Affects Versions: 9.0.0.Alpha1
>            Reporter: Paul Ferraro
>            Assignee: Eduardo Martins
>            Priority: Critical
>
> Setting priority to critical since, I believe, this is a matter of compliance with the concurrency utilities specification.
> Section 3.3.4 of the specification states that:
> "All invocation handlers for the contextual proxy implementation must implement java.io.Serializable."
> While the invocation handler of the generated proxy does indeed implement Serializable, it contains a reference to org.jboss.as.server.moduleservice.ServiceModuleLoader (among others), which is not serializable, thus attempts to serialize the proxies generated via ContextService.createContextualProxy(...) via JBoss Marshalling throw a org.infinispan.commons.marshall.NotSerializableException: org.jboss.as.server.moduleservice.ServiceModuleLoader



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list