File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Problem with RMI (ServerException)" Watch "Problem with RMI (ServerException)" New topic

Problem with RMI (ServerException)

Christopher Button

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


Exception in thread "main" java.lang.NullPointerException
at suncertify.gui.Client.setTable(
at suncertify.gui.Client.<init>(
at suncertify.gui.AppLoader.<init>(
at suncertify.gui.AppLoader.main(

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,

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 1118
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

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!
I agree. Here's the link:
subject: Problem with RMI (ServerException)
jQuery in Action, 3rd edition