1 Reply Latest reply on Dec 19, 2005 5:25 PM by delkant

    ejb3 bug?? hibernate bug?? problem from a remote call

    delkant Newbie

      hi, i have the next problem
      with hibernate and ejb3...
      Resume:
      two classes with a oneToMany relationship between them, if the relationship is removed everything works and the remote call is success,.. i am using ejb3 rc3, with jboss-4.0.3SP1

      @Entity
      @Table(name = "transaction")
      @Name("transaction")
      public class Transaction implements Serializable {
      
       private long id;
      
       private long name;
      
       private Set<TransactionEntry> entries;
      
       @NotNull
       @OneToMany
       @Cascade(CascadeType.ALL)
       public Set<TransactionEntry> getEntries() {
       return entries;
       }
      
       public void setEntries(Set<TransactionEntry> entries) {
       this.entries = entries;
       }
      
      @Id
       public long getId() {
       return id;
       }
      
      ....... etc.
      


      then..

      @Entity
      @Table(name = "entry")
      @Name("entry")
      public class TransactionEntry implements Serializable {
      
       private long id;
      
       private String description;
      
       private Transaction transaction;
      
       @ManyToOne
       @Index(name="entry_transaction_idx")
       public Transaction getTransaction() {
       return transaction;
       }
      
       public void setTransaction(Transaction transaction) {
       this.transaction = transaction;
       }
      
      getterss...
      setersss..
      
      etc.
      


      then i have a session..

      @Stateful
      @Name("Transaction")
      @Scope(ScopeType.CONVERSATION)
      @Interceptor(SeamInterceptor.class)
      public class TransactionBean implements TransactionRemote {
       @PersistenceContext(unitName = "testDatabase")
       private Session session;
       public List<Transaction> search( Long transactionId){
       Criteria crit = session.createCriteria(Transaction.class);
       crit.add(Expression.eq("id", transactionId));
       return crit.list();
       }
       }
      


      @Remote
      public interface TransactionRemote {
       public List<Transaction> search(Long transactionId);
       }
      



      exception

      in my client i just make this call..

      public class testClient{
      private Transaction getEJB(){
      // set the properties of the context map, jnp://localhost:1099 etc...
       InitialContext ictxt = getRemoteInitialContext();
       TransactionRemote transaction = (TransactionRemote)ictxt.lookup(TransactionRemote.class.getName());
      
       return transaction;
      }
       public List <Transaction> getTransactions(){
       List <Transaction> entries = getEJB().search(transactionId);
       return entries;
       }
      }
      


      if i remove the relation with the entries (TransactionEntry) in the Transaction class, everything works fine,
      but with the oneToMany relation i have the next Exeption..

      any ideas?


      - Got marshalling exception, exiting
      java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection; local class incompatible: stream classdesc serialVersionUID = 7602608801868099635, local class serialVersionUID = -7982170513654570219
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at java.util.ArrayList.readObject(ArrayList.java:587)
      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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:107)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:73)
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:242)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:112)
      at org.jboss.remoting.Client.invoke(Client.java:226)
      at org.jboss.remoting.Client.invoke(Client.java:189)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:119)
      at $Proxy1.search(Unknown Source)
      at test.GUI.Communication.ClientCommunication.transactionsSearch(ClientCommunication.java:131)
      at test.GUI.Communication.ClientCommunication.accountingSearch(ClientCommunication.java:77)
      at test.GUI.Controllers.SearchController.queryTransactions(SearchController.java:138)
      at test.GUI.Forms.SearchTransactionForm.searchActionPerformed(SearchTransactionForm.java:218)
      at test.GUI.Forms.SearchTransactionForm.access$0(SearchTransactionForm.java:217)
      at test.GUI.Forms.SearchTransactionForm$1.actionPerformed(SearchTransactionForm.java:114)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
      at java.awt.Component.processMouseEvent(Component.java:5488)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
      at java.awt.Component.processEvent(Component.java:5253)
      at java.awt.Container.processEvent(Container.java:1966)
      at java.awt.Component.dispatchEventImpl(Component.java:3955)
      at java.awt.Container.dispatchEventImpl(Container.java:2024)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
      at java.awt.Container.dispatchEventImpl(Container.java:2010)
      at java.awt.Window.dispatchEventImpl(Window.java:1766)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
      at java.awt.Component.processMouseEvent(Component.java:5488)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
      at java.awt.Component.processEvent(Component.java:5253)
      at java.awt.Container.processEvent(Container.java:1966)
      at java.awt.Component.dispatchEventImpl(Component.java:3955)
      at java.awt.Container.dispatchEventImpl(Container.java:2024)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
      at java.awt.Container.dispatchEventImpl(Container.java:2010)
      at java.awt.Window.dispatchEventImpl(Window.java:1766)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      Caused by: java.rmi.ConnectException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
      java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection; local class incompatible: stream classdesc serialVersionUID = 7602608801868099635, local class serialVersionUID = -7982170513654570219
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:264)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:112)
      at org.jboss.remoting.Client.invoke(Client.java:226)
      at org.jboss.remoting.Client.invoke(Client.java:189)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:119)
      ... 31 more
      Caused by: java.io.InvalidClassException: org.hibernate.collection.AbstractPersistentCollection; local class incompatible: stream classdesc serialVersionUID = 7602608801868099635, local class serialVersionUID = -7982170513654570219
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at java.util.ArrayList.readObject(ArrayList.java:587)
      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 java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:107)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:73)
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:242)
      ... 43 more
      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at test.GUI.Controllers.SearchController.queryTransactions(SearchController.java:140)
      at test.GUI.Forms.SearchTransactionForm.searchActionPerformed(SearchTransactionForm.java:218)
      at test.GUI.Forms.SearchTransactionForm.access$0(SearchTransactionForm.java:217)
      at test.GUI.Forms.SearchTransactionForm$1.actionPerformed(SearchTransactionForm.java:114)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
      at java.awt.Component.processMouseEvent(Component.java:5488)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
      at java.awt.Component.processEvent(Component.java:5253)
      at java.awt.Container.processEvent(Container.java:1966)
      at java.awt.Component.dispatchEventImpl(Component.java:3955)
      at java.awt.Container.dispatchEventImpl(Container.java:2024)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
      at java.awt.Container.dispatchEventImpl(Container.java:2010)
      at java.awt.Window.dispatchEventImpl(Window.java:1766)
      at java.awt.Component.dispatchEvent(Component.java:3803)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)