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

て烟熏妆下的殇ゞ 提交于 2019-11-27 03:24:03

问题


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!


回答1:


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



回答2:


I like your research @daiscog I don't know how to run the terminal commands, so I simply created the ${CATALINA_HOME}/common/lib folder and now it works for me too.




回答3:


Maybe better:

cd /usr/share/tomcat7
sudo mkdir common
sudo ln -sf /usr/share/tomcat7/lib /usr/share/tomcat7/common/lib



回答4:


The following fixed Apache TomCat Server (apache-tomcat-9.0.0.M4) registration problem in NetBeans-8.0.2 on openSuSE 13.1 x86_64 linux:

As root user,

  1. # cd /opt
  2. # ln -s apache-tomcat-9.0.0.M4 tomcat
  3. # ln -sf /opt/tomcat/lib /opt/tomcat/common/lib

Then add server on NetBeans as per standard procedure.




回答5:


  1. Delete all tomcats installations,
  2. If you have the netbeans installer with tomcat installation, run again, in customized button, clicked and check tomcat only
  3. Now, you can open netbeans and add a new tomcat server


来源:https://stackoverflow.com/questions/8371059/error-registering-a-tomcat-7-server-in-netbeans-7-catalina-home-folder-is-not-v

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!