• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not able to update class files in servlets, help pls

 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am working on servlet projects, and as a new techie I have prob when I try to update a class file. When saving the class
file into the java web server for the first time into the coding works fine. But after doing some modification in the coding and storing the modified compiled class file in the web server, I
still get the same old coding results.
Help me friends, where I am wrong?
regards,
Ramesh
------------------
 
Taha Mohamed
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The old class may be in cache.
After you load the new class you need to restart the server !!
Try and let me know if it works
Taha
 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yessssssssssss,
u r right. it works.
Is there any way to omit shutting down the server,
as I modify my coding often. If it is possible plsss let me know
regards,
Ramesh
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This depends on the servlet container you use. Tomcat, the reference implementation, is not very good at detecting and updating servlets when the class files change. Resin, available from http://www.caucho.com/ is much better, and once you have it running you should not need to restart it when you update class files. In fact, resin will compile your source files for you if you want it to, so you just need to put a new version of a java source file into a monitored directory, and Resin will compile it and use the new version the next time a request comes in for that servlet.
 
ramesh kumar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thanks , but I am using Java web server.
So I guess it is necessary to shut down the server every time I
change my class file, Am I right?
Ramesh Kumar
 
Aru Ven
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramesh,
Even I am new to servlets world...I am using Javawebserver2.0.
I compile & save my java files in say
c:\javawebserver2.0\servlets directory.
Even after I make changes... there is no need to shutdown & start the webserver. The changes are reflected when I run the servlets.
HTH,
Aruna
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the option in tomcat is to allow reloadable. I don't know if Java Web Server has it or not. Usually, you can put you class files in the classes directory, they should automatically update themselves.
 
Ash
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are using java web server 2.0, you should save all your frequently changing servlets in the servlet dir. Any change you make to a class file in this dir is detected by the server and servlet is loaded again as needed. If you save your class files in classes directory you need to restart the server.
I would suggest not using java web server as sun no more supports that. {That is what i heard, since j2ee has everything}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic