Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Doubt  RSS feed

 
Ranch Hand
Posts: 46
  • 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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 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
 
Greenhorn
Posts: 6
  • 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
  • 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
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!