0 Replies Latest reply on Mar 24, 2005 9:38 PM by yl chen

    ejb3 client problem

    yl chen Newbie

      jboss 4.0.1sp1+jdk5.0

      EJB was deploy on the other JVM.
      client:
      * JBoss, the OpenSource J2EE webOS
      *
      * Distributable under LGPL license.
      * See terms of license at gnu.org.
      */
      package org.jboss.tutorial.stateless.client;

      import org.jboss.tutorial.stateless.bean.Calculator;
      import org.jboss.tutorial.stateless.bean.CalculatorRemote;

      import javax.naming.InitialContext;

      public class Client
      {
      public static void main(String[] args) throws Exception
      {
      InitialContext ctx = new InitialContext();
      Calculator calculator = (Calculator) ctx.lookup(CalculatorRemote.class.getName());

      System.out.println("1 + 1 = " + calculator.add(1, 1));
      System.out.println("1 - 1 = " + calculator.subtract(1, 1));
      }
      }
      jndi.properties:
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=localhost:1099


      Exception in thread "main" javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.remoting.BaseRemoteProxy; local class incompatible: stream classdesc serialVersionUID = -1019635950408433617, local class serialVersionUID = -2289426881135628080]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:663)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.tutorial.stateless.client.Client.main(Client.java:19)
      Caused by: java.io.InvalidClassException: org.jboss.ejb3.remoting.BaseRemoteProxy; local class incompatible: stream classdesc serialVersionUID = -1019635950408433617, local class serialVersionUID = -2289426881135628080
      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.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:51)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:566)
      ... 3 more