0 Replies Latest reply on May 10, 2005 11:53 PM by George Berish

    InvalidClassException on jbossall-client.jar class

    George Berish Novice

      Hi,

      This code below works fine in a test class run from my PC.

      However when I put it in a WebStart downloaded client, the app thows an InvalidClassException.

      env= new Hashtable<String, String> ();
      
      env.put (Context.INITIAL_CONTEXT_FACTORY,
       "org.jnp.interfaces.NamingContextFactory");
      
      env.put (Context.PROVIDER_URL,
       "jnp://localhost:1099");
      
      env.put (Context.URL_PKG_PREFIXES,
       "org.jboss.naming:org.jnp.interfaces");
      
      jndiContext = new InitialContext(env);
      My app prints the following info out:
      Naming Exception
       Explanation:
       Failed to retrieve Naming interface
       Root Cause:
       java.io.InvalidClassException: org.jboss.invocation.InvokerInterceptor; unable to create instance
      NOTE: The downloaded app will not always have access to my JDK and JBoss lib's, so I pulled "org.jnp.interfaces.NamingContextFactory" and all the classes it calls from the local jboss server's jbossall-client.jar and re-jarred them into a resource that is downloaded with the jnlp file.

      The API says the exception can have only one of three causes:

      - The serial version of the class does not match that of the class descriptor read from the stream
      - The class contains unknown datatypes
      - The class does not have an accessible no-arg constructor

      Since these are all tested classes, I assume the only problem can be the version, but I am lost on how to figure this out.

      Since the code works fine from a test class I run directly on my PC, I guess it finds a different version of "org.jboss.invocation.InvokerInterceptor" than I packaged with the jnlp resouce.

      But I don't have a clue how to figure out which one to package.

      Can anyone give me a hint?