Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Trouble starting Tomcat 8.5 in Netbeans 8.1, JDK 1.8, Windows 10  RSS feed

 
marten kay
Ranch Hand
Posts: 188
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm reengaging with Java programming after a couple of years break.  I'm using
- Tomcat 8.5
- Netbeans 8.1
- JDK 1.8
- Windows 10

I've managed to install Tomcat, and can successfully run a simple servlet on http://localhost:8080/ manually

However I can't get Tomcat to work using Netbeans. With two main errors.
- First time Deployment error: Starting of Tomcat failed. See the server log for details.
- Second time Deployment error: Starting of Tomcat failed, the server port 8080 is already in use. See the server log for details.

I can reset "8080 already in use" using taskkill /f /pid xxx in the command prompt.

I have removed couple of double quotes in the catalina.bat as suggested in other fora, no change.

Any clues or tips for progressing my problem solving would be welcome.

Thanks

Marten

In the first time, the localhost_access_log has lines like this
127.0.0.1 - - [24/Aug/2016:11:07:31 +1000] "HEAD /netbeans-tomcat-status-test HTTP/1.1" 404 -
127.0.0.1 - - [24/Aug/2016:11:07:31 +1000] "HEAD /netbeans-tomcat-status-test HTTP/1.1" 404 -
127.0.0.1 - - [24/Aug/2016:11:07:31 +1000] "HEAD /netbeans-tomcat-status-test HTTP/1.1" 404 -


and the Catalina log has the following
24-Aug-2016 11:04:31.130 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.4
24-Aug-2016 11:04:31.130 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jul 6 2016 08:43:30 UTC
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.4.0
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jdk1.8.0_102\jre
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_102-b14
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Program Files\Apache Software Foundation\Tomcat 8.5
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 8.5
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
24-Aug-2016 11:04:31.131 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\logging.properties
24-Aug-2016 11:04:31.132 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
24-Aug-2016 11:04:31.132 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 8.5
24-Aug-2016 11:04:31.132 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.5
24-Aug-2016 11:04:31.132 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp
24-Aug-2016 11:04:31.132 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_102\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;%CATALINA_HOME%\bin;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;.
24-Aug-2016 11:04:31.216 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
24-Aug-2016 11:04:31.284 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Aug-2016 11:04:31.286 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
24-Aug-2016 11:04:31.288 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Aug-2016 11:04:31.289 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 414 ms
24-Aug-2016 11:04:31.306 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
24-Aug-2016 11:04:31.306 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.4
24-Aug-2016 11:04:31.313 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ch1
24-Aug-2016 11:04:31.513 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ch1 has finished in 200 ms
24-Aug-2016 11:04:31.513 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\docs
24-Aug-2016 11:04:31.529 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\docs has finished in 16 ms
24-Aug-2016 11:04:31.529 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager
24-Aug-2016 11:04:31.555 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager has finished in 26 ms
24-Aug-2016 11:04:31.555 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ROOT
24-Aug-2016 11:04:31.569 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ROOT has finished in 14 ms
24-Aug-2016 11:04:31.572 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
24-Aug-2016 11:04:31.578 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009]
24-Aug-2016 11:04:31.580 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 291 ms
 
marten kay
Ranch Hand
Posts: 188
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, totally random fix in my opinion, found on stackoverflow here.

In the server.xml, I replaced


with


and it magically worked.  As I said, this seems totally random and without reason.

Marten
 
marten kay
Ranch Hand
Posts: 188
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One further comment, should anybody else find this thread with similar problems and in search of solutions.  I also needed to change permissions in the C:\Program Files\Apache Software Foundation\Tomcat 8.5\logs folder to allow tomcat to write log files.  I set up Windows 10, Netbeans and Tomcat from scratch, and I found the Windows permissions with its System/Administators/Users/Applications/TrustedUsers a tad difficult to navigate.  As it's all on my machine, I gave Full Control to all as much as I could.

Right click on folder -> Properties -> Security tab -> then select Group or user names and edit permissions.
 
Howard Watson
Ranch Hand
Posts: 67
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thought it was worth mentioning that as of Tomcat 8.5.3 the server attribute is not set by default on a connector and apparently Netbeans uses it.

https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!