0 Replies Latest reply on Sep 26, 2007 9:20 AM by Gourab Guha

    Problem when accessing JMX(RMIAdaptor) from JNDI namespace o

    Gourab Guha Newbie

      Hi All,

      I have problem to lookup RMIAdaptor from the JNDI namespace of Jboss.
      The code that I have written is follows.

      import java.util.Properties;
      import javax.naming.InitialContext;

      public class ServiceLocator
      {
      public static void main(String[] args)
      {
      try
      {
      Properties enviornment = new Properties();
      enviornment.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      enviornment.setProperty("java.naming.provider.url","jnp://localhost:1099");
      enviornment.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

      InitialContext initialContext = new InitialContext(enviornment);
      initialContext.lookup("jmx/rmi/RMIAdaptor");

      }
      catch(Exception e)
      {
      e.printStackTrace();

      }
      }
      }

      When I am executing the program I am getting the following exception

      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.invocation.InvokerInterceptor; unable to create instance]]
      at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1067)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:700)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at ServiceLocator.main(ServiceLocator.java:17)
      Caused by: javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.invocation.InvokerInterceptor; unable to create instance]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1061)
      ... 4 more
      Caused by: java.io.InvalidClassException: org.jboss.invocation.InvokerInterceptor; unable to create instance
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1700)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.skipCustomData(ObjectInputStream.java:1877)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1765)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
      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.readObject(ObjectInputStream.java:339)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:80)
      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.readObject(ObjectInputStream.java:339)
      at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:156)
      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 java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
      ... 7 more


      Can anybody help me please?

      Regards,
      Gourab Guha