[jboss-user] [JBossCache] - Re: accessing TreeCacheMBean from remote client

ppradhan do-not-reply at jboss.com
Wed Feb 14 14:54:51 EST 2007


Hi,

1. the jboss-service.xml has this:
 <attribute name="TargetName">
  |         jboss.cache:service=TreeCache
  |     </attribute>
  |     <attribute name="JndiName">
  |         MyCache
  |     </attribute>
  |     <attribute name="InvokeTargetMethod">
  |         true
  |     </attribute>
  |     <attribute name="ExportedInterface">
  |         org.jboss.cache.TreeCacheMBean
  |     </attribute>

fyi: I am using old version of cache (1.2.3) but that should not matter here I think.

2. My client code is:
	          Properties env = new Properties();
  | 	          env.put(Context.INITIAL_CONTEXT_FACTORY,
  | 	            "org.jnp.interfaces.NamingContextFactory");
  | 	          env.put("java.naming.factory.url.pkgs", 
  | 	            "org.jboss.naming:org.jnp.interfaces");
  | 	          env.pu(Context.PROVIDER_URL, "jnp://localhost:1099");
  | 	          Context ctx = new InitialContext (env);
  | 	          //following http://wiki.jboss.org/wiki/Wiki.jsppage=JMXMBeanRemoteProxy
  | 
  | line#51=>          cache = (TreeCacheMBean)ctx.lookup("MyCache");3. I still get following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jgroups/ChannelClosedException
  | 	at java.lang.Class.getDeclaredMethods0(Native Method)
  | 	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
  | 	at java.lang.Class.privateGetPublicMethods(Unknown Source)
  | 	at java.lang.Class.getMethods(Unknown Source)
  | 	at sun.misc.ProxyGenerator.generateClassFile(Unknown Source)
  | 	at sun.misc.ProxyGenerator.generateProxyClass(Unknown Source)
  | 	at java.lang.reflect.Proxy.getProxyClass(Unknown Source)
  | 	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
  | 	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
  | 	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
  | 	at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
  | 	at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
  | 	at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
  | 	at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
  | 	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
  | 	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject0(Unknown Source)
  | 	at java.io.ObjectInputStream.readObject(Unknown Source)
  | 	at java.rmi.MarshalledObject.get(Unknown Source)
  | 	at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)
  | 	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
  | 	at javax.naming.InitialContext.lookup(Unknown Source)
  | 	at gov.lbl.pss2.cache.test.Test.main(Test.java:51)

Any pointers, insights?

Thanks


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016574#4016574

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016574



More information about the jboss-user mailing list