5 Replies Latest reply on Sep 24, 2001 2:27 PM by spatemp

    I am having trouble testing EJB across network.

    spatemp Newbie

      I am trying to test an ejb client that would call a method on say "theserver.domain.com" machine. I get the following erros when I run the client program.
      The EJB and client works fine when jboss and client is on one machine. Thanks for you help.

      [java] Got context
      [java] javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb.plugins.jrmp.interfaces.EJBMetaDataImpl; Local class not compatible: stream classdesc serialVersionUID=3328424568966982431 local class serialVersionUID=2590026239352080415]

      public static void main(String[] args)
      // Enclosing the whole process in a single `try' block is not an ideal way
      // to do exception handling, but I don't want to clutter the program up
      // with catch blocks
      Properties env = new Properties();

      env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      env.setProperty("java.naming.provider.url", "theserver.domain.com:1099");
      env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");

      // cachedCTX = new InitialContext(env);

      // Get a naming context
      InitialContext jndiContext = new InitialContext(env);
      System.out.println("Got context");

      // Get a reference to the Interest Bean
      Object ref = jndiContext.lookup("interest/Interest");
      System.out.println("Got reference");

      // Get a reference from this to the Bean's Home interface
      InterestHome home = (InterestHome)
      PortableRemoteObject.narrow(ref, InterestHome.class);

      // Create an Interest object from the Home interface
      Interest interest = home.create();

      // call the calculateCompoundInterest() method to do the calculation
      System.out.println("Interest on 1000 units, at 10% per period, compounded over 2 periods is:");
      System.out.println(interest.calculateCompoundInterest(1000, 0.10, 2));
      catch(Exception e)