• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring Rmi Integration

 
Ranch Hand
Posts: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic