Starting of Tomcat failed from Netbeans

liquide picture liquide · Mar 6, 2014 · Viewed 128.8k times · Source

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

Sudeepta picture Sudeepta · Oct 15, 2014

It affects at least NetBeans versions 7.4 through 8.0.2. It was first reported from version 8.0 and fixed in NetBeans 8.1. It would have had the problem for any tomcat version (confirmed for versions 7.0.56 through 8.0.28).

Specifics are described as Netbeans bug #248182.

This problem is also related to postings mentioning the following error output:

'127.0.0.1*' is not recognized as an internal or external command, operable program or batch file.

For a tomcat installed from the zip file, I fixed it by changing the catalina.bat file in the 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%"

And change it as in below by removing the double quotes:

:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%

:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%

Now save your changes, and start your tomcat from within NetBeans.