Re: Help with java.rmi.server.codebase
"Vanfleet, David" <[email protected]> Tue, 26 Dec 2006 09:07:10 -0800
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <352366D52DA72B4295106E3C65E1719103B1F33F@USCYMPLM004.net.plm.eds.com> |
I do not have this Class in my CLASSPATH on the RMI registry server. The only place it exists is in the location specified by the codebase property. My understanding is that it should not be in the CLASSPATH if I intend to download it dynamically. Also, my hope was that this class would not exist on this server at all because I don't want to have to maintain the classes on that server. When this class (and others) are updated I would rather not have to install them in multiple locations/servers. Thanks, David -----Original Message----- From: Genady Beryozkin [mailto:[email protected]] Sent: Saturday, December 23, 2006 11:55 AM To: Vanfleet, David Cc: [email protected] Subject: Re: Help with java.rmi.server.codebase Do you have the "com/ugs/xme/dto/Library" class/interface on your CLASSPATH ? Best Regards, Genady Beryozkin, Author of the RMI Plug-in for Eclipse Vanfleet, David wrote: > I'm trying to setup my RMI server so it can load some if the needed > classes off an http server rather than having to put them on the local > system. Please note that I'm not interested in having the client load > these remote classes, only the RMI server. The script that's starting > this server looks like: > > > > #!/bin/sh > > export CLASSPATH=. > > java -Djava.security.policy="policy.txt" > -Djava.rmi.server.codebase="http://mySrcServer/javasrc/dao/bin/ > http://mySrcServer/javasrc/rmi/bin/" > -Djava.rmi.server.hostname="localhost" > com.ugs.xme.rmi.dto.proxy.DTOProxyServer > > > > The policy.txt file I'm using looks like: > > > > grant { > > permission java.net.SocketPermission "*", "accept, connect, listen, > resolve"; > > permission java.util.PropertyPermission "*", "read"; > > permission java.io.FilePermission "<<ALL FILES>>", "read, read, write, > delete, execute"; > > permission java.lang.RuntimePermission "setIO"; > > }; > > > > And I have the following line in my server class: > > > > System.setSecurityManager(new java.rmi.RMISecurityManager()); > > > > The error that I get when I try to start the service is: > > > > Exception in thread "main" java.lang.NoClassDefFoundError: > com/ugs/xme/dto/Library > > at java.lang.Class.getDeclaredMethods0(Native Method) > > at java.lang.Class.privateGetDeclaredMethods(Class.java:2365) > > at java.lang.Class.privateGetPublicMethods(Class.java:2488) > > at java.lang.Class.getMethods(Class.java:1406) > > at sun.rmi.server.Util.getRemoteInterfaces(Util.java:221) > > at sun.rmi.server.Util.getRemoteInterfaces(Util.java:193) > > at sun.rmi.server.Util.createProxy(Util.java:126) > > at > sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:169) > > at > java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.jav > a:293) > > at > java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.jav > a:235) > > at > java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:133) > > at > java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:119) > > at > com.ugs.xme.rmi.dto.proxy.DTOProxyServerImpl.<init>(DTOProxyServerImpl.j > ava:21) > > at > com.ugs.xme.rmi.dto.proxy.DTOProxyServer.<init>(DTOProxyServer.java:17) > > at > com.ugs.xme.rmi.dto.proxy.DTOProxyServer.main(DTOProxyServer.java:52) > > > > The Library class it's trying to load is located on the http server > (http://mySrcServer/javasrc/dao/bin/). I don't know if my problem is in > the security manager setup/permissions or if I'm just not using the > codebase property correctly. It looks like the Stub class for my > implementation is being loaded from off the http server but the Library > class is not. > > > > Can someone tell me what I'm doing wrong here, any help would be > appreciated. > > > > Thanks, > > David > > > ======================================================================== === > To unsubscribe, send email to [email protected] and include in the body > of the message "signoff RMI-USERS". For general help, send email to > [email protected] and include in the body of the message "help". > > For a list of frequently asked RMI questions please refer to: > http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html > > To view past RMI-USERS postings, please see: > http://archives.java.sun.com/archives/rmi-users.html > > > =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff RMI-USERS". For general help, send email to [email protected] and include in the body of the message "help". For a list of frequently asked RMI questions please refer to: http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html To view past RMI-USERS postings, please see: http://archives.java.sun.com/archives/rmi-users.html