-
1. Re: Remote MBean access
n_ton Mar 10, 2006 11:37 AM (in response to n_ton)After some more searching, I found a posting that referred to:
http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingJBossBehindAFirewall
I was able to complete the instructions at the bottom of that page that fixed my previous problem, but now I am getting:
java.lang.ClassCastException: org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub
From my remote client. I run the same client on the same machine the server is running and it works fine. Should I be casting to RMIAdaptorImpl_Stub instead of RMIAdaptor? Are there any implications to doing this?
Thanx in advance.
Norton -
2. Re: Remote MBean access
n_ton Mar 10, 2006 12:28 PM (in response to n_ton)So here's what I've done:
I have JBoss 3.0.8 running on RedHat 7.3 with JDK 1.4.2_10. I have a client that connects to JBoss with the following code:Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); props.put(Context.PROVIDER_URL, "jnp://yeager:1099"); System.out.println("In remote call"); InitialContext ic = new InitialContext(props); System.out.println("ic: " + ic); Object obj = ic.lookup("jmx/rmi/RMIAdaptor"); System.out.println("obj: " + obj.getClass().getName()); org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub server = ( org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub) obj; System.out.println("server: " + server); ObjectName objName = new ObjectName("jboss.j2ee:jndiName=" + name + ",service=EJB"); System.out.println("objName: " + objName); server.invoke(...);
When the client runs on the same box as the JBoss server, everything works fine. When I move the client to a Windows XP box running JDK 1.4.2_10, I get the following output that ends in a ClassCastException:
In remote call
ic: javax.naming.InitialContext@187d27e
obj: org.jboss.jmx.adaptor.rmi.RMIAdaptorImpl_Stub
As you can see, the object coming back from the InitialContext is an RMIAdaptorImpl_Stub and that's what I cast it to, but I still get the ClassCastException.
What's going on here?
Thanx in advance.
Norton -
3. Re: Remote MBean access
starksm64 Mar 12, 2006 11:10 AM (in response to n_ton)Try using a more recent jboss version, 4.0.3SP1, 3.2.8SP1 are the latest.