|
|
Re: How to use RMI with Equinox [message #101621 is a reply to message #101115] |
Tue, 20 November 2007 08:08 |
Mickael GAUVIN Messages: 39 Registered: July 2009 |
Member |
|
|
Thank you,
It works. The problem is that the RMI Naming class is loaded by the
System Class Loader and not by my bundle class loader. For the Registry
class it is different because it is my bundle who creates it.
Thanks.
Mickael.
Jaime a écrit :
> Hi Mickael,
>
> I suffer the same problem than you.
> If you have the chance, replace:
>
> LocateRegistry.createRegistry(9090);
> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>
> by:
>
> Registry registry = LocateRegistry.createRegistry(9090);
> registry.rebind("testMyObject", myObject);
>
> You shouldn't have any problem with this code.
>
> BR,
> Jaime
> "Mickael Gauvin" <mickael.gauvin@gmail.com> escribió en el mensaje
> news:fgndaf$fsa$1@build.eclipse.org...
>> Hello world,
>>
>> I have a problem in using the RMI method "rebind" in the start method
>> of my bundle. I have this source code :
>>
>> // ---------------------------------------------------------
>> IMyObject myObject = new MyObject();
>> SecurityManager securityManager = null;
>> securityManager = new RMISecurityManager();
>> System.setSecurityManager(securityManager);
>> LocateRegistry.createRegistry(9090);
>> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>> // ----------------------------------------------------------
>>
>> This code works well in a normal Java Project and I have configured the
>> java.policy file with :
>>
>> grant {
>> permission java.security.AllPermission;
>> };
>>
>> But in the equinox environment an Exception is thrown :
>>
>> // -----------------------------------------------------------
>> java.security.PrivilegedActionException: java.rmi.ServerException:
>> RemoteException occurred in server thread; nested exception is:
>> java.rmi.UnmarshalException: error unmarshalling arguments; nested
>> exception is:
>> java.lang.ClassNotFoundException:
>> fr.itcs.exec.service.distinfra.rmi.IMyObject
>> // -----------------------------------------------------------
>>
>> If anyone has encountered this problem, I will be pleased to hear his
>> solution. (May be a ClassLoader problem ?)
>>
>> Mickael.
>
>
|
|
|
Re: How to use RMI with Equinox [message #101630 is a reply to message #101115] |
Tue, 20 November 2007 08:11 |
Mickael GAUVIN Messages: 39 Registered: July 2009 |
Member |
|
|
Thank you,
It works. The problem is that the RMI Naming class is loaded by the
System Class Loader and not by my bundle class loader. For the Registry
class it is different because it is my bundle who creates it.
Thanks.
Mickael.
Jaime a écrit :
> Hi Mickael,
>
> I suffer the same problem than you.
> If you have the chance, replace:
>
> LocateRegistry.createRegistry(9090);
> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>
> by:
>
> Registry registry = LocateRegistry.createRegistry(9090);
> registry.rebind("testMyObject", myObject);
>
> You shouldn't have any problem with this code.
>
> BR,
> Jaime
> "Mickael Gauvin" <mickael.gauvin@gmail.com> escribió en el mensaje
> news:fgndaf$fsa$1@build.eclipse.org...
>> Hello world,
>>
>> I have a problem in using the RMI method "rebind" in the start method
>> of my bundle. I have this source code :
>>
>> // ---------------------------------------------------------
>> IMyObject myObject = new MyObject();
>> SecurityManager securityManager = null;
>> securityManager = new RMISecurityManager();
>> System.setSecurityManager(securityManager);
>> LocateRegistry.createRegistry(9090);
>> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>> // ----------------------------------------------------------
>>
>> This code works well in a normal Java Project and I have configured the
>> java.policy file with :
>>
>> grant {
>> permission java.security.AllPermission;
>> };
>>
>> But in the equinox environment an Exception is thrown :
>>
>> // -----------------------------------------------------------
>> java.security.PrivilegedActionException: java.rmi.ServerException:
>> RemoteException occurred in server thread; nested exception is:
>> java.rmi.UnmarshalException: error unmarshalling arguments; nested
>> exception is:
>> java.lang.ClassNotFoundException:
>> fr.itcs.exec.service.distinfra.rmi.IMyObject
>> // -----------------------------------------------------------
>>
>> If anyone has encountered this problem, I will be pleased to hear his
>> solution. (May be a ClassLoader problem ?)
>>
>> Mickael.
>
>
|
|
|
Re: How to use RMI with Equinox [message #101643 is a reply to message #101115] |
Tue, 20 November 2007 08:12 |
Mickael GAUVIN Messages: 39 Registered: July 2009 |
Member |
|
|
Thank you,
It works. The problem is that the RMI Naming class is loaded by the
System Class Loader and not by my bundle class loader. For the Registry
class it is different because it is my bundle who creates it.
Thanks.
Mickael.
Jaime a écrit :
> Hi Mickael,
>
> I suffer the same problem than you.
> If you have the chance, replace:
>
> LocateRegistry.createRegistry(9090);
> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>
> by:
>
> Registry registry = LocateRegistry.createRegistry(9090);
> registry.rebind("testMyObject", myObject);
>
> You shouldn't have any problem with this code.
>
> BR,
> Jaime
> "Mickael Gauvin" <mickael.gauvin@gmail.com> escribió en el mensaje
> news:fgndaf$fsa$1@build.eclipse.org...
>> Hello world,
>>
>> I have a problem in using the RMI method "rebind" in the start method
>> of my bundle. I have this source code :
>>
>> // ---------------------------------------------------------
>> IMyObject myObject = new MyObject();
>> SecurityManager securityManager = null;
>> securityManager = new RMISecurityManager();
>> System.setSecurityManager(securityManager);
>> LocateRegistry.createRegistry(9090);
>> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>> // ----------------------------------------------------------
>>
>> This code works well in a normal Java Project and I have configured the
>> java.policy file with :
>>
>> grant {
>> permission java.security.AllPermission;
>> };
>>
>> But in the equinox environment an Exception is thrown :
>>
>> // -----------------------------------------------------------
>> java.security.PrivilegedActionException: java.rmi.ServerException:
>> RemoteException occurred in server thread; nested exception is:
>> java.rmi.UnmarshalException: error unmarshalling arguments; nested
>> exception is:
>> java.lang.ClassNotFoundException:
>> fr.itcs.exec.service.distinfra.rmi.IMyObject
>> // -----------------------------------------------------------
>>
>> If anyone has encountered this problem, I will be pleased to hear his
>> solution. (May be a ClassLoader problem ?)
>>
>> Mickael.
>
>
|
|
|
Re: How to use RMI with Equinox [message #108966 is a reply to message #101630] |
Tue, 29 April 2008 20:03 |
Eclipse User |
|
|
|
Originally posted by: wesendon.in.tum.de
Hi,
I have a simillar Problem, but still didn't manage to get the RMI
running. How do you solve this class loader issue? Maybe you have a idea?
The server code:
public class RMITest{
public RMITest() throws RemoteException, MalformedURLException {
System.setSecurityManager(new RMISecurityManager());
LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
RemoteServer.setLog(System.out);
FacadeTest stub = (FacadeTest) UnicastRemoteObject.exportObject(new
FacadeTestImpl(), 0);
Registry registry = LocateRegistry.getRegistry();
registry.rebind("FacadeTest", stub);
}
}
The Exception:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
java.lang.ClassNotFoundException: org.unicase.emfstore.rmi.FacadeTest
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
Regards.
Mickael Gauvin schrieb:
> Thank you,
>
> It works. The problem is that the RMI Naming class is loaded by the
> System Class Loader and not by my bundle class loader. For the Registry
> class it is different because it is my bundle who creates it.
>
> Thanks.
>
> Mickael.
>
> Jaime a écrit :
>> Hi Mickael,
>>
>> I suffer the same problem than you.
>> If you have the chance, replace:
>>
>> LocateRegistry.createRegistry(9090);
>> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>>
>> by:
>>
>> Registry registry = LocateRegistry.createRegistry(9090);
>> registry.rebind("testMyObject", myObject);
>>
>> You shouldn't have any problem with this code.
>>
>> BR,
>> Jaime
>> "Mickael Gauvin" <mickael.gauvin@gmail.com> escribió en el mensaje
>> news:fgndaf$fsa$1@build.eclipse.org...
>>> Hello world,
>>>
>>> I have a problem in using the RMI method "rebind" in the start method
>>> of my bundle. I have this source code :
>>>
>>> // ---------------------------------------------------------
>>> IMyObject myObject = new MyObject();
>>> SecurityManager securityManager = null;
>>> securityManager = new RMISecurityManager();
>>> System.setSecurityManager(securityManager);
>>> LocateRegistry.createRegistry(9090);
>>> Naming.rebind("rmi://localhost:9090/testMyObject", myObject);
>>> // ----------------------------------------------------------
>>>
>>> This code works well in a normal Java Project and I have configured the
>>> java.policy file with :
>>>
>>> grant {
>>> permission java.security.AllPermission;
>>> };
>>>
>>> But in the equinox environment an Exception is thrown :
>>>
>>> // -----------------------------------------------------------
>>> java.security.PrivilegedActionException: java.rmi.ServerException:
>>> RemoteException occurred in server thread; nested exception is:
>>> java.rmi.UnmarshalException: error unmarshalling arguments; nested
>>> exception is:
>>> java.lang.ClassNotFoundException:
>>> fr.itcs.exec.service.distinfra.rmi.IMyObject
>>> // -----------------------------------------------------------
>>>
>>> If anyone has encountered this problem, I will be pleased to hear his
>>> solution. (May be a ClassLoader problem ?)
>>>
>>> Mickael.
>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02389 seconds