aspose file tools*
The moose likes Spring and the fly likes Spring Rmi Integration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Rmi Integration" Watch "Spring Rmi Integration" New topic
Author

Spring Rmi Integration

Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

Hi All,

I am working on Spring-RMI integration, following what is provided in "Spring in Action" book.

I want to know should we have to re-create the interfaces & domain Objects in client side as well. (That definitely doesn't look the way)

I get a compile time exception stating the server side interfaces & domain Objects are not found.

Any help is appreciated.

Server Side Code :

Application.java


Employee.java (Domain)



Interface


Implementation


Server side Configuration File


Client Side Code

Application.java



Client Side configuration file



Regards,
Ashwin


Ashwin Sridhar
SCJP | SCWCD | OCA
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

OK. This actually comes down to how core Java works.

If you have code that uses other classes, those classes always have to be in the classpath.

So if I am a client, and I use your Domain object in my code, then the domain object class better be in my client side classpath. Same with if I use your interface, then the Interface better be in my classpath.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

If I understand you correctly, should I have the interface and domain Object in my client side as well ?

Then any change on server, requires appropriate changes in the client as well ?
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

Having interfaces & domain on the classpath of the client makes a very tight coupling. Is this not a drawback of RMI ?

Or is this the place where Webservices over powers RMI ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Ashwin Sridhar wrote:If I understand you correctly, should I have the interface and domain Object in my client side as well ?

Then any change on server, requires appropriate changes in the client as well ?


You should have whatever class files you need and use in any Java code running. Regardless.

I run java from the command line, and it runs some Java code, any class that that code uses has to have that class in the classpath. Plain and simple. Trying to figure out client side server side it just adding complexity to the question.

If both the server side and the client side are both using a class, then that class has to be in the classpath for both sides. not because it is client and server, but because each is using the class in their own jvm. That is why this is just a Java question and not related to Spring.

Hope that helps clear things up for you.

Mark
 
jQuery in Action, 2nd edition
 
subject: Spring Rmi Integration