File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Testing that dynamic code download does NOT occur Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Testing that dynamic code download does NOT occur" Watch "Testing that dynamic code download does NOT occur" New topic
Author

Testing that dynamic code download does NOT occur

John McParland
Ranch Hand

Joined: May 11, 2009
Posts: 92

Hi folks,

I'm trying to ensure that dynamic code downloading doesn't occur when I run my client. Is is enough to see that the stub is loaded when running Java in verbose mode;

java -verbose -jar runme.jar
....
Loaded suncertify.server.Server_Stub from file:/C:/cygwin/home/jmcparla/SCJD/scjd/runme.jar]

I think I got this idea from this forum but I can't remember where.

There is only one class which I export to the RMI registry and it is suncertify.server.Server. I've used RMIC to build the stub.

Regards,

John


Passed: SCJP 6 (90%), SCJD 6
Other: Spring training, extensive Swing experience
Cindy Carney
Ranch Hand

Joined: Jan 12, 2010
Posts: 57
Well, technically it says 'You must provide all classes pre-installed so that no dynamic class downloading occurs.' I would think that doesn't mean to disable dynamic class downloading, but instead to make it 'unnecessary' by supplying all classes.

Just a guess from reading the assignment, though - that's how I interpreted that section, anyways. I would think ensuring all your class files are there would be sufficient.

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4351

John McParland wrote:I think I got this idea from this forum but I can't remember where.
I guess you find your inspiration here.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
John McParland
Ranch Hand

Joined: May 11, 2009
Posts: 92

Thanks Cindy / Roel,

that's cleared things up. That was the post I was looking for. I don't know how I couldn't find it.

Oh well, looks like I will be submitting this week. Getting nervous / excited.

Regards,

John
John McParland
Ranch Hand

Joined: May 11, 2009
Posts: 92

If anyone's interested the output you get when you don't use the stubs (which happens in alone and server mode) is;

[Loaded suncertify.server.Server from file:/C:/cygwin/home/jmcparla/SCJD/runme.jar]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Testing that dynamic code download does NOT occur
 
Similar Threads
RMI, classpath and application starting
How to check dynamic code downloading ...
How to work out where a jar file is coming from?
Confused about RMI
Restrictions on RMI - what does that mean to me?