[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] How to start a RMI service in a bundle of Equinox
- From: Niclas Hedhman <niclas@xxxxxxxxxxx>
- Date: Mon, 11 Dec 2006 17:34:30 +0800
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=CECv13x5OXQEqpzxcHcVnAduieFZLTZdT01et0OB9Dh6P1W3JPSHh/DbUeHgQww+ZmtcoDHJNpIUIu2C5dZMexdumlM/O3FewKsgzGVCdBbo8vZCqBQTwVm8xXk+T8XRTvif2mhhr6sCLhhthE35l+Zl26oJkQV5L3fcyYKnh44=
- User-agent: KMail/1.9.5
On Monday 11 December 2006 16:53, åå wrote:
> I want to migrate my old RMI service into equinox,but I don't know how can
> I attach -Djava.security.policy=myplicy.properties into the bundle. Now I
> attach it to the VM arguments of my Equinox OSGi framework Run item.
I think that Equinox supports you to specify policies in its start
> But when running,an exception throws like this:
> Caused by: java.lang.ClassNotFoundException:
> org.shuyaji.workflow.api.client.rmi.RMIEngineImpl_Stub at
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
First of all I am a bit surprised to see that the RegistryImpl (jdk classes)
is compiled with JDK1.1 styled _skel support and it being used.
The problem occurs on your server side, which I presume is running on OSGi. If
not, then the problem is elsewhere.
You have not told us how you start the Registry.
What is important is that the rebind() method will serialize the Remote
Reference to the RMI service, and send it to the RegistryImpl. Which in turn
will hand it out to whomever is asking. The RegistryImpl is a nothing
special, and just another RMI service with a known UnicastRef. Now, when the
reference to your service is being serialized, it also transfers the codebase
location used by the classes in the serialized stream, so the RegistyImpl
knows where to get them.
So, if you don't specify reachable URLs (http://, ftp:// et al) in a
URLClassLoader (not the case in OSGi, I think), then the system property
java.rmi.server.codebase will be used as the reference to the classes. You
are probably missing this, and it needs to point to the location of
the "mobile code" (term used for RMI 2.0 n.k.a JERI).
Hope that helps.