wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes Problem with RMI (ServerException) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Problem with RMI (ServerException)" Watch "Problem with RMI (ServerException)" New topic
Author

Problem with RMI (ServerException)

Christopher Button
Greenhorn

Joined: Feb 19, 2013
Posts: 5
Good day,

I was hoping with a quick glance over this code someone might be able to elucidate the problem I seem to be having in getting my client side to correctly invoke methods on the RMI stub.

I have set it up according to Andrew Monkhouse's design (Factory pattern) but am getting the below error whenever I try to run the client after running the server.

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\IT>java -jar c:\scjd\dist\scjd.jar

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 long suncertify.db.DB.lock(int) throws suncertify.db.exceptions.RecordNotFoundException

java.lang.NullPointerException

Exception in thread "main" java.lang.NullPointerException
at suncertify.gui.Client.setTable(Client.java:69)
at suncertify.gui.Client.<init>(Client.java:49)
at suncertify.gui.AppLoader.<init>(AppLoader.java:22)
at suncertify.gui.AppLoader.main(AppLoader.java:17)


All the necessary methods throw RemoteExceptions.

More information may be needed from me to clarify things, but what I'm really after is an understanding of what the general issue is here, as far as "illegal remote method" and "illegal remote interface" are concerned. They are coded as per Monkhouse's design.

The issue with the Lock method is baffling above all, since I haven't yet invoked it at all, anywhere, and it is only one of the methods in the DB interface. I can't understand why it is being singled out.

I don't want to paste large swathes of code, so if any specific information is further needed, please let me know and I will try and explain in more detail what is required.

Any general conceptual help would be most appreciated.

Thank you,

Chris
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 721
First of all, this is not the right forum for SCJD exam. You may want to move it to the right forum.

It seems to me that the Dvd.db file is missing.
Maybe, try to un-jar the files, make sure the Dvd.db is in the current working directory and run the main methods and see.
Christopher Button
Greenhorn

Joined: Feb 19, 2013
Posts: 5
I can't believe I posted this in the wrong forum. Sorry about that. Could a moderator move this to the correct location?

Also, I rewrote my RMI code to fit the Adapter pattern, rather than the Factory pattern. It seems all is working well now.

Thanks for the help in any case!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with RMI (ServerException)
 
Similar Threads
how to get Clients CPU information on Server using Java RMI
RMI Security Exception
RMI client failure
Stumped with RMI design
unable to run client