0
votes

I use the following frameworks for my web application:

  • Maven
  • Spring MVC 3.2.4
  • Spring Security 3.1.4

I use Netbeans 7.3 and Glassfish 3.1.2 and it is a maven project.

And it's been painfully slow that I need to restart the Glassfish re-build and re-run the project just to be able to test the code that I change every single minute. Changes to jsp files can be updated by the auto-deploy just fine, but somehow to be able to test the changes to the mvc controller I need to re-build and re-run the project (by turning off the glassfish and right click on the project and select clean and build and select then run). And each run takes about 10-15 minutes. Is there any less painful way to test my code?

2

2 Answers

1
votes

Depending on the purpose, scope, and funding of your project, you might consider JRebel. It's not cheap, but it's affordable for a business project and free for work on open-source software. They've basically built an insanely flexible version of the JVM hot-swap setup.

0
votes

You need to use a debugger.

Start Glassfish in debug more - this explains how to do that. If not starting Glassfish from NeatBeans this SO answer gives you the settings to allow remote debugging in NetBeans.

Now you are "attached" to the Glassfish JVM via the NetBeans debugger. You can insert breakpoints into the code and the application will stop at them. You can inspect variable values.

You can make changes to code and use the "Apply Code Changes" option under the "Deubug" menu to send the changed classes to the JVM.

This should reduce the amount of time required to test code changes to a few seconds.

Here is a short YouTube tutorial on the NetBeans debugger.