This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Static Methods in RMI RemoteInterface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Static Methods in RMI RemoteInterface" Watch "Static Methods in RMI RemoteInterface" New topic
Author

Static Methods in RMI RemoteInterface

Ray Dawson
Ranch Hand

Joined: Sep 16, 2011
Posts: 75
I'm now building the RMI RemoteInterface where I have to give the methods of the server that the client can use.

But in the server I have many static methods which gives out an error as I add them to the interface.


As I remove the static from them, I get the error


So shall I remove the static variables & methods from the entire server class ?
Or how shall I proceed ?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4926
    
  10

Do you have SCJP/OCPJP certification? Then you should know static methods can not be added to an interface. You should also know that you can access static members from an instance method, but accessing instance members from a static method will give you a compiler error.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 614
Hello Ray buddy,
I recommend you to read Terry and Andrew Monkhouse's SCJD study guide for reference. It is very helpful and it provide some information about RMI.
You can also visit Oracle's tutorial about RMI.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static Methods in RMI RemoteInterface
 
Similar Threads
Switching modes for local/network client
About JTable
RMI - Remote Method Invocation
can't get this little RMI program to run...
java.rmi.ServerException: java .rmi.UnmarshallException