aspose file tools*
The moose likes Distributed Java and the fly likes Declaring a remote interface and RMIC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Declaring a remote interface and RMIC" Watch "Declaring a remote interface and RMIC" New topic
Author

Declaring a remote interface and RMIC

Richard Everhart
Ranch Hand

Joined: Nov 19, 2003
Posts: 54
I have what I thought was a framework that would allow me to create a client/server application where the server could either reside remotely or operate locally, as part of the client component. I created the following classes and interfaces to accomodate local and remote access to the server:



As you can see the methods in Service all throw ServiceException. This is fine if LocalService is to be Service's only implementation; however, since it is extended by RemoteService with the intention of using it as a remote object, its methods should also throw RemoteException. Right? I thought I solved this as follows:



However, when I invoke rmic on RMIService I get the following errors:



I don't understand how this can be since I've defined ServiceException to extend RemoteException, so ServiceException IS A RemoteException. What am I missing here?

Also, I'm already just about finished with the local version of the application so I'm hoping that there is something I can do that will not require me to do too much rewriting, if any. Any feedback appriciated.

Rich
Kedar Bhawarthi
Greenhorn

Joined: Jun 21, 2004
Posts: 10
problem itself was very fundamental;
You should declare each method in Service interface throwing RemoteException
while implimenting RMIService class you can still throw ServiceException Object as Service Exception is derived from RemoteException;
so change in declaration is not going to affect your implimentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Declaring a remote interface and RMIC
 
Similar Threads
Can't declare methods to throw java.rmi.RemoteException
[UB1.3.3] DBMain Question! Help me plz..
Package Design
Terminology Clarification
NX:About DBMain interface