Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt

 
Raj Neets
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Iam working with tomcat(in Unix environment),my web server is not loading the .class file once i compile,so every time i compile, i have to restart my webserver. i have my class file and java file in webapps/ROOT/WEB_INF/classes.i don't know whether it takes time or i have to do something to get the .class file automatically loaded.
Thank for your time.
Raj
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a typical problem.
Being able to dynamically reload classes is the exception rather than the normal behaviour, so Yes, you do have to restart every time you change a class file.
You'd find the same thing if you were designing a Swing application. If you start the application, access a class and then alter and recompile the class, you won't see the changes without restarting the application.
This expectation has been created (I believe) by the dynamic reloading of JSPs. This is a longer topic than I have time to write right now
Dave
 
rohit poduval
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about writing your own dynamic class loader.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, yeah, right.
The other option that is available if your server supports it and you have written your code properly, is the ability to restart invividual web applications.
This is only one step better, but if you have a heavy server (eg WebSphere) running multiple web applications, this is definitely preferable.
Dave
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat supports reloading individual applications. Since 4.1.12, there is a manager application that you can use to reload a web app, and since I forget when, you can specify the application as 'reloadable' in the server.xml config file.

This is not hard stuff, though some people have had flakey behaviour with reloadable, I think this has mostly been addressed in later releases.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic