M B Se: suncertify.service.LocalServiceImpl stored into non-transient field RemoteServiceImpl.service At RemoteServiceImpl.java
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Roel De Nijs wrote:Why have 2 business service implementations and not simply having 1?
The BusinessServiceImpl would just implement RemoteBusinessService and not extend anything. You can use an instance for local mode, and use UnicastRemoteObject.export() to create an instance which can be exposed through RMI.
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Roel De Nijs wrote:Why have 2 business service implementations and not simply having 1?
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sean Keane wrote:I didn't like the idea of my Local Business Service extending UnicastRemoteObject and implementing Remote.
Roel De Nijs wrote:
Sean Keane wrote:I didn't like the idea of my Local Business Service extending UnicastRemoteObject and implementing Remote.
It would not extend UnicastRemoteObject, because you would use its export-method. Not wanting to implement Remote is a valid argument.
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Stub class not found: suncertify.service.RemoteBusinessServiceImpl_Stub; nested exception is:
java.lang.ClassNotFoundException: suncertify.service.RemoteBusinessServiceImpl_Stub
java.rmi.StubNotFoundException: Stub class not found: suncertify.service.RemoteBusinessServiceImpl_Stub; nested exception is:
java.lang.ClassNotFoundException: suncertify.service.RemoteBusinessServiceImpl_Stub
at sun.rmi.server.Util.createStub(Util.java:274)
at sun.rmi.server.Util.createProxy(Util.java:122)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:179)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:220)
at suncertify.gui.RegisterRemoteService.register(RegisterRemoteService.java:21)
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Sean Keane wrote:From reading other threads on this forum, it seems that exportObject(Remote obj, int port) is the one to go with.
SCJP (1.4 | 5.0), OCJP (6.0), OCMJD
Don't get me started about those stupid light bulbs. |