简体   繁体   中英

Unable to Add external Server Tomcat In Netbeans 7.1

I am going to add Tomcat server in Netbeans 7.1 , it shows:

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

指定的服务器位置(Catalina Home)文件夹无效。

Can any body explain this?

CATALINA_HOME refers to the root directory of Tomcat. This is often set as a sytem variable along with JAVA_HOME, the location of your jdk.

When netbean asks for a path to your Tomcat server, give it the root path of your Tomcat installation, not the bin directory.

It looks like you did not specify the correct path. Maybe looking at this Netbeans Wiki Page on how to add Tomcat as an External server might help.

This is what it is looking for: D:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.22

Using CATALINA_BASE: "D:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.22"
Using CATALINA_HOME: "D:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.22"
Using CATALINA_TMPDIR: "D:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.22\\temp"
Using JRE_HOME: "D:\\Program Files\\Java\\jdk1.6.0_21"
Using CLASSPATH: "D:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.22\\bin\\bootstrap.jar;D:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.22\\bin\\tomcat-juli.jar"

In my case, the information needed was giving looking on the "It works!" page that serves Tomcat by default at localhost:8080 .

It mentioned the CATALINA_HOME and CATALINA_BASE locations, which in my case where:

CATALINA_HOME=/usr/share/tomcat7
CATALINA_BASE=/var/lib/tomcat7

Entering both paths on the Netbeans dialog did the work.

NOTE: if you see the following warning is because you need to also add the CATALINA_BASE path, not only the home.

无法读取 <CATALINA_HOME>/conf/server.xml。


You may still have troubles with the credentials

无法锁定只读文件 /var/lib/tomcat7/conf/tomcat-users.xml

To solve this new problem just add a new user into the mentioned file and try again.

This error is because the file can only be written by the Root user, not Netbeans. And because of this, it's not recommendable to use the Create user if it does not exist option.


For more information checkout the Ubuntu server guide and this Netbeans thread .

In my case I needed to chown the tomcat directory -

    sudo chown -R username:username /opt/tomcat-8/

Because I had set the owner and group to tomcat. Alternately adding my user to the tomcat group works too.

If you are getting:

The specified Server location(catalina home) folder not valid

error, it simply means you have not specified the correct directory to the tomcat,

Right click on Servers in your Netbean->Add server-> Apache Tomcat or TomcatEE->Next->Browse So when you navigate to the the extracted folder of the tomcat make sure you click it one more time to get into the root directory and the error will disappear , then click finish.

Netbeans 12.0 apache-tomcat-8.5.60

this will give you the catalina.home directory

ps aux | grep catalina

catalina.home=/opt/tomcat/apache-tomcat-8.5.60

catalina.base=/opt/tomcat/apache-tomcat-8.5.60

chown the tomcat directory worked for me

sudo chmod -R 775 /opt/tomcat/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM