• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI, classpath and application starting

 
Bernd Wollny
Ranch Hand
Posts: 59
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody!!!

In the last weeks i have been developing on just one machine starting two different VMs and everything was working fine.
But today i have tested my RMI implementation in a "real-world-scenario" on two physical different machines and it unfortunately crashed on client side with the following error:


I googled a little bit and found this explanation here which was really that kind of problem i had or still have....

So, this page told me to add my stub classes a.s.o. the to classpath and.... great it worked!!! BUT, this means that i have to start the client with something similar to this.:.... i really was wondering because the stub and skeletons are already in my runme.jar and the CLASSPATH points to "." like Roel specified in his really great build.xml. So i thought that should be enough?!?!?
Now, my question is: How can i start my client app and how can i avoid to specify where to find stub classes?
Because the assignment says that the app must be started with: and nothing else. Thanks in advance.

Kind regards
Bernd
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bernd,

You are correct: if your stub and skeleton classes are added to your runme.jar (with using rmic tool) everything should work fine.

If you don't use the generated files by rmic is your solution working in the "real-world-scenario"? Roberto Perillo for example passed without generating those files because from Java 5 it is not needed anymore.

You can call java -verbose:class -runme.jar which will show you which classes are loaded, so you can see if the generated classes are loaded. More info can be found here (and you can also see that the generated classes are just loaded from the runme.jar)

Maybe a stupid question: did you check the runme.jar to see if the generated classes are in the correct directorories (according to their package)?

Kind regards,
Roel
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, y'all.

Hey Bernd, can you post a small sample of your server, just so we can have an idea of how you coded it?
 
Bernd Wollny
Ranch Hand
Posts: 59
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Roel, hey Roberto,

@Roberto: Of course i can. The most important thing within my server regarding RMI are these two lines:

Is there anything else to do?

@Roel: I'm using your build.xml, so the classes are in the correct directories... I will check if it will work without rmic...

Kind regards,
Bernd
 
Bernd Wollny
Ranch Hand
Posts: 59
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmmmm.... strange effects, seems to work now....

I can see hundreds of class loading outputs, including such as this:
What does that excactly mean? Everything's ok? Or does that mean i have dynamic class downloading wihch i have to avoid?

 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bernd Wollny wrote:Everything's ok? Or does that mean i have dynamic class downloading wihch i have to avoid?


No, no. It means the stub is being loaded from your .jar file, so no dynamic downloading there.
Were you able to get everything running correctly now?
 
Bernd Wollny
Ranch Hand
Posts: 59
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roberto Perillo wrote:Were you able to get everything running correctly now?

It seems so, so let's close this thread until i have that problem again...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic