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.
Related
My war application deployed on aws elasticbeanstalk doesn't write any logs.
I have the same problem like Logs not working on Elastic Beanstalk Tomcat environment. For tests and simplification I deployed a new empty war project generated from Spring framework Initializr (https://start.spring.io/) built by maven on OpenJDK Java11 to Tomcat 8.5 with Corretto 11 running on 64bit Amazon Linux 2/4.1.1.
I use slf4j logger.
And some info level logs records. On localhost works fine.
On aws elb is /var/log/tomcat/catalina.2020-11-05.log log file and after start I can see only this logs :
05-Nov-2020 10:48:37.902 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.56
05-Nov-2020 10:48:37.906 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 23 2020 17:39:13 UTC
05-Nov-2020 10:48:37.907 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.56.0
05-Nov-2020 10:48:37.907 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
05-Nov-2020 10:48:37.908 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.14.192-147.314.amzn2.x86_64
05-Nov-2020 10:48:37.908 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
05-Nov-2020 10:48:37.911 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-11-amazon-corretto.x86_64
05-Nov-2020 10:48:37.913 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 11.0.8+10-LTS
05-Nov-2020 10:48:37.914 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Amazon.com Inc.
05-Nov-2020 10:48:37.914 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/share/tomcat
05-Nov-2020 10:48:37.914 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/share/tomcat
05-Nov-2020 10:48:37.914 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
05-Nov-2020 10:48:38.025 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
05-Nov-2020 10:48:38.078 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Nov-2020 10:48:38.118 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1766 ms
05-Nov-2020 10:48:38.261 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
05-Nov-2020 10:48:38.263 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.56
05-Nov-2020 10:48:38.289 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat/webapps/ROOT]
05-Nov-2020 10:48:38.738 WARNING [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used.
05-Nov-2020 10:48:41.253 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.
05-Nov-2020 10:48:41.544 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/lib/tomcat/webapps/ROOT] has finished in [3,252] ms
05-Nov-2020 10:48:41.552 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
05-Nov-2020 10:48:41.586 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 3467 ms
There is missing my info logs or any other springboot logs from my app.
In previous versions of ELB on java 1.8 it works fine. What has been changed?
How can I turn on logging again?
This was problem in our java spring application. Wrong devel configuration.
In application.properties was this line
logging.file.name=log/synchronization.log
I didn't notice that at first sight. In application-production.properties wasn't anything about logging therefore this configuration affected production, and all logs was written to this file (wrong path because on aws eb(tomcat) is directory for logging logs/ not log/). That's why I cannot see logs on standard log path less /var/log/tomcat/
I changed in application-production.properties to
logging.file.name=logs/my-app.log
and that is. It works now.
I am going to use Jenkins to execute the project automatically. The project is uploaded to github and succeeded in building War files using Jenkins. War file were moved to Tomcat's Webapps file, and Tomcat built it, but Tomcat runs properly, but projects don't run the project.
Setting
init_server.sh
echo "> Check the currently running spring server pid "
CURRENT_PID=$(ps -ef | grep java | grep tomcat | awk '{print $2}')
echo "$CURRENT_PID"
if [ -z $CURRENT_PID ]; then
echo "> No applications are currently running and will not be shut down."
else
echo "> kill -9 $CURRENT_PID"
kill -9 $CURRENT_PID
sleep 10
fi
rm -rf /usr/local/tomcat9/webapps/ji**t /usr/local/tomcat9/webapps/ji**t .war
echo nohup mv /root/jenkinsproject/deploy/*.war /usr/local/tomcat9/webapps/jinheeproject.war >> /root/jenkinsproject/logs/springtestprojectSys.log &
mv /root/jenkinsproject/deploy/*.war /usr/local/tomcat9/webapps/ji**t.war
sleep 10
cd /usr/local/tomcat9/bin
./startup.sh
echo "Execution complete."
application.yml
Run build in Jenkins, Follow the instructions in the Shell file, turn off the old Tomcat, and run the new Tomcat. And I type 'serverIP:8080' and the Tomcat server starts. But if I type 'serverIP:8080/helloworld', I see 404 error.
NOTE: I tested my project in the local environment. It was successful.
example: localhost:8080/helloworld
server.xml in cloud server
<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" />
<Context path="" docBase="ji**t" reloadable="false" />
</Host>
my catalina logs
03-Mar-2020 16:55:23.226 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.31
03-Mar-2020 16:55:23.229 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 5 2020 19:32:12 UTC
03-Mar-2020 16:55:23.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.31.0
03-Mar-2020 16:55:23.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
03-Mar-2020 16:55:23.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-59-generic
03-Mar-2020 16:55:23.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
03-Mar-2020 16:55:23.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
03-Mar-2020 16:55:23.231 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
03-Mar-2020 16:55:23.231 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Private Build
03-Mar-2020 16:55:23.232 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat9
03-Mar-2020 16:55:23.232 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat9
03-Mar-2020 16:55:23.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat9/conf/logging.properties
03-Mar-2020 16:55:23.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
03-Mar-2020 16:55:23.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
03-Mar-2020 16:55:23.233 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
03-Mar-2020 16:55:23.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
03-Mar-2020 16:55:23.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
03-Mar-2020 16:55:23.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat9
03-Mar-2020 16:55:23.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat9
03-Mar-2020 16:55:23.235 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat9/temp
03-Mar-2020 16:55:23.235 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]
03-Mar-2020 16:55:23.451 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
03-Mar-2020 16:55:23.498 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [518] milliseconds
03-Mar-2020 16:55:23.528 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
03-Mar-2020 16:55:23.528 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.31]
03-Mar-2020 16:55:27.202 INFO [main] 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.
03-Mar-2020 16:55:27.296 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/host-manager]
03-Mar-2020 16:55:27.328 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/host-manager] has finished in [31] ms
03-Mar-2020 16:55:27.328 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/manager]
03-Mar-2020 16:55:27.352 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/manager] has finished in [24] ms
03-Mar-2020 16:55:27.352 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/ROOTBEFORE]
03-Mar-2020 16:55:27.365 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/ROOTBEFORE] has finished in [12] ms
03-Mar-2020 16:55:27.365 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat9/webapps/docs]
03-Mar-2020 16:55:27.379 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat9/webapps/docs] has finished in [14] ms
03-Mar-2020 16:55:27.383 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
03-Mar-2020 16:55:27.391 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [3,892] milliseconds
There was something I was missing. I forgot to inherit SpringBootServletInitializer and set it up.
application.java
#SpringBootApplication
public class Application extends SpringBootServletInitializer {
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
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.
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.