Hallo everybody
I'm doing the B&S assignment. I'm busy with the last part, setting up a network connection between the server and the client. I choose RMi.
I'm now able to start the server , and the RMI registry programatically.
When doing: netstat -na |grep 1099 I see that this port is listening.
Then I launch the Gui client , give as host : local host and as port 1099.
The client finds the registry for it doesn't fail doing:
DataRemoteFactory remoteFactory = (DataRemoteFactory) Naming.lookup(url);
But when asking to the server an instance of the object the client should use to talk to a failure takes place :
DataRemote remote = remoteFactory.getClient();
The url is correct. But this is the trace I receive: (HOpe is not too long)
java.rmi.ServerException: RemoteException occurred in server
thread; nested exception is:
java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
java.lang.IllegalArgumentException: illegal remote method encountered: public abstract java.util.Collection suncertify.db.MyInterface.readAllRecords()
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:179)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
at $Proxy0.getClient(Unknown Source)
at suncertify.remote.RmiClient.getRemote(RmiClient.java:42)
at suncertify.gui.controller.GuiController.<init>(GuiController.java:60)
at suncertify.gui.wiew.ClientWindow.<init>(ClientWindow.java:100)
at suncertify.gui.ApplicationRunner.<init>(ApplicationRunner.java:56)
at suncertify.gui.ApplicationRunner.main(ApplicationRunner.java:35)
Caused by: java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
java.lang.IllegalArgumentException: illegal remote method encountered: public abstract java.util.Collection suncertify.db.MyInterface.readAllRecords()
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:171)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:235)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:133)
at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:119)
at suncertify.remote.DataRemoteImpl.<init>(DataRemoteImpl.java:24)
at suncertify.remote.DataRemoteFactoryImpl.getClient(DataRemoteFactoryImpl.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException: illegal remote method encountered: public abstract java.util.Collection suncertify.db.MyInterface.readAllRecords()
at sun.rmi.server.Util.checkMethod(Util.java:244)
at sun.rmi.server.Util.getRemoteInterfaces(Util.java:223)
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)
... 17 more
Exception in thread "main" java.lang.NullPointerException
at suncertify.gui.controller.GuiController.getAllContractors(GuiController.java:96)
at suncertify.gui.wiew.ClientWindow.createAndShow(ClientWindow.java:128)
at suncertify.gui.wiew.ClientWindow.<init>(ClientWindow.java:104)
at suncertify.gui.ApplicationRunner.<init>(ApplicationRunner.java:56)
at suncertify.gui.ApplicationRunner.main(ApplicationRunner.java:35)
I've no idea what's going on... and that is just to little to go on.
Thank you in advance.
Amy