liquide liquide - 5 months ago 57
Java Question

Starting of Tomcat failed from Netbeans

I have problem with starting Apache Tomcat 6 from Netbeans IDE 7.4 (on 7.3 version I had the same troubles. Other people mentioned that this problem exist also in other versions, like 8.0 etc).

What did I do:


  • remove installed Tomcat 7 (without removing it, I had the same difficulties)

  • add new server, downloaded from Apache Tomcat website (version apache-tomcat-6.0.39, with other version I had the same problems)

  • my server location: D:\apache-tomcat-netbeans

  • system variable CATALINA_HOME: D:\apache-tomcat-netbeans

  • system variable JAVA HOME: C:\Program Files\Java\jdk1.7.0_51\

  • tomcat user: I let netbeans creating new user, called tomcat with password tomcat. When I open {tomcat}\conf\tomcat-users.xml file after adding server, there is info about my user:

    < user password="tomcat" roles="manager,admin" username="tomcat"/ >



When I now click "start", I got "Starting of Tomcat failed".

My suspicions:


  • I'm working on Windows 7 as administrator, so I think this is not a problem with privileges to files.

  • Disabling proxy didn't helps.

  • Logs: There is only one log file created: localhost.2014-03-06.log and it is totally empty.

  • Starting Netbeans "as administrator" didn't helps.

  • From command line everything is all right, I have no problems with starting in normal or debug mode (catalina.bat jpda start or startup.bat)


Answer

I have faced the exact problem in apache-tomcat-7.0.56 and apache-tomcat-8.0.14 with netbeans7.4 and netbeans8. I installed tomcat from zip file. I fixed it by changing catalina.bat file in tomcat bin directory.

Find the bellow configuration in your catalina.bat file.

:noJuliConfig
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"

:noJuliManager
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%"

Just remove the double quotes

:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%

:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%

Now save and start your tomcat from NetBeans. It works for me in apache-tomcat-7.0.56 and apache-tomcat-8.0.14.