Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error registering a Tomcat 7 server in Netbeans 7 (Catalina Home folder is not valid)

I'm running Netbeans 7.0.1 on Linux Mint DE. Netbeans was installed through the distro's repositories. I've now installed the package tomcat7-user so I can create a user instance of Tomcat which I can start or stop as required. When I start this instance (using bin/startup.sh) the script reports:

Using CATALINA_BASE:   /home/david/tomcat
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /home/david/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-6-sun
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Tomcat started

So, in Netbeans, I go to Tools -> Servers, click Add Server, select Apache Tomcat, click next and in the Server Location (Catalina Home) field I put /usr/share/tomcat7. But Netbeans reports:

The specified Server Location (Catalina Home) folder is not valid.

I thought perhaps it's a permissions issue so I (temporarily) chmoded everything in /usr/share/tomcat7 (including that folder itself) to 0777 but still that error message appears. So my next thought is maybe there's something missing, so I symlinked all of the folders in Catalina base into Catalina home, but still no luck.

Now it would be very helpful if Netbeans actually told you not just that a problem exists, but what the problem actually is, too. I'm quite close to going through the Netbeans source code to find out what it actually wants, but if anyone could shed some light on this for me that would save me an awful lot of fuss!

like image 981
daiscog Avatar asked Dec 03 '11 21:12

daiscog


People also ask

Where is Catalina Home folder?

CATALINA_HOME: Represents the root of your Tomcat installation, for example /home/tomcat/apache-tomcat-9.0. 10 or C:\Program Files\apache-tomcat-9.0.

How install Apache Tomcat in Netbeans?

Restart Netbeans. On the project view (default left side of the screen), go to services, right click on Servers and then "Add Server" Select Apache Tomcat, enter username and password and config the rest and finish.

How do you fix the start of Tomcat failed the server port 8080 is already in use?

Kill the previous instance of tomcat or the process that's running on 8080. Show activity on this post. Select the project -> Right-Click -> clean and build and then run the project again simply solve the problem for me.


1 Answers

Okay, in the absence of anything sensible anywhere on the net, I downloaded the Netbeans source code this weekend and found out the hard way.

For some reason, Netbeans thinks I have an old version of Tomcat, so it's looking for the ${CATALINA_HOME}/common/lib folder. The following terminal commands fixed the problem:

cd /usr/share/tomcat7
sudo mkdir common
sudo ln -s lib common/lib
like image 186
daiscog Avatar answered Sep 30 '22 00:09

daiscog