Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2004

Tip: Looking for answers? Try searching our database.

Dynamically reloading jar file

Thread view: 
RCS - 17 Mar 2004 02:56 GMT
I'm having a CORBA server written in Java (OpenORB), and, since the
CORBA references to the clients are changed every time the server
restarts, whenever I do some changes to the server, all the clients have
to restart their apps.

Now, if the 'meat' of the code could be packaged in one jar file, and
the CORBA server serving the object references in another, and whenever
I changed the 'meat', could the CORBA server jar dynamically reload the
'meat' jar, so that the clients still had valid references?

That is, is it possible in Java to have one jar file reload/refresh
another jar file it is dependent on, without being itself being restarted?

RCS
Erwin Moller - 17 Mar 2004 11:26 GMT
> I'm having a CORBA server written in Java (OpenORB), and, since the
> CORBA references to the clients are changed every time the server
[quoted text clipped - 10 lines]
>
> RCS

Hi,

Not sure, but this can be relevant in your situation.
I had trouble with Netbeans when I changed a jar file.
I got exceptions complaining about 'invalid loc header'.

I asked about this at the netbeansbugparade.
They asked at Sun.
Sun claimed at one point that changing jar-files when running in a JVM is
not supported.

-----------------------
Duplicate of 4425695.  Modifying a jar file on the fly is not supported any
more than changing a shared library or a class file on the fly.  The only
reason way to replace a jar file is to guarantee that the classloader (and
all of its loaded classes and all objects of those) are no longer in use
and suitable for garbage collection.
-----------------------

Again, I am not sure if this is relevant to your problem.
You might want to read the whole bugreport with comments made by smarter
people than me. :P

http://developer.java.sun.com/developer/bugParade/bugs/4826081.html

Regards,
Erwin Moller
RCS - 17 Mar 2004 16:40 GMT
> > That is, is it possible in Java to have one jar file reload/refresh
> > another jar file it is dependent on, without being itself being restarted?

> Not sure, but this can be relevant in your situation.
> I had trouble with Netbeans when I changed a jar file.
[quoted text clipped - 4 lines]
> Sun claimed at one point that changing jar-files when running in a JVM is
> not supported.

Too bad! I was hoping for something like in the C/C++ world of
loadLibrary("meat"), where one can exchange the meat.dll on the fly as long
as no function has it loaded at the moment.

Thanks!

RCS


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.