3 Replies Latest reply on Aug 1, 2008 10:01 AM by Brian Stansberry

    Exception serializing DeploymentUnit

    Brian Stansberry Master

      While developing a test for my work on JBAS-5822, stumbled on a problem with serialization of DeploymentUnit.

      My test was based on org.jboss.test.deployers.AbstractDeploymentTest, and called its assertDeployed() method, which ends up using an MBeanServerConnection to invoke the "getDeploymentUnit" operation on the server-side MainDeployer. That call fails in marshalling the DeploymentUnit:

      java.io.NotSerializableException: org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at java.util.ArrayList.writeObject(ArrayList.java:569)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1380)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at org.jboss.deployers.plugins.attachments.AttachmentsImpl.writeExternal(AttachmentsImpl.java:145)
       at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at org.jboss.deployers.spi.attachments.helpers.ManagedObjectAttachmentsImpl.writeExternal(ManagedObjectAttachmentsImpl.java:65)
       at org.jboss.deployers.spi.attachments.helpers.ManagedObjectsWithTransientAttachmentsImpl.writeExternal(ManagedObjectsWithTransientAttachmentsImpl.java:70)
       at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.writeExternal(AbstractDeploymentContext.java:836)
       at org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentContext.writeExternal(AbstractVFSDeploymentContext.java:406)
       at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.writeExternal(AbstractDeploymentUnit.java:509)
       at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
       at java.rmi.MarshalledObject.<init>(MarshalledObject.java:92)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
       at java.lang.Thread.run(Thread.java:595)
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
       at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
       at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
       at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:244)
       at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:181)
       at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:66)
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:87)
       at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)
       at $Proxy1.invoke(Unknown Source)
       at org.jboss.test.deployers.AbstractDeploymentTest.invokeMainDeployer(AbstractDeploymentTest.java:83)
       at org.jboss.test.deployers.AbstractDeploymentTest.getDeploymentUnit(AbstractDeploymentTest.java:114)
       at org.jboss.test.deployers.AbstractDeploymentTest.assertDeployed(AbstractDeploymentTest.java:89)
       at org.jboss.test.deployers.AbstractDeploymentTest.assertDeployed(AbstractDeploymentTest.java:96)
       at org.jboss.test.deployers.valuefactory.test.ValueFactoryInjectionUnitTestCase.testValueFactoryInjection(ValueFactoryInjectionUnitTestCase.java:60)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
       at junit.extensions.TestSetup.run(TestSetup.java:25)


      The structure of the deployment:

      xxx.sar
      ++ META-INF
      ++++ jboss-beans.xml
      ++ valuefactory-service.xml
      ++ org (classes)

      This isn't holding up my JBAS-5822 work; I don't need to invoke assertDeployed() in my test since I later invoke on the deployed mbeans anyway.