My app uses Struts2 MVC, Spring JDBC Template with Eclipse IDE and Tomcat. Whenever I change a class code, I have to restart the Tomcat, which waste about 15-20 seconds every time.
I have configured hot-deployment i.e. on-java-class-change, context reloaded automatically, but it often fails, and I have to restart the Tomcat.
What I wish is:
-
When I make a change to JSP, it should be auto loaded, instead of on-1st-request.
-
When a java class is changed and build, only that class should be loaded, without restarting Tomcat, even whole context should not restart or reload.
If someone have used Jetty, please share – does Jetty provide better solution to these issues.
In PHP, you make a change in script, and access that page, its ready. I just wish it in Java.
We are using embedded Jetty at work and it’s a blast. See http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty for a guide on embedding Jetty.
The startup time on the Jetty side is extremely fast (1-2 seconds). In our case though spring takes a lot of time to initialize still.
It is easy to configure Jetty to reload jsps automatically just point it to a directory and not war file and jsps will reload automatically, something like this:
Class reloading is possible using hot swap, I don’t know if there are ready solutions for when hot swap doesn’t work.