This question already has answers here:
java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted
(7 answers)
Closed 7 years ago.
I've a war file of a web app that runs on tomcat 8 via netbeans as well as tomcat 8 independently without IDE. But if I try to run the same war file on tomcat 8 installed in an online server(I'm using koding.com vm for the purpose), I'm getting the following log in catalina.out:
19-Oct-2015 04:47:21.458 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.28
19-Oct-2015 04:47:21.459 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Oct 7 2015 18:25:21 UTC
19-Oct-2015 04:47:21.460 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.28.0
19-Oct-2015 04:47:21.460 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
19-Oct-2015 04:47:21.460 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.13.0-29-generic
19-Oct-2015 04:47:21.460 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
19-Oct-2015 04:47:21.460 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-7-openjdk-amd64/jre
19-Oct-2015 04:47:21.461 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.7.0_79-b14
19-Oct-2015 04:47:21.461 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
19-Oct-2015 04:47:21.461 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /home/stutech/tomcat
19-Oct-2015 04:47:21.461 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /home/stutech/tomcat
19-Oct-2015 04:47:21.462 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/stutech/tomcat/conf/logging.properties
19-Oct-2015 04:47:21.462 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
19-Oct-2015 04:47:21.462 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/home/stutech/tomcat/endorsed
19-Oct-2015 04:47:21.462 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/stutech/tomcat
19-Oct-2015 04:47:21.463 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/home/stutech/tomcat
19-Oct-2015 04:47:21.463 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/home/stutech/tomcat/temp
19-Oct-2015 04:47:21.463 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: /usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
19-Oct-2015 04:47:21.731 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
19-Oct-2015 04:47:21.782 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
19-Oct-2015 04:47:21.788 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
19-Oct-2015 04:47:21.794 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
19-Oct-2015 04:47:21.796 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1307 ms
19-Oct-2015 04:47:21.871 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
19-Oct-2015 04:47:21.880 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.28
19-Oct-2015 04:47:21.961 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/stutech/tomcat/webapps/Whiteboard.war
19-Oct-2015 04:47:21.979 WARNING [localhost-startStop-1] org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'antiJARLocking' to 'true' did not find a matching property.
19-Oct-2015 04:47:23.573 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Whiteboard]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1798)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: The servlets named [register] and [com.whiteboard.servlet.register] are both mapped to the url-pattern [/register] which is not permitted
at org.apache.tomcat.util.descriptor.web.WebXml.addServletMapping(WebXml.java:308)
at org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:2342)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2024)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1918)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1913)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1913)
at org.apache.catalina.startup.ContextConfig.processAnnotationsWebResource(ContextConfig.java:1913)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1139)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5080)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
19-Oct-2015 04:47:23.575 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive /home/stutech/tomcat/webapps/Whiteboard.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Whiteboard]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1798)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
19-Oct-2015 04:47:23.584 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/stutech/tomcat/webapps/Whiteboard.war has finished in 1,615 ms
19-Oct-2015 04:47:23.585 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/stutech/tomcat/webapps/docs
19-Oct-2015 04:47:23.918 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/stutech/tomcat/webapps/docs has finished in 333 ms
19-Oct-2015 04:47:23.922 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/stutech/tomcat/webapps/examples
19-Oct-2015 04:47:24.499 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/stutech/tomcat/webapps/examples has finished in 577 ms
19-Oct-2015 04:47:24.499 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/stutech/tomcat/webapps/host-manager
19-Oct-2015 04:47:24.529 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/stutech/tomcat/webapps/host-manager has finished in 30 ms
19-Oct-2015 04:47:24.533 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/stutech/tomcat/webapps/ROOT
19-Oct-2015 04:47:24.567 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/stutech/tomcat/webapps/ROOT has finished in 33 ms
19-Oct-2015 04:47:24.567 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/stutech/tomcat/webapps/manager
19-Oct-2015 04:47:24.626 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /home/stutech/tomcat/webapps/manager has finished in 59 ms
19-Oct-2015 04:47:24.641 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
19-Oct-2015 04:47:24.656 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
19-Oct-2015 04:47:24.660 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 2863 ms
Caused by: java.lang.IllegalArgumentException: The servlets named
[register] and [com.whiteboard.servlet.register] are both mapped to
the url-pattern [/register] which is not permitted
This Error clearly states that same url-mapping is mapped to two Servlets.
Modify your web.xml and you are good to go.
Related
I have a tomcat server running on DigitalOcean VPS. The server.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
I edited the <Connector> part to make the server run on port 80 instead of 8080. Before the changes I could access the server using IP:8080 address, but now I can't access it at all - whether I use IP:8080 or IP:80 or IP.
I restarted my tomcat using shutdown.sh and startup.sh and restarted my droplet using sudo reboot, but it changed nothing.
I checked the firewall using sudo ufw status verbose and it gave an inactive status.
EDIT:
I tried the shutdown.sh -> startup.sh -> sudo reboot route again and here is the catalina.out since the shutdown.sh command:
28-Oct-2018 11:40:10.377 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
28-Oct-2018 11:40:10.378 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:10.380 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:10.442 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
28-Oct-2018 11:40:10.494 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:10.495 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:10.498 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:10.498 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:14.691 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.12
28-Oct-2018 11:40:14.697 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 4 2018 22:13:41 UTC
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.12.0
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-138-generic
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcat
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
28-Oct-2018 11:40:14.707 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
28-Oct-2018 11:40:14.707 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Oct-2018 11:40:14.707 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
28-Oct-2018 11:40:14.709 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
28-Oct-2018 11:40:14.709 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
28-Oct-2018 11:40:14.709 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: [/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
28-Oct-2018 11:40:14.857 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:14.887 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Oct-2018 11:40:14.900 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:14.907 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Oct-2018 11:40:14.908 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 896 ms
28-Oct-2018 11:40:14.958 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
28-Oct-2018 11:40:14.962 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.12
28-Oct-2018 11:40:14.980 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /opt/tomcat/logs/manager.2018-10-28.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:495)
at org.apache.juli.FileHandler.<init>(FileHandler.java:168)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:82)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:602)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:538)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:336)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at java.util.logging.Logger.demandLogger(Logger.java:448)
at java.util.logging.Logger.getLogger(Logger.java:502)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:61)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:181)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /opt/tomcat/logs/host-manager.2018-10-28.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:495)
at org.apache.juli.FileHandler.<init>(FileHandler.java:168)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:82)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:602)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:538)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:336)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at java.util.logging.Logger.demandLogger(Logger.java:448)
at java.util.logging.Logger.getLogger(Logger.java:502)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:61)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:181)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
28-Oct-2018 11:40:31.547 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.12
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 4 2018 22:13:41 UTC
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.12.0
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-138-generic
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcat
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
28-Oct-2018 11:40:31.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Oct-2018 11:40:31.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
28-Oct-2018 11:40:31.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
28-Oct-2018 11:40:31.560 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
28-Oct-2018 11:40:31.560 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
28-Oct-2018 11:40:31.560 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx600M
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
28-Oct-2018 11:40:31.562 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
28-Oct-2018 11:40:31.562 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
28-Oct-2018 11:40:31.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
28-Oct-2018 11:40:31.563 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: [/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
28-Oct-2018 11:40:31.727 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:31.751 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-80]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:935)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:533)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
at org.apache.catalina.startup.Catalina.load(Catalina.java:656)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:236)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1044)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:932)
... 13 more
28-Oct-2018 11:40:31.753 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:31.765 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Oct-2018 11:40:31.788 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1791 ms
28-Oct-2018 11:40:31.843 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
28-Oct-2018 11:40:31.844 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.12
28-Oct-2018 11:40:31.852 SEVERE [main] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/tomcat/conf/Catalina/localhost]
28-Oct-2018 11:40:31.858 SEVERE [main] org.apache.catalina.valves.AccessLogValve.open Failed to open access log file [/opt/tomcat/logs/localhost_access_log.2018-10-28.txt]
java.io.FileNotFoundException: /opt/tomcat/logs/localhost_access_log.2018-10-28.txt (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:651)
at org.apache.catalina.valves.AccessLogValve.startInternal(AccessLogValve.java:685)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:965)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
28-Oct-2018 11:40:31.863 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
28-Oct-2018 11:40:32.472 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [608] ms
28-Oct-2018 11:40:32.472 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
28-Oct-2018 11:40:32.543 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [70] ms
28-Oct-2018 11:40:32.544 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
28-Oct-2018 11:40:32.590 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [46] ms
28-Oct-2018 11:40:32.595 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/Test]
28-Oct-2018 11:40:32.644 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/Test] has finished in [50] ms
28-Oct-2018 11:40:32.645 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/RedditDesk]
28-Oct-2018 11:40:32.681 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/RedditDesk] has finished in [36] ms
28-Oct-2018 11:40:32.681 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
28-Oct-2018 11:40:32.723 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [42] ms
28-Oct-2018 11:40:32.724 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
28-Oct-2018 11:40:33.158 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [434] ms
28-Oct-2018 11:40:33.165 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:33.196 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1408 ms
With help of #ernest_k I managed to find the problem. The problem was that the port was never truly changed from 8080 to 80. It happened because although I was connected as a root user to the VPS, the tomcat automatically switched to non-root user tomcat, because of /etc/systemd/system/tomcat.service file:
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
So I changed a User=tomcat to User=root, restarted everything and now it works fine!
port no 1 to 1023 is reserved for the system use may be because of that you are not able to change the port no to 80.
I am trying to deploy a web app manually on Tomcat.
I have created a "myapp" folder in webapps folder with following files and folders:-
1) myapp\WEB-INF\index.html
2) myapp\WEB-INF\classes
3) myapp\WEB-INF\lib
4) myapp\WEB-INF\myapp-servlet.xml
5) myapp\WEB-INF\web.html
But I am getting the following exception :-
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I linked my classes folder in tomcat and rest of the files I just copy pasted. I was able to run this like some time back. But I am not getting what i am missing. Is it build.xml? Thanks!
Update 1:-
05-Mar-2018 16:18:51.089 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.28
05-Mar-2018 16:18:51.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 6 2018 23:10:25 UTC
05-Mar-2018 16:18:51.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.28.0
05-Mar-2018 16:18:51.093 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
05-Mar-2018 16:18:51.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
05-Mar-2018 16:18:51.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
05-Mar-2018 16:18:51.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_161\jre
05-Mar-2018 16:18:51.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_161-b12
05-Mar-2018 16:18:51.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
05-Mar-2018 16:18:51.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28
05-Mar-2018 16:18:51.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28
05-Mar-2018 16:18:51.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\conf\logging.properties
05-Mar-2018 16:18:51.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
05-Mar-2018 16:18:51.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
05-Mar-2018 16:18:51.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
05-Mar-2018 16:18:51.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=localhost:8000,server=y,suspend=n
05-Mar-2018 16:18:51.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
05-Mar-2018 16:18:51.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28
05-Mar-2018 16:18:51.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28
05-Mar-2018 16:18:51.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\temp
05-Mar-2018 16:18:51.097 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].
05-Mar-2018 16:18:51.097 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
05-Mar-2018 16:18:51.097 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
05-Mar-2018 16:18:52.219 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017]
05-Mar-2018 16:18:52.442 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
05-Mar-2018 16:18:52.801 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Mar-2018 16:18:52.826 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
05-Mar-2018 16:18:52.831 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Mar-2018 16:18:52.833 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2489 ms
05-Mar-2018 16:18:52.872 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
05-Mar-2018 16:18:52.872 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.28
05-Mar-2018 16:18:52.890 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\docs]
05-Mar-2018 16:18:53.476 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\docs] has finished in [586] ms
05-Mar-2018 16:18:53.478 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\examples]
05-Mar-2018 16:18:54.474 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\examples] has finished in [997] ms
05-Mar-2018 16:18:54.475 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\host-manager]
05-Mar-2018 16:18:54.528 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\host-manager] has finished in [54] ms
05-Mar-2018 16:18:54.529 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\myapp]
05-Mar-2018 16:18:54.623 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot#5323bab5]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4868)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5003)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#3cbf78d5]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:113)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:724)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 13 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:142)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
... 16 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.misc.IOUtils.readFully(IOUtils.java:65)
at java.util.jar.JarFile.getBytes(JarFile.java:425)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
... 17 more
05-Mar-2018 16:18:54.627 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\myapp]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Update 2:-
Adding POM.xml now I am getting following exception
05-Mar-2018 16:33:41.240 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name [myapp]
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3155)
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3145)
at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1375)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1189)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:774)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5113)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
05-Mar-2018 16:33:41.242 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory [C:\Software Applications\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\myapp]
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/myapp]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1141)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
You can start by cheking if you are using jdk path for the runtime enviroments, you must use jre path. Make sure that tomcat uses the same java version as your application.
Based on previous answer I did following things :-
1) Added pom.xml instead of lib folder
2) Changed the servlet name in the web.xml
Deployed the above web app successfully on tomcat.
Update :
It's not pom.xml that makes tomcat fail but some jars that conflicts with tomcat lib on removing those everything is fine.
I created new web application project in NetBeans with Tomcat as the server. But, when I run the project, I get the BUILD FAILED error. But deploying the web app by copying it into tomcat webapps/ directory works.
The web application netbeans log is as follows:
ant -f "D:\\Harsha Vardhan\\Documents\\My Projects\\Web Projects\\TestApplication" -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dnb.wait.for.caches=true "-Dbrowser.context=D:\\Harsha Vardhan\\Documents\\My Projects\\Web Projects\\TestApplication" run
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
In-place deployment at D:\Harsha Vardhan\Documents\My Projects\Web Projects\TestApplication\build\web
Deployment is in progress...
deploy?config=file%3A%2FC%3A%2FUsers%2FHarsha%2520Vardhan%2FAppData%2FLocal%2FTemp%2Fcontext2833876915741210914.xml&path=/TestApplication
FAIL - Failed to deploy application at context path [/TestApplication]
D:\Harsha Vardhan\Documents\My Projects\Web Projects\TestApplication\nbproject\build-impl.xml:1045: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 8 seconds)
The Tomcat server log is as follows:
Using CATALINA_BASE: "C:\Apache\Tomcat 8.5"
Using CATALINA_HOME: "C:\Apache\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Apache\Tomcat 8.5\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_152"
Using CLASSPATH: "C:\Apache\Tomcat 8.5\bin\bootstrap.jar;C:\Apache\Tomcat 8.5\bin\tomcat-juli.jar"
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.23
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 28 2017 10:30:11 UTC
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.23.0
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_152\jre
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_152-b16
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Apache\Tomcat 8.5
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Apache\Tomcat 8.5
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Apache\Tomcat 8.5\conf\logging.properties
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|DESKTOP-i7559
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Apache\Tomcat 8.5
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Apache\Tomcat 8.5
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Apache\Tomcat 8.5\temp
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.14] using APR version [1.6.2].
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
12-Nov-2017 19:17:36.800 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
12-Nov-2017 19:17:37.363 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2l 25 May 2017]
12-Nov-2017 19:17:37.503 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
12-Nov-2017 19:17:37.628 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Nov-2017 19:17:37.628 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
12-Nov-2017 19:17:37.628 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Nov-2017 19:17:37.628 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1158 ms
12-Nov-2017 19:17:37.660 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
12-Nov-2017 19:17:37.660 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.23
12-Nov-2017 19:17:37.660 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Apache\Tomcat 8.5\webapps\docs]
12-Nov-2017 19:17:37.910 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Apache\Tomcat 8.5\webapps\docs] has finished in [250] ms
12-Nov-2017 19:17:37.910 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Apache\Tomcat 8.5\webapps\examples]
12-Nov-2017 19:17:38.816 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Apache\Tomcat 8.5\webapps\examples] has finished in [906] ms
12-Nov-2017 19:17:38.832 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Apache\Tomcat 8.5\webapps\host-manager]
12-Nov-2017 19:17:38.863 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Apache\Tomcat 8.5\webapps\host-manager] has finished in [31] ms
12-Nov-2017 19:17:38.863 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Apache\Tomcat 8.5\webapps\manager]
12-Nov-2017 19:17:38.894 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Apache\Tomcat 8.5\webapps\manager] has finished in [31] ms
12-Nov-2017 19:17:38.894 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Apache\Tomcat 8.5\webapps\ROOT]
12-Nov-2017 19:17:38.910 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Apache\Tomcat 8.5\webapps\ROOT] has finished in [16] ms
12-Nov-2017 19:17:38.910 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
12-Nov-2017 19:17:38.925 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
12-Nov-2017 19:17:38.925 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1293 ms
java.io.FileNotFoundException: C:\Users\Harsha%20Vardhan\AppData\Local\Temp\context2833876915741210914.xml (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.apache.catalina.manager.ManagerServlet.copyInternal(ManagerServlet.java:1673)
at org.apache.catalina.manager.ManagerServlet.copy(ManagerServlet.java:1635)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:889)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:338)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:595)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:348)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:52)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Note: Assuming that permissions were a problem, I started netbeans as admin. But, it threw the same error. I even changed the permission for Tomcat_8.5/ directory to full control to the user, But NetBeans kept throwing the same error.
I'm trying to configure Tomcat 8.5 on Intellij Idea Ultimate.
I installed it in /opt/tomcat/apache-tomcat-8.5.11. I'm using Ubuntu.
When I run the project I have these output:
`/opt/tomcat/apache-tomcat-8.5.11/bin/catalina.sh run
[2017-02-05 02:40:12,566] Artifact Spring1:war exploded: Server is not connected. Deploy is not available.
05-Feb-2017 14:40:13.144 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.11
05-Feb-2017 14:40:13.146 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 2017 21:02:52 UTC
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.11.0
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-62-generic
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-oracle/jre
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_121-b13
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /home/marcel/.IntelliJIdea2016.3/system/tomcat/Unnamed_Spring1
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat/apache-tomcat-8.5.11
05-Feb-2017 14:40:13.147 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/marcel/.IntelliJIdea2016.3/system/tomcat/Unnamed_Spring1/conf/logging.properties
05-Feb-2017 14:40:13.148 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
05-Feb-2017 14:40:13.148 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
05-Feb-2017 14:40:13.148 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
05-Feb-2017 14:40:13.148 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
05-Feb-2017 14:40:13.148 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
05-Feb-2017 14:40:13.148 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
05-Feb-2017 14:40:13.150 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
05-Feb-2017 14:40:13.151 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
05-Feb-2017 14:40:13.151 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/marcel/.IntelliJIdea2016.3/system/tomcat/Unnamed_Spring1
05-Feb-2017 14:40:13.151 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat/apache-tomcat-8.5.11
05-Feb-2017 14:40:13.151 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/apache-tomcat-8.5.11/temp
05-Feb-2017 14:40:13.151 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: /home/marcel/.local/share/umake/ide/idea-ultimate/bin::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
05-Feb-2017 14:40:13.270 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
05-Feb-2017 14:40:13.284 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Feb-2017 14:40:13.286 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
05-Feb-2017 14:40:13.287 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Feb-2017 14:40:13.287 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 415 ms
05-Feb-2017 14:40:13.321 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
05-Feb-2017 14:40:13.321 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.11
05-Feb-2017 14:40:13.328 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
05-Feb-2017 14:40:13.333 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009]
05-Feb-2017 14:40:13.334 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 46 ms
Connected to server
[2017-02-05 02:40:13,677] Artifact Spring1:war exploded: Artifact is being deployed, please wait...
05-Feb-2017 14:40:13.940 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
05-Feb-2017 14:40:13.950 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
[2017-02-05 02:40:13,964] Artifact Spring1:war exploded: Error during artifact deployment. See server log for details.
05-Feb-2017 14:40:23.329 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/host-manager
05-Feb-2017 14:40:23.388 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/host-manager has finished in 58 ms
05-Feb-2017 14:40:23.388 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/examples
05-Feb-2017 14:40:23.609 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/examples has finished in 221 ms
05-Feb-2017 14:40:23.610 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/docs
05-Feb-2017 14:40:23.624 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/docs has finished in 15 ms
05-Feb-2017 14:40:23.624 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/manager
05-Feb-2017 14:40:23.641 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/apache-tomcat-8.5.11/webapps/manager has finished in 17 ms
`
I'm using the following configuration in IDEA :
http://imgur.com/nYT2i7T
http://imgur.com/PgGfmh2
I tried to follow Tomcat in Idea. war exploded: Server is not connected. Deploy is not available but Tomcat 8.5 bin there's no setenv.sh .
Thanks for help.
I've a Spring Messaging app that I've developed inside of eclipse using a local instance of Tomcat 8. This works perfectly fine from inside eclipse, however when I create a war and deploy it inside the webapps directory of Tomcat it doesn't work.
These are the steps that I've done till now.
I'm using a gradle build system, on a windows machine. Thus I ran gradlew build.
This generated a war file inside root/build/lib
I went to the bin directory of my local tomcat and ran start.bat
This set Tomcat running, then I copied the war to the webapps directory of tomcat.
All I get is a 404.
This is my catalina.log
07-Sep-2016 10:32:21.857 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.36
07-Sep-2016 10:32:21.858 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 9 2016 13:55:50 UTC
07-Sep-2016 10:32:21.859 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.36.0
07-Sep-2016 10:32:21.859 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 8.1
07-Sep-2016 10:32:21.859 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.3
07-Sep-2016 10:32:21.859 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
07-Sep-2016 10:32:21.859 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_91\jre
07-Sep-2016 10:32:21.859 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_91-b14
07-Sep-2016 10:32:21.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
07-Sep-2016 10:32:21.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Tomcat\v8\apache-tomcat-8.0.36
07-Sep-2016 10:32:21.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Tomcat\v8\apache-tomcat-8.0.36
07-Sep-2016 10:32:21.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
07-Sep-2016 10:32:21.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Tomcat\v8\apache-tomcat-8.0.36\conf\logging.properties
07-Sep-2016 10:32:21.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
07-Sep-2016 10:32:21.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=C:\Tomcat\v8\apache-tomcat-8.0.36\endorsed
07-Sep-2016 10:32:21.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Tomcat\v8\apache-tomcat-8.0.36
07-Sep-2016 10:32:21.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Tomcat\v8\apache-tomcat-8.0.36
07-Sep-2016 10:32:21.862 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Tomcat\v8\apache-tomcat-8.0.36\temp
07-Sep-2016 10:32:21.862 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_91\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\AccuRev\bin;C:\common;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;%MAVEN_HOME/bin%;C:\Program Files\Apache\apache-maven-3.3.9\bin;C:\Dev\gradle-2.13\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Users\SG047329\AppData\Roaming\npm;.
07-Sep-2016 10:32:22.029 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
07-Sep-2016 10:32:22.094 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
07-Sep-2016 10:32:22.096 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
07-Sep-2016 10:32:22.104 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
07-Sep-2016 10:32:22.105 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 524 ms
07-Sep-2016 10:32:22.130 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
07-Sep-2016 10:32:22.130 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.36
07-Sep-2016 10:32:22.223 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\opl-ws-webui-0.1.0.war
07-Sep-2016 10:32:29.090 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
07-Sep-2016 10:32:33.793 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\opl-ws-webui-0.1.0.war has finished in 11,570 ms
07-Sep-2016 10:32:33.795 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\docs
07-Sep-2016 10:32:33.826 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\docs has finished in 30 ms
07-Sep-2016 10:32:33.826 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\examples
07-Sep-2016 10:32:34.734 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\examples has finished in 908 ms
07-Sep-2016 10:32:34.735 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\host-manager
07-Sep-2016 10:32:34.775 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\host-manager has finished in 40 ms
07-Sep-2016 10:32:34.776 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\manager
07-Sep-2016 10:32:34.811 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\manager has finished in 35 ms
07-Sep-2016 10:32:34.811 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\ROOT
07-Sep-2016 10:32:34.835 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Tomcat\v8\apache-tomcat-8.0.36\webapps\ROOT has finished in 24 ms
07-Sep-2016 10:32:34.839 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
07-Sep-2016 10:32:34.856 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
07-Sep-2016 10:32:34.871 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 12765 ms
I've a few questions here,
How do I deploy the war and get it to run inside Tomcat.
When I run inside eclipse, I don't see any war actually being created inside build/lib, so how is eclipse using Tomcat to run my webapp anyway?
1.- Actually the way yo start a clean Tomcat instance is:
Stop Tomcat Server
Clean logs, temp and work folders
Copy your .war file to the webapps folder
Start Tomcat
If this process does not work you can see the files generated in the tomcat logs files to see why this is not starting
2.- Eclipse as well as other IDE's like IDEA use directly the webapp, build folder of your application, not the .war file.
The war file contains inside this webapp folder which is unzipped when you start just tomcat.