Solution to Deployment issue using Netbeans 6.5.1 and Tomcat 6.0.22 on OX 10.5.7

Somehow I always find myself in the middle of a very strange computer problem. This particular issue is a result of my wanting to learn to write JSP applications using Netbeans 6.5.1 with Tomcat 6.0.20. I don’t have time to do a full writeup, so here’s a nutshell version of the problem and my solution:

Problem

When I tried to use the Deploy option to push my Netbeans project to my Tomcat webapps folder, the deployment would fail. I could manually copy the .war file into my Tomcat webapps folder and everything would work fine. But, I thought, “Why should I have to do this if Netbeans is supposed to do it for me?”

Solution

Since I’m running OS X 10.5.7, I opened the Netbeans configuration file at

/Applications/NetBeans/NetBeans6.5.1.app/
Contents/Resources/NetBeans/etc/Netbeans.conf

and added the following to the netbeans_default_options line:

-J-Djava.io.tmpdir=/tmp

Note: This must be added within the double quotes. Also, I didn’t distrub anything that was on the line already but merely added that tidbit of code.

Explaination

I found this piece of advice buried deep in a forum. Apparently, Netbeans puts the deployed files into a temporary folder before deploying them. The temporary folder it tries to use on OS X isn’t accessible (a permissions problem I guess). Adding that snippet of code tells Netbeans to use the OS X default temporary folder tmp for its intermediate work.

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *