Saturday, 26 March 2011

Autodeploying in Glassfish

When recording the JavaEE Course, I faced a dilemma: do I use Glassfish's Autodeployment feature or not?

I decided "not". You'll see this if you follow the course: each time a change is made to any of the server side code, we have to run a build and then redeploy to Glassfish manually. It's only a few mouse clicks, but given that we re-deploy hundreds of times, it does get tedious.

So why did I opt not to use Glassfish's perfectly good Autodeployment feature?

It comes from my experience on live courses, where the autodeploy would fail for some minor reason (eg file locking problems, failing to delete a previous installation of a bean, etc). As you're busy learning lots of complex technologies, you tend to assume that you've done something wrong in the code.

Then, you lose hours trying to debug code that is actually working!

So, for simplicity, I use manual deployment through the course. But at some point, you will want autodeployment ON, so I've produced a short video to accompany the course.

It's only 15 minutes, and after following these steps your workflow should be much faster.

But please: as soon as you hit a problem where you've made a change to your code and yet nothing seems to have changed, do check your autodeploy folder for details of any failure.

Note: if you are using autodeployment in the later stages of the course when we are building a web application, it is your WAR file that needs to be autodeployed, not the JAR file.

No comments:

Post a Comment