2 Replies Latest reply on Jan 20, 2006 4:55 AM by brvdboss

    Can't serialize object due to LoggerPluginWriter(?)

    brvdboss

      Hello all,

      I'v run into a strange problem with creating an Entity Bean.
      The bean has two fields: a String id (primary key) and a Dialog dialog.

      The Dialog comes from the JAIN SIP Specification and I'm using (a modified version of) the reference implementation. Appareantly JBoss has a problem when trying to Serialize the Dialog-object. (De)Serializing the dialog in a stand-alone application works just fine.

      The Exception I receive is the following:

      11:10:31,651 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract be.ugent.ibcn.samples.shootme.data.DataStoreBeanLocal be.ugent.ibcn.samples.shootme.data.DataStoreBeanLocalHome.create(java.lang.String,javax.sip.Dialog) throws javax.ejb.CreateException, causedBy:
      java.sql.SQLException: Can't serialize binary object: java.io.NotSerializableException: org.jboss.logging.util.LoggerPluginWriter
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertObjectToByteArray(JDBCUtil.java:218)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCParameterSetter$2.setNotNull(JDBCParameterSetter.java:85)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCParameterSetter$JDBCAbstractParameterSetter.set(JDBCParameterSetter.java:56)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:354)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setInstanceParameters(JDBCAbstractCMPFieldBridge.java:336)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:304)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:138)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:572)
       at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:222)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:219)
       at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:612)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:189)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:180)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:119)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:110)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:130)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
       at org.jboss.ejb.Container.invoke(Container.java:894)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:344)
       at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
       at $Proxy63.create(Unknown Source)
      ... (Here the references start pointing to the create method in my own code)
      


      According to this log, the problem should have something to do with the org.jboss.logging.util.LoggerPluginWriter, which strikes me as odd. It hasn't really got anything to do with my code or the sip-library I am using.

      When I'm using "null" when creating the entity bean instance, no problem occurs.

      Could someone provide me with some pointers as to locate the real problem? I currently don't understand how the LoggerPluginWriter class get's involved in this.

      Kind regards,
      Bruno

        • 1. Re: Can't serialize object due to LoggerPluginWriter(?)
          brvdboss

          Hello,

          Something I forgot to mention in the previous post is that (de)serializing the mentioned dialog object works just fine in a stand-alone application using the following code:

          ByteArrayOutputStream bs = new ByteArrayOutputStream();
          ObjectOutputStream os = new ObjectOutputStream(bs);
          os.writeObject(dialog);
          
          dialog = null;
          
          ByteArrayInputStream bi = new ByteArrayInputStream(bs.toByteArray());
          ObjectInputStream is = new ObjectInputStream(bi);
          dialog = (Dialog)is.readObject();
          


          However, if I insert this code into my Bean (not using entity-beans) I still get the same error. So I get the impression this is some kind of bug with JBoss?


          Kind regards,
          Bruno


          • 2. Re: Can't serialize object due to LoggerPluginWriter(?)
            brvdboss

            Hello,

            For completeness, this problem has been solved.
            The cause was that my own implementation of ManagedConnectionFactory (in the resource adapter) was not serializable.
            As pointed out in this forum-topic:
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=75635

            Bruno