Spring App is not running from Intellij with Tomcat Server - java

If I run my spring app from Intellij with Tomcat Server it gives me:
HTTP Status 404 – Not Found
Type Status Report
Message The requested resource [/] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/9.0.52
But If I put my app.war in tomcat/webapps/ as ROOT.war it works perfectly.
I have problems only when try to run from Intellij
This is the configuration:
This is the deployment:
And this is the output:
C:\apache-tomcat-9.0.52\bin\catalina.bat run
[2021-08-24 02:50:39,974] Artifact myappname:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\Main\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\f74e8856-a9b4-4e50-9d59-c901731f3dc7"
Using CATALINA_HOME: "C:\apache-tomcat-9.0.52"
Using CATALINA_TMPDIR: "C:\apache-tomcat-9.0.52\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk-10.0.2"
Using CLASSPATH: "C:\apache-tomcat-9.0.52\bin\bootstrap.jar;C:\apache-tomcat-9.0.52\bin\tomcat-juli.jar"
Using CATALINA_OPTS: ""
24-Aug-2021 14:50:40.602 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.52
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jul 31 2021 04:12:17 UTC
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.52.0
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-10.0.2
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 10.0.2+13
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: "Oracle Corporation"
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Main\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\f74e8856-a9b4-4e50-9d59-c901731f3dc7
24-Aug-2021 14:50:40.603 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\apache-tomcat-9.0.52
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Main\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\f74e8856-a9b4-4e50-9d59-c901731f3dc7\conf\logging.properties
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
24-Aug-2021 14:50:40.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\Main\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\f74e8856-a9b4-4e50-9d59-c901731f3dc7\jmxremote.password
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\Main\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\f74e8856-a9b4-4e50-9d59-c901731f3dc7\jmxremote.access
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Main\AppData\Local\JetBrains\IntelliJIdea2021.2\tomcat\f74e8856-a9b4-4e50-9d59-c901731f3dc7
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\apache-tomcat-9.0.52
24-Aug-2021 14:50:40.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\apache-tomcat-9.0.52\temp
24-Aug-2021 14:50:40.607 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.30] using APR version [1.7.0].
24-Aug-2021 14:50:40.607 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
24-Aug-2021 14:50:40.607 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
24-Aug-2021 14:50:40.610 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1k 25 Mar 2021]
24-Aug-2021 14:50:40.750 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
24-Aug-2021 14:50:40.763 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [279] milliseconds
24-Aug-2021 14:50:40.804 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Aug-2021 14:50:40.804 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.52]
24-Aug-2021 14:50:40.812 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
24-Aug-2021 14:50:40.823 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [59] milliseconds
Connected to server
[2021-08-24 02:50:41,210] Artifact myappname:war exploded: Artifact is being deployed, please wait...
24-Aug-2021 14:50:45.369 INFO [RMI TCP Connection(3)-127.0.0.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.
[2021-08-24 02:50:45,523] Artifact myappname:war exploded: Artifact is deployed successfully
[2021-08-24 02:50:45,523] Artifact myappname:war exploded: Deploy took 4,313 milliseconds
24-Aug-2021 14:50:50.816 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\apache-tomcat-9.0.52\webapps\manager]
24-Aug-2021 14:50:50.851 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\apache-tomcat-9.0.52\webapps\manager] has finished in [35] ms
I want to run my app from the root: localhost:8080/.
Why I receive 404 - Not Found from Tomcat? And how to fix it?
If you need more details please tell me.
Version of Intellij IDEA: 2021.2 Ultimate Edition
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.5.3</version>
</dependency>
P.S.: I think something is not deployed right. Because after deploy, in console don't appears that big SPRING logo and logs about initializing. Or this is not necessarily?

I found the solution for my problem.
My problem was solved by removing everything from Run/Debug Configuration -> Before Launch
Also instead of what was there I added maven clean install command.

Related

docker 404 error. Tomcat - The origin server did not find a current representation for the target

I need to collect simple spring application on Tomcat in docker container, but when i try to localhost:8080 i get :
404 Type Status Report
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Dockerfile:
FROM tomcat:latest
COPY target/internship_project.war /usr/local/tomcat/webapps/
EXPOSE 8080
CMD ["catalina.sh", "run"]
docker build -t application .
docker run --rm -it -p 8080:8080 application
Log:
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/openjdk-11
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
25-Jan-2022 09:36:25.829 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/10.0.16
25-Jan-2022 09:36:25.832 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 15 2022 13:19:56 UTC
25-Jan-2022 09:36:25.832 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.0.16.0
25-Jan-2022 09:36:25.832 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
25-Jan-2022 09:36:25.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.10.16.3-microsoft-standard-WSL2
25-Jan-2022 09:36:25.833 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
25-Jan-2022 09:36:25.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/local/openjdk-11
25-Jan-2022 09:36:25.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 11.0.13+8
25-Jan-2022 09:36:25.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
25-Jan-2022 09:36:25.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
25-Jan-2022 09:36:25.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
25-Jan-2022 09:36:25.848 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
25-Jan-2022 09:36:25.849 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
25-Jan-2022 09:36:25.849 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
25-Jan-2022 09:36:25.849 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
25-Jan-2022 09:36:25.849 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
25-Jan-2022 09:36:25.849 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
25-Jan-2022 09:36:25.849 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
25-Jan-2022 09:36:25.850 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
25-Jan-2022 09:36:25.855 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.31] using APR version [1.7.0].
25-Jan-2022 09:36:25.855 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
25-Jan-2022 09:36:25.857 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1k 25 Mar 2021]
25-Jan-2022 09:36:26.137 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
25-Jan-2022 09:36:26.162 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [475] milliseconds
25-Jan-2022 09:36:26.212 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
25-Jan-2022 09:36:26.213 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.0.16]
25-Jan-2022 09:36:26.228 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/internship_project.war]
25-Jan-2022 09:36:28.062 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.
25-Jan-2022 09:36:28.109 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/internship_project.war] has finished in [1,880] ms
25-Jan-2022 09:36:28.118 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]25-Jan-2022 09:36:28.131 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [1968] milliseconds
I tried to: localhost:8080/internship_project , but got:
Type Status Report
Message The requested resource [/internship_project/] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Also i tried to : localhost:8080/internship_project_war and got the same.
Any ideas how to fix that?
Try doing this
docker pull tomcat:latest
docker run -d --name mytomcat -p 8080:8080 tomcat:latest
docker exec -it mytomcat /bin/bash
mv webapps webapps2
mv webapps.dist/ webapps
exit

Spring boot deploy as ROOT in tomcat stuck at deploying

I have issue while deploying my Spring boot application in Linux server.
I built the project as war file and renamed it to ROOT.war.
After placing the ROOT.war in webapps folder and starting tomcat service, It got stuck at this stage and nothing happens.
09-Jan-2019 09:27:10.503 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/home/tomcat/webapps/ROOT.war]
I checked possible solution over web and also added the -Djava.security.egd=file:/dev/./urandom property.
I got dump from the jstack. But I am not able to understand what could be the issue here.
Here is the output after I started the tomcat server
09-Jan-2019 09:26:51.998 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.35
09-Jan-2019 09:26:52.001 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Nov 3 2018 17:39:20 UTC
09-Jan-2019 09:26:52.002 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.35.0
09-Jan-2019 09:26:52.002 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
09-Jan-2019 09:26:52.003 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.0-862.11.6.el7.x86_64
09-Jan-2019 09:26:52.003 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
09-Jan-2019 09:26:52.003 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/java/jdk1.8.0_191-amd64/jre
09-Jan-2019 09:26:52.004 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_191-b12
09-Jan-2019 09:26:52.004 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
09-Jan-2019 09:26:52.004 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /home/tomcat
09-Jan-2019 09:26:52.004 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /home/tomcat
09-Jan-2019 09:26:52.005 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/tomcat/conf/logging.properties
09-Jan-2019 09:26:52.005 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-Jan-2019 09:26:52.007 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
09-Jan-2019 09:26:52.007 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
09-Jan-2019 09:26:52.008 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
09-Jan-2019 09:26:52.008 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
09-Jan-2019 09:26:52.008 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
09-Jan-2019 09:26:52.008 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
09-Jan-2019 09:26:52.008 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
09-Jan-2019 09:26:52.009 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024M
09-Jan-2019 09:26:52.009 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
09-Jan-2019 09:26:52.009 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
09-Jan-2019 09:26:52.010 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/tomcat
09-Jan-2019 09:26:52.010 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/home/tomcat
09-Jan-2019 09:26:52.011 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/home/tomcat/temp
09-Jan-2019 09:26:52.011 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/lib64:/lib64:/lib:/usr/lib]
09-Jan-2019 09:27:00.000 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
09-Jan-2019 09:27:00.595 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Jan-2019 09:27:01.317 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
09-Jan-2019 09:27:01.576 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Jan-2019 09:27:01.577 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 31920 ms
09-Jan-2019 09:27:06.322 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
09-Jan-2019 09:27:06.322 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.35
09-Jan-2019 09:27:10.503 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/home/tomcat/webapps/ROOT.war]
For jstack logs, Please check here https://textuploader.com/1aoh0
UPDATE
<build> from pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
I don't think this is anywhere related to running the war file as ROOT. You should be able to fix this issue by making one small change in catalina.sh
Open catalina.sh file in the bin folder of Tomcat.
Search for JAVA_OPTS and add the following,
-Djava.security.egd=file:/dev/./urandom
Eg:, JAVA_OPTS="$JAVA_OPTS -Djava.security.egd=file:/dev/./urandom"
Save catalina.sh and restart tomcat.
Hopefully you should not face the same issue now.

Tomcat 8.5.31 stuck while deploying the war

We are migrating our application from tomcat 7 to tomcat 8. All wars are deploying successfully in tomcat 8. But only one war is not deploying. Tomcat 8 starts deploying the war and then stuck there. No logs are printing in Catalina.out and Error.log.
Please find below logs.
23-May-2018 04:14:55.314 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.31
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Apr 27 2018 20:24:25 UTC
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.31.0
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.0-693.21.1.el7.x86_64
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/java/jdk1.8.0_60/jre
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_60-b27
23-May-2018 04:14:55.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/apache-tomcat-8.5.31
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/apache-tomcat-8.5.31
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
23-May-2018 04:14:55.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
23-May-2018 04:14:55.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
23-May-2018 04:14:55.330 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/lib64:/lib64:/lib:/usr/lib]
23-May-2018 04:14:55.644 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
23-May-2018 04:14:55.675 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-May-2018 04:14:55.706 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
23-May-2018 04:14:55.708 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-May-2018 04:14:55.720 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1282 ms
23-May-2018 04:14:55.755 WARNING [main] org.apache.tomcat.jdbc.pool.ConnectionPool.checkPoolConfiguration maxIdle is smaller than minIdle, setting maxIdle to: 5
23-May-2018 04:14:57.653 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
23-May-2018 04:14:57.654 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.31
23-May-2018 04:14:57.711 INFO [localhost-startStop-1] **org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/apache-tomcat-8.5.31/webapps/llas.war]**
This is last line in Catalina.out.
In case you still need help.
If you are using a VM, try to set Djava.security.egd=file:/dev/./urandomns in the file setenv.sh
source:
https://serverfault.com/questions/658502/tomcat-8-hangs-on-startup-while-deploying-webapp-possibly-related-to-entropy-ge?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

NetBeans can not start Tomcat on mac

I am trying to run Tomcat using NetBeans on Mac. When I execute startup.sh in bin folder and then access http://localhost:8080 everything looks great. Then I tried running my JAVA project in NetBeans, but it said that port 8080 is already in use. So I found which process is running on this port using lsof -i :8080 and killed it (or executed shutdown.sh in bin folder, it is the same).
Then I tried to run my project in NetBeans and after over 3 minutes of waiting it says this
.../WebApplication/nbproject/build-impl.xml:1045: Deployment error: Starting of Tomcat failed.
There is log:
09-Feb-2018 01:07:06.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.4
09-Feb-2018 01:07:06.196 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 18 2018 19:42:17 UTC
09-Feb-2018 01:07:06.199 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.4.0
09-Feb-2018 01:07:06.200 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
09-Feb-2018 01:07:06.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.13.1
09-Feb-2018 01:07:06.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
09-Feb-2018 01:07:06.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/jre
09-Feb-2018 01:07:06.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_161-b12
09-Feb-2018 01:07:06.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
09-Feb-2018 01:07:06.201 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4
09-Feb-2018 01:07:06.202 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /Users/patrikbujna/lib/apache-tomcat-9.0.4
09-Feb-2018 01:07:06.203 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4/conf/logging.properties
09-Feb-2018 01:07:06.203 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-Feb-2018 01:07:06.203 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|Patriks-MacBook-Pro.local
09-Feb-2018 01:07:06.204 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
09-Feb-2018 01:07:06.204 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
09-Feb-2018 01:07:06.205 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
09-Feb-2018 01:07:06.206 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4
09-Feb-2018 01:07:06.207 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Users/patrikbujna/lib/apache-tomcat-9.0.4
09-Feb-2018 01:07:06.208 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4/temp
09-Feb-2018 01:07:06.208 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: [/Users/patrikbujna/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
09-Feb-2018 01:07:06.579 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
09-Feb-2018 01:07:06.619 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Feb-2018 01:07:06.637 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
09-Feb-2018 01:07:06.638 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Feb-2018 01:07:06.641 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1337 ms
09-Feb-2018 01:07:06.709 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
09-Feb-2018 01:07:06.709 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.4
09-Feb-2018 01:07:06.719 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4/conf/Catalina/localhost/manager.xml]
09-Feb-2018 01:07:07.121 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4/conf/Catalina/localhost/manager.xml] has finished in [401] ms
09-Feb-2018 01:07:07.121 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4/conf/Catalina/localhost/ROOT.xml]
09-Feb-2018 01:07:07.142 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor [/Users/patrikbujna/lib/Apache-Tomcat-Netbeans/9.0.4/conf/Catalina/localhost/ROOT.xml] has finished in [21] ms
09-Feb-2018 01:07:07.147 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
09-Feb-2018 01:07:07.156 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
09-Feb-2018 01:07:07.159 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 515 ms
Can you guys help me? I do not know what to solve this several days...
From the Comments:
In Netbeans, go to Tools -> Options -> and select No Proxy (if you're not behind the proxy server) - Shashanth
To resume this for both Mac OS and Windows:
on Mac: Go to Netbreans Preferences, and there choose "No Proxy".
on Windows, Go to Tools, then Options, and there choose "No Proxy".
I'm answering this so other users with the same problem can easily determine the answer that was provided.
You can try installing XAMPP for mac it explicitly runs the server for you to run your application or you can try with Apache Tomee server.
XAMPP: https://www.apachefriends.org/download.html
TOMEE: http://tomee.apache.org/downloads.html
I had the same problem.
What my problem was I was using wrong jdk version for netbeans. For example, I was using jdk version java-1.8 with netbeans 12. I changed the JDK version to the latest and tried running tomcat again and it started working.
It took me a week to figure this thing out. All the other options didn't work for me.

Intellij warning no artifacts configured

I have two classes
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
package com.example;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
#RestController
public class SampleController {
#RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
}
}
I want to make a springboot application that uses maven and tomcat. I want to see output in localhost page.
I use 8282 port, when i click run, it opens that page but it is empty.
So i created a war artifact. Web applicatin exploded but this time it says can not create artifact and it doesnot open that web page.
Why does it show an empty page? I was seeing the output before integrating tomcat.
This is output
/opt/tomcat/bin/catalina.sh run
05-Mar-2016 18:20:58.401 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.32
05-Mar-2016 18:20:58.408 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 2 2016 19:34:53 UTC
05-Mar-2016 18:20:58.408 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.32.0
05-Mar-2016 18:20:58.408 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
05-Mar-2016 18:20:58.408 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.2.0-30-generic
05-Mar-2016 18:20:58.409 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
05-Mar-2016 18:20:58.413 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-oracle/jre
05-Mar-2016 18:20:58.413 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_74-b02
05-Mar-2016 18:20:58.413 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
05-Mar-2016 18:20:58.413 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /home/caneraydin/.IntelliJIdea16/system/tomcat/Unnamed_HelloW
05-Mar-2016 18:20:58.413 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
05-Mar-2016 18:20:58.417 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/caneraydin/.IntelliJIdea16/system/tomcat/Unnamed_HelloW/conf/logging.properties
05-Mar-2016 18:20:58.417 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
05-Mar-2016 18:20:58.417 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
05-Mar-2016 18:20:58.437 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
05-Mar-2016 18:20:58.438 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
05-Mar-2016 18:20:58.438 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
05-Mar-2016 18:20:58.439 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
05-Mar-2016 18:20:58.439 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/opt/tomcat/endorsed
05-Mar-2016 18:20:58.439 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/caneraydin/.IntelliJIdea16/system/tomcat/Unnamed_HelloW
05-Mar-2016 18:20:58.439 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
05-Mar-2016 18:20:58.440 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
05-Mar-2016 18:20:58.441 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/caneraydin/Downloads/idea-IU-144.4199.23/bin::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
05-Mar-2016 18:20:59.036 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8282"]
05-Mar-2016 18:20:59.084 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Mar-2016 18:20:59.099 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
05-Mar-2016 18:20:59.102 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
05-Mar-2016 18:20:59.107 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1787 ms
05-Mar-2016 18:20:59.218 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
05-Mar-2016 18:20:59.221 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
05-Mar-2016 18:20:59.236 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8282"]
05-Mar-2016 18:20:59.336 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
05-Mar-2016 18:20:59.353 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 245 ms
Connected to server
05-Mar-2016 18:21:09.252 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/manager
05-Mar-2016 18:21:09.732 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/manager has finished in 479 ms
warning no artifacts configured
Select Artifacts from left, choose Web Application: Exploded (JAR is default?),then the warning disappeared, just for your reference,

Categories

Resources