• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDK 1.4 assert facility in an RMI Server

 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was messing around with the new assertion facility in JDK 1.4 on my activatable RMI server code and found that I could NOT get it to work.
In order for assertions to be turned on, you have to pass the command line parameter "-ea" when you run the java command. Unfortunately, since the RMI server is started by the RMI registry/rmid program, that command line paramter is not passed to the server when it is invoked.
I can pass the parameter to the setup class and asserts work there, but once the RMI client requests a method from the server, and it gets activated, the asserts don't work.
Does anyone know of a solution to this, to getting assert to work on RMI activatable servers? I would assume that Unicast servers don't have a problem with this since you start them directly with the java command.
 
David Duran
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, I'm writing up a little test program right now, but I think I've come upon the answer.
** After testing, indeed this is the solution. Woohoo! Sure beats writing my own lame assertion class **
SOLUTION: When starting the rmid program, pass in the command line option "-C-ea" so that it will pass the -ea command line option to each child process that it starts.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!