Christian Voss wrote:
>
> Hi.
> I wrote an own test bean and deployed it on Jonas. Then I have a java
> test application, to call it. This woks fine, when I have
> "JOnASTestBeanTestHome_Stub.class" in the CLASSPATH on the client. As
> soon as I remove this file on the client, I get the following error
> message when running the client:
>
> Cannot lookup Test: javax.naming.CommunicationException [Root exception
> is java.
> rmi.UnmarshalException: error unmarshalling return; nested exception is:
>
> java.lang.ClassNotFoundException:
> tpslabs.JOnASTestBeanTestHome_Stub]
>
> Do I really need to have all the Jonas specific Home_Stub classes in the
>
> CLASSPATH on my client? I thought, this job could by achieved
> dynamically by RMI.
>
> Thanks for any light on this,
> Vossi
Hi,
The way to get RMI to dynamically load stub files is as follows:
- on the server side, the EJBServer must be run with a property
-Djava.rmi.server.codebase=<url path>
where a url indicates a location where the stub files can be found.
Examples of valid urls are:
file:///c:/temp/ (Windows)
file:/usr/local/lib/ (Unix)
file:///c:/temp/mystubfiles.jar (Windows)
file:/usr/local/lib/mystubfiles.jar (Unix)
http:/foo.com/~user/
http:/foo.com/~user/mystubfiles.jar
Note the trailing "/" if it's a directory. To specify several
urls, separate each such url by a blank and put everything in
double quotes ".
- on the client side, the client must be running an RMI Security
Manager:
System.setSecurityManager(new java.rmi.RMISecurityManager());
and the client must have appropriate security privileges. Typically,
you can do this by running the client with a property
-Djava.security.policy=<file name>
where file name defines the privileges. For initial testing, most
people initialize the file by granting all permissions.
This is the way RMI dynamic class loading works when the client
and server are full applications. I'm not sure how it works with
client applets but the principle should be similar.
Hope this helps,
Kathleen
******************************************************************
Kathleen Milsted
France Telecom R&D
Distributed Systems Architecture department (DTL/ASR)
28 chemin du Vieux Chene
BP 98, 38243 Meylan Cedex
FRANCE
E-mail: [EMAIL PROTECTED]
Tel: +33 4 76 76 45 94
Fax: +33 4 76 76 45 57
******************************************************************
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".