Re: Help with java.rmi.server.codebase
"Vanfleet, David" <[email protected]> Sat, 23 Dec 2006 09:45:40 -0800
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <352366D52DA72B4295106E3C65E1719103B1EF40@USCYMPLM004.net.plm.eds.com> |
Here's an update:
I added -Djava.security.debug="access" to the starup script and tried to
restart the server. When I did this I got the following message:
access denied (java.lang.RuntimePermission
createSecurityManager)
I then changed my security policy to:
grant {
permission java.security.AllPermission;
};
When I again tried to restart the server I got a bunch of "access
allowed" messages, then I got the same NoClassDefFoundError shown below.
This leads me to believe that my security manager is setup correctly but
the problem is with the implementation of my codebase property.
Thanks,
David
-----Original Message-----
From: Vanfleet, David [mailto:[email protected]]
Sent: Saturday, December 23, 2006 9:18 AM
To: [email protected]
Subject: Help with java.rmi.server.codebase
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