8 Replies Latest reply on Sep 19, 2002 2:51 PM by Dain Sundstrom

    java.sql.SQLException: Unable to load to deserialize result

    brian Newbie

      I tried to retrieve data from PostgreSQL 7.1.3 via jBoss 3.0.1 (20020806) but got the following exception.

      java.sql.SQLException: Unable to load to deserialize result: java.io.StreamCorruptedException: InputStream does not contain a serialized object
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertByteArrayToObject(JDBCUtil.java:612)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult(JDBCUtil.java:311)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadArgumentResults(JDBCAbstractCMPFieldBridge.java:350)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.loadInstanceResults(JDBCAbstractCMPFieldBridge.java:304)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:142)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:572)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:353)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:262)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy34.getCompanyID(Unknown Source)

      I can save new record into PostgreSQL via the same entity bean but failed to retrieve it as the above error occurred. The same entity beans work on 3.0.0alpha. Is this due to my mistakes or a bug? please help.

      Brian

        • 1. Re: java.sql.SQLException: Unable to load to deserialize res
          Dain Sundstrom Master

          That is weird. It should be able to deserialize stuff serialized in 3.0.0. Can you file a bug report?

          • 2. Re: java.sql.SQLException: Unable to load to deserialize res
            brian Newbie

            before i can submit a bug report, can you briefly let me know what could cause the problem? I am using Linux RH 7.3.

            • 3. Re: java.sql.SQLException: Unable to load to deserialize res
              Dain Sundstrom Master

              Between 3.0.0 and 3.0.1 I switched the default storage of objects to MarshalledValue from MarshalledObject, because MarshalledObject does not properly handle class loading. The code should still be able to load MarshalledObjects, but I guess it is broken.

              • 4. Re: java.sql.SQLException: Unable to load to deserialize res
                brian Newbie

                Thanks.

                I downloaded 3.1.0alpha source code and built it. I deployed my jar file and the problem didn't exist.

                Should I stay with 3.1.0alpha since it works for me? I asked a similar question 9 months ago and you told me to go ahead and use 3.0.0 alpha. I will compile the source code every week.

                I configured postgresql-service.xml and put on the deploy direcory where hsqldb-service.xml resides. The following exceptions occurred:

                2002-08-19 23:31:35,918 WARN [org.jboss.system.ServiceController] jboss.jca:service=LocalTxDS,name=TaiwuDS does not implement any Service methods
                2002-08-19 23:31:35,925 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Creating
                2002-08-19 23:31:35,928 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEServer=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM
                2002-08-19 23:31:35,931 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEServer=Single,j2eeType=JCAResource,name=JCA
                2002-08-19 23:31:35,936 ERROR [org.jboss.management.j2ee.JCAConnectionFactory] Could not create JSR-77 JCAConnectionFactory: LocalTxCM
                javax.management.InstanceAlreadyExistsException: jboss.management.single:J2EEServer=Single,JCAResource=JCA,j2eeType=JCAConnectionFactory,name=LocalTxCM already registered.
                at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:677)
                at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:247)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceInterceptor.java:64)
                at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInterceptor.java:51)
                at org.jboss.mx.interceptor.PersistenceInterceptor.invoke(PersistenceInterceptor.java:91)
                at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:75)
                at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:141)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:934)
                at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:254)
                at org.jboss.management.j2ee.JCAConnectionFactory.create(JCAConnectionFactory.java:97)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.createService(BaseConnectionManager2.java:248)
                at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                at $Proxy0.create(Unknown Source)
                at org.jboss.system.ServiceController.create(ServiceController.java:271)
                at org.jboss.system.ServiceController.create(ServiceController.java:211)
                at org.jboss.system.ServiceController.create(ServiceController.java:283)
                at org.jboss.system.ServiceController.create(ServiceController.java:211)
                at org.jboss.system.ServiceController.create(ServiceController.java:283)
                at org.jboss.system.ServiceController.create(ServiceController.java:211)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy9.create(Unknown Source)
                at org.jboss.resource.RARDeployer.create(RARDeployer.java:181)
                at org.jboss.deployment.MainDeployer.create(MainDeployer.java:626)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy4.deploy(Unknown Source)
                at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
                at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
                at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
                at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                at $Proxy0.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:341)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy3.start(Unknown Source)
                at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
                at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:452)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
                at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
                at org.jboss.Main.boot(Main.java:142)
                at org.jboss.Main$1.run(Main.java:375)
                at java.lang.Thread.run(Thread.java:479)
                2002-08-19 23:31:35,966 ERROR [org.jboss.management.j2ee.JCAManagedConnectionFactory] Could not create JSR-77 JCAManagedConnectionFactory: LocalTxDS
                RuntimeMBeanException: org.jboss.management.j2ee.JCAManagedConnectionFactory constructor has thrown an exception: java.security.InvalidParameterException: Parent must be set
                Cause: java.security.InvalidParameterException: Parent must be set
                at org.jboss.mx.server.MBeanServerImpl.handleInstantiateExceptions(MBeanServerImpl.java:828)
                at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:790)
                at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:212)
                at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:253)
                at org.jboss.management.j2ee.JCAManagedConnectionFactory.create(JCAManagedConnectionFactory.java:59)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.createService(BaseConnectionManager2.java:254)
                at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                at $Proxy0.create(Unknown Source)
                at org.jboss.system.ServiceController.create(ServiceController.java:271)
                at org.jboss.system.ServiceController.create(ServiceController.java:211)
                at org.jboss.system.ServiceController.create(ServiceController.java:283)
                at org.jboss.system.ServiceController.create(ServiceController.java:211)
                at org.jboss.system.ServiceController.create(ServiceController.java:283)
                at org.jboss.system.ServiceController.create(ServiceController.java:211)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy9.create(Unknown Source)
                at org.jboss.resource.RARDeployer.create(RARDeployer.java:181)
                at org.jboss.deployment.MainDeployer.create(MainDeployer.java:626)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy4.deploy(Unknown Source)
                at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405)
                at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586)
                at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465)
                at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                at $Proxy0.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:341)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                at $Proxy3.start(Unknown Source)
                at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
                at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:452)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
                at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
                at org.jboss.Main.boot(Main.java:142)
                at org.jboss.Main$1.run(Main.java:375)
                at java.lang.Thread.run(Thread.java:479)


                Although I still can create, retrieve, and update db, it can be avoid if I removed hsqldb-service.xml.



                Brian

                • 5. Re: java.sql.SQLException: Unable to load to deserialize res
                  Denis Pasek Newbie

                  Hi,

                  > Could not create JSR-77 JCAConnectionFactory:
                  > LocalTxCM
                  > CA,j2eeType=JCAConnectionFactory,name=LocalTxCM
                  > already registered.

                  It seems that you're using a name for your connection factory that is already in use.
                  I think you used the same name for the connection factory which is used by the hypersonic service (this is why the problem fades, when you remove the hypersonic service).

                  Not only the JNDI name for the connection pools must be different also the names for the connection factory, connection manager etc. .
                  Look up your service descriptor xml file and change the name in the <mbean ... > declarations.

                  Greetings

                  Denis

                  • 6. Re: java.sql.SQLException: Unable to load to deserialize res
                    Arthur Wang Newbie

                    Hi,

                    I am having this problem also, I can insert into db but I cann't retrieve it. I am using JBoss3.0.2/Postgres, except download/build JBoss3.1.0, what else can I do to avoid this? note: not all entities has this problem.

                    Thanks

                    • 7. Re: java.sql.SQLException: Unable to load to deserialize res
                      Risto Reinpõld Newbie

                      I get this on JBoss-3.0.2/Oracle8:

                      java.sql.SQLException:
                      Unable to load to deserialize result: java.io.StreamCorruptedException:
                      invalid stream header
                      at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertByteArrayToObject(JDBCUtil.java:612)

                      seems like an identical problem since it occurs only on retrieval and only with some entities and not with some others. occurence seems to be of deterministic character - with entities it does occur it occurs always and vice versa.

                      • 8. Re: java.sql.SQLException: Unable to load to deserialize res
                        Dain Sundstrom Master

                        That is an Oracle error. Oracle likes to truncate fields to 4k. I have been told that this goes away with the oci drivers.