This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Problem when accessing JMX (RMI Adaptor) from JNDI namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem when accessing JMX (RMI Adaptor) from JNDI namespace" Watch "Problem when accessing JMX (RMI Adaptor) from JNDI namespace" New topic
Author

Problem when accessing JMX (RMI Adaptor) from JNDI namespace

Gourab Guha
Greenhorn

Joined: Nov 06, 2006
Posts: 13
Hi All,

I have problem to lookup RMIAdaptor from the JNDI namespace of Jboss, When I want to access JBoss JMX.

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 rg.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.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10441
    
176

Let's continue the discussion in your other thread in JBoss forum


[My Blog] [JavaRanch Journal]
Gourab Guha
Greenhorn

Joined: Nov 06, 2006
Posts: 13
sure no problem
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem when accessing JMX (RMI Adaptor) from JNDI namespace
 
It's not a secret anymore!