Thanks. I'm aware of the fact that bean class is not needed on the client side. 
One doesn't have to always have the remote and home interface classes on the 
client side. For example, the following code works pretty well without those 
interfaces on the client side (since there is no direct reference for the 
interface in the code):

        Object obj = context.lookup("server.Server");
  |         Method m = obj.getClass().getDeclaredMethod("create",null);
  |         Object remote = m.invoke(obj,null);
  |         Method rm = 
remote.getClass().getDeclaredMethod("getInformation",null);
  |         Object result = rm.invoke(remote,new Object[]{queueName});
  |         System.out.println("Information the other way: "+result);
In this case the proxy's instance representing the ServerHome (and I believe it 
implements this interface as well) gets downloaded to the client and along with 
its codebase annotation pointing to the codebase of the Jboss server. Once it 
gets that, since it doesn't have the ServerHome interface's class definition, 
it downloads the definition from the server. Someone from JBoss or who knows 
the internals of it, please correct me if I'm wrong in my interpretation. I 
also believe that the RMIClassLoader is used to download the class definition 
from the codebase. When it was able to download the definition for a proxy, why 
was it not able to download it when I type cast the interface? (I have also 
tried setting the RMIClassLoader as the context class loader, with the 
appropriate code base, but still I get the NoClassDefFoundError.

Thread.currentThread().setContextClassLoader(RMIClassLoader.getClassLoader("http://mymachine:8083/";));

I hope this makes my question clear now. 

Thanks,
Kalyan.

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

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


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to