HTTP Status 404 – Not Found - Spring MVC - java

I create simple app in Spring MVC and i have problem. HTTP Status 404 – Not Found This is my first app in spring mvc and i don't now what could happend ;/
This is my code and pom.xml
RootConfig :
#Configuration
public class RootConfig {
}
WebConfig:
#Configuration
#EnableWebMvc
#ComponentScan("com.mathew")
public class WebConfig extends WebMvcConfigurerAdapter {
#Bean
public InternalResourceViewResolver resolver(){
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
resolver.setPrefix("/");
resolver.setSuffix(".jsp");
return resolver;
}
}
WebInit:
#Configuration
public class WebInit extends AbstractAnnotationConfigDispatcherServletInitializer {
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[]{RootConfig.class};
}
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[]{WebConfig.class};
}
protected String[] getServletMappings() {
return new String[]{"/"};
}
}
HomeController :
#Controller
public class HomeController {
#RequestMapping(value = "/")
public String home(){
return "home";
}
}
And my file pom.xml:
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Can anyone help me?
EDIT :
My logs:
"C:\Program Files\apache-tomcat-9.0.0.M22\bin\catalina.bat" run
[2017-07-18 03:12:45,274] Artifact AppSpring: Server is not connected. Deploy is not available.
Using CATALINA_BASE: "C:\Users\dell\.IntelliJIdea2017.1\system\tomcat\Unnamed_AppSpring"
Using CATALINA_HOME: "C:\Program Files\apache-tomcat-9.0.0.M22"
Using CATALINA_TMPDIR: "C:\Program Files\apache-tomcat-9.0.0.M22\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_131"
Using CLASSPATH: "C:\Program Files\apache-tomcat-9.0.0.M22\bin\bootstrap.jar;C:\Program Files\apache-tomcat-9.0.0.M22\bin\tomcat-juli.jar"
18-Jul-2017 15:12:46.094 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.0.M22
18-Jul-2017 15:12:46.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 21 2017 09:44:18 UTC
18-Jul-2017 15:12:46.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.0.0
18-Jul-2017 15:12:46.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
18-Jul-2017 15:12:46.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
18-Jul-2017 15:12:46.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
18-Jul-2017 15:12:46.095 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_131\jre
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_131-b11
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\dell\.IntelliJIdea2017.1\system\tomcat\Unnamed_AppSpring
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\apache-tomcat-9.0.0.M22
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\dell\.IntelliJIdea2017.1\system\tomcat\Unnamed_AppSpring\conf\logging.properties
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
18-Jul-2017 15:12:46.096 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\dell\.IntelliJIdea2017.1\system\tomcat\Unnamed_AppSpring
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\apache-tomcat-9.0.0.M22
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\apache-tomcat-9.0.0.M22\temp
18-Jul-2017 15:12:46.097 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.12] using APR version [1.5.2].
18-Jul-2017 15:12:46.098 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
18-Jul-2017 15:12:46.098 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
18-Jul-2017 15:12:46.816 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2k 26 Jan 2017]
18-Jul-2017 15:12:46.933 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
18-Jul-2017 15:12:46.951 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Jul-2017 15:12:46.954 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
18-Jul-2017 15:12:46.956 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
18-Jul-2017 15:12:46.956 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1185 ms
18-Jul-2017 15:12:46.983 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
18-Jul-2017 15:12:46.983 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M22
18-Jul-2017 15:12:46.993 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
18-Jul-2017 15:12:47.005 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
18-Jul-2017 15:12:47.008 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 50 ms
Connected to server
[2017-07-18 03:12:47,354] Artifact AppSpring: Artifact is being deployed, please wait...
[2017-07-18 03:12:47,848] Artifact AppSpring: Artifact is deployed successfully
[2017-07-18 03:12:47,849] Artifact AppSpring: Deploy took 495 milliseconds
18-Jul-2017 15:12:56.996 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\apache-tomcat-9.0.0.M22\webapps\manager]
18-Jul-2017 15:12:57.034 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.0.M22\webapps\manager] has finished in [37] ms

Related

Use custom axelor-config.properties in a docker compose

I have a docker file that uses this base image tomcat:9.0.70-jdk17-temurin , in it I am coping an axelor war that uses axelor-config.properties for its configuration
This file is stored in the following directory
/usr/local/tomcat/webapps/nameofapp/WEB-INF/classes/axelor-config.properties
When I use that file directly I don't have a problem and the app does run without a problem, but when I try to overwrite it using a volume in the docker-compose like this
./configuration/axelor-config.properties:/usr/local/tomcat/webapps/nameofapp/WEB-INF/classes/axelor-config.properties
It will not work, I want to overwrite that file so that I don't have to recompile the whole application and create the docker image each time I want to make a change in the configuration file.
I know the overwrite I'm doing is working as when I start the app and search for the file inside the container it does a comment line I have added but it doesn't end up starting. This are the docker logs I get when starting from a fresh image and fresh docker compose up:
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
26-Dec-2022 22:51:21.618 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.70
26-Dec-2022 22:51:21.666 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Dec 1 2022 14:05:47 UTC
26-Dec-2022 22:51:21.667 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.70.0
26-Dec-2022 22:51:21.667 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
26-Dec-2022 22:51:21.667 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.15.0-56-generic
26-Dec-2022 22:51:21.667 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
26-Dec-2022 22:51:21.668 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk
26-Dec-2022 22:51:21.668 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 17.0.5+8
26-Dec-2022 22:51:21.668 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Eclipse Adoptium
26-Dec-2022 22:51:21.668 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
26-Dec-2022 22:51:21.668 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
26-Dec-2022 22:51:21.681 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
26-Dec-2022 22:51:21.681 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
26-Dec-2022 22:51:21.681 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
26-Dec-2022 22:51:21.682 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
26-Dec-2022 22:51:21.682 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
26-Dec-2022 22:51:21.682 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
26-Dec-2022 22:51:21.682 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
26-Dec-2022 22:51:21.682 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
26-Dec-2022 22:51:21.682 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
26-Dec-2022 22:51:21.683 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
26-Dec-2022 22:51:21.683 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
26-Dec-2022 22:51:21.683 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
26-Dec-2022 22:51:21.683 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
26-Dec-2022 22:51:21.683 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
26-Dec-2022 22:51:21.688 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.35] using APR version [1.7.0].
26-Dec-2022 22:51:21.689 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
26-Dec-2022 22:51:21.689 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
26-Dec-2022 22:51:21.699 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
26-Dec-2022 22:51:22.409 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
26-Dec-2022 22:51:22.484 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [992] milliseconds
26-Dec-2022 22:51:22.578 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
26-Dec-2022 22:51:22.578 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.70]
26-Dec-2022 22:51:22.599 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/nameofapp.war]
26-Dec-2022 22:51:23.097 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/nameofapp.war] has finished in [498] ms
26-Dec-2022 22:51:23.099 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
26-Dec-2022 22:51:23.106 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [622] milliseconds

Apache Tomcat/9.0.31 server does not start in Netbeans 8.2 on MAC

I can start/shutdown the Tomcat server using my terminal but on NetBeans, it stays on starting for a few minutes then I get the server failed to start error.
Things I have tried:
adjust the server.xml <Connector />
uncheck the "Use IDE Proxy settings" box from platform tab in Server settings
take off or add quotes to the "JAVA_OPTS" in catalina.bat file
add different roles to the tomcat-users.xml
try everything here Starting of Tomcat failed from Netbeans
Any help would be gladly appreciated.
15-Feb-2020 21:12:39.866 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 5 2020 19:32:12 UTC
15-Feb-2020 21:12:39.866 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.31.0
15-Feb-2020 21:12:39.866 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
15-Feb-2020 21:12:39.866 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.15.3
15-Feb-2020 21:12:39.866 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
15-Feb-2020 21:12:39.866 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre
15-Feb-2020 21:12:39.867 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_191-b12
15-Feb-2020 21:12:39.867 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
15-Feb-2020 21:12:39.867 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /Users/Aereli/Apache
15-Feb-2020 21:12:39.867 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /Library/Tomcat
15-Feb-2020 21:12:39.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/Aereli/Apache/conf/logging.properties
15-Feb-2020 21:12:39.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
15-Feb-2020 21:12:39.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
15-Feb-2020 21:12:39.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
15-Feb-2020 21:12:39.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
15-Feb-2020 21:12:39.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
15-Feb-2020 21:12:39.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/Aereli/Apache
15-Feb-2020 21:12:39.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Library/Tomcat
15-Feb-2020 21:12:39.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Users/Aereli/Apache/temp
15-Feb-2020 21:12:39.872 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/Aereli/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
15-Feb-2020 21:12:40.310 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8090"]
15-Feb-2020 21:12:40.396 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [789] milliseconds
15-Feb-2020 21:12:40.483 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
15-Feb-2020 21:12:40.483 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.31]
15-Feb-2020 21:12:40.509 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/Users/Aereli/Apache/conf/Catalina/localhost/manager.xml]
15-Feb-2020 21:12:40.866 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/Users/Aereli/Apache/conf/Catalina/localhost/manager.xml] has finished in [356] ms
15-Feb-2020 21:12:40.866 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [/Users/Aereli/Apache/conf/Catalina/localhost/ROOT.xml]
15-Feb-2020 21:12:40.867 WARNING [main] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [] in deployment descriptor [/Users/Aereli/Apache/conf/Catalina/localhost/ROOT.xml] has been ignored
15-Feb-2020 21:12:40.903 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [/Users/Aereli/Apache/conf/Catalina/localhost/ROOT.xml] has finished in [37] ms
15-Feb-2020 21:12:40.921 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8090"]
15-Feb-2020 21:12:40.958 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [561] milliseconds
I had the same exact problem with Netbeans 12. I searched a lot in the internet and all the solutions didn't work for me. Finally I updated my JDK to the latest version and tomcat started working like a charm. Try updating your JDK to the latest version. That might help you. I believe Netbeans versions tend to depend on the JDK you use.

failed to deploy WAR artifact on tomcat

Everything was working fine few minutes earlier.
I just deleted my changes and downloaded it again, so the only thing I had to do was configure tomcat again, but I am pretty sure I did it the same way.
Now, when I try to deploy my application, I got this error:
03-Mar-2018 23:35:59.254 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.28
03-Mar-2018 23:35:59.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 6 2018 23:10:25 UTC
03-Mar-2018 23:35:59.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.28.0
03-Mar-2018 23:35:59.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 8.1
03-Mar-2018 23:35:59.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.3
03-Mar-2018 23:35:59.259 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
03-Mar-2018 23:35:59.259 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_144\jre
03-Mar-2018 23:35:59.259 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_144-b01
03-Mar-2018 23:35:59.260 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
03-Mar-2018 23:35:59.260 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\matt\.IntelliJIdea2017.2\system\tomcat\Unnamed_cost-control_4
03-Mar-2018 23:35:59.260 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Users\matt\Desktop\JAVA\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28
03-Mar-2018 23:35:59.261 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\matt\.IntelliJIdea2017.2\system\tomcat\Unnamed_cost-control_4\conf\logging.properties
03-Mar-2018 23:35:59.261 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
03-Mar-2018 23:35:59.261 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
03-Mar-2018 23:35:59.262 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
03-Mar-2018 23:35:59.262 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
03-Mar-2018 23:35:59.262 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
03-Mar-2018 23:35:59.262 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
03-Mar-2018 23:35:59.262 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
03-Mar-2018 23:35:59.264 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
03-Mar-2018 23:35:59.265 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
03-Mar-2018 23:35:59.265 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\matt\.IntelliJIdea2017.2\system\tomcat\Unnamed_cost-control_4
03-Mar-2018 23:35:59.269 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Users\matt\Desktop\JAVA\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28
03-Mar-2018 23:35:59.269 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Users\matt\Desktop\JAVA\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\temp
03-Mar-2018 23:35:59.269 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].
03-Mar-2018 23:35:59.269 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
03-Mar-2018 23:35:59.269 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
03-Mar-2018 23:36:00.313 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017]
03-Mar-2018 23:36:00.894 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-9090"]
03-Mar-2018 23:36:00.936 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Mar-2018 23:36:00.956 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
03-Mar-2018 23:36:00.959 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Mar-2018 23:36:00.977 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2592 ms
03-Mar-2018 23:36:01.082 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
03-Mar-2018 23:36:01.082 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.28
03-Mar-2018 23:36:01.100 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-9090"]
03-Mar-2018 23:36:01.121 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
03-Mar-2018 23:36:01.126 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 148 ms
Connected to server
[2018-03-03 11:36:01,356] Artifact cost-control:war exploded: Artifact is being deployed, please wait...
03-Mar-2018 23:36:02.153 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
03-Mar-2018 23:36:02.157 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
[2018-03-03 11:36:02,183] Artifact cost-control:war exploded: Error during artifact deployment. See server log for details.
03-Mar-2018 23:36:11.101 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\matt\Desktop\JAVA\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\manager]
03-Mar-2018 23:36:11.192 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\matt\Desktop\JAVA\apache-tomcat-8.5.28-windows-x64\apache-tomcat-8.5.28\webapps\manager] has finished in [90] ms
Any ideas?

NoClassDefFoundError: org/json/JSONArray

I'm trying to call a web service. When http://localhost:8080/getauthors is visited this exception is fired that says NoClassDefFoundError: org/json/JSONArray while i have included this dependency in my pom.xml. War is deployed via tomcat 8.0.36 which is set in Tomcat run configuration of intellij. What i have tried so far:
Clean/install pom.xml with different versions of org.json
Clean maven cache from /Users/cemalonder/Library/Caches/IntelliJIdea2016.3/tomcat/
Delete all versions of org.json from /Users/cemalonder/.m2/ and reinstall them
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.NoClassDefFoundError: org/json/JSONArray
rest.service.GetAuthorsService.doGet(GetAuthorsService.java:53)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>MyBookHistory</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0-b01</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
</dependencies>
</project>
package rest.service;
import org.json.JSONArray;
import org.json.JSONObject;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
/**
* Created by cemalonder on 09/01/2017.
*/
#WebServlet("/getauthors")
public class GetAuthorsService extends HttpServlet {
#Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// objects that will be used for response
PrintWriter out = resp.getWriter();
// request - response configurations
resp.setContentType("applictaion/json; charset=UTF-8");
resp.addHeader("Access-Control-Allow-Origin", "*");
resp.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
// data configuration
Integer authorSize = 6;
String[] authorImages = { "http://www.hayalperdesi.net/images/haberler/1168.jpg",
"https://farzimuhaldotcom.files.wordpress.com/2012/01/nfk.jpg",
"http://kitaplikkedisi.com/wp-content/uploads/2014/11/William-Burroughs-014.jpg",
"http://www.fakirelma.com/files/uploads/news/default/orhan-pamuk-yazarlar-af9a1b2321937079ac42.jpg",
"https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRp8gM20DyWSr489aVssuXyVrRbYLf5HO8PTaWyD1EZ7iCdFaVD4w",
"http://hepsi10numara.com/wp-content/uploads/2013/02/iyi-yazarlar.jpg"};
String[] authorNames = {"name1", "name2", "name3", "name4", "name5", "name6", "name7"};
String[] authorBio = {"randomString1",
"randomString2",
"randomString3",
"randomString4",
"randomString5",
"randomString6",
"randomString7"};
/* create JSONArray for multiple author information. Than for each author
create a JSONObject. */
JSONArray authors = new JSONArray();
for (int i = 0; i < authorSize; i++) {
JSONObject author = new JSONObject();
author.put("authorImage", authorImages[new Random().nextInt(authorImages.length)]);
author.put("authorName", authorNames[new Random().nextInt(authorNames.length)]);
author.put("authorBio", authorBio[new Random().nextInt(authorBio.length)]);
authors.put(author);
}
out.print(authors);
if (out != null) try {
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Tomcat is deploying
/Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36/bin/catalina.sh run
[2017-01-10 09:56:28,048] Artifact MyBookHistory:war exploded: Server is not connected. Deploy is not available.
10-Jan-2017 21:56:30.100 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.36
10-Jan-2017 21:56:30.102 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun 9 2016 13:55:50 UTC
10-Jan-2017 21:56:30.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.36.0
10-Jan-2017 21:56:30.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
10-Jan-2017 21:56:30.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.12
10-Jan-2017 21:56:30.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
10-Jan-2017 21:56:30.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre
10-Jan-2017 21:56:30.103 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_74-b02
10-Jan-2017 21:56:30.104 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
10-Jan-2017 21:56:30.104 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /Users/cemalonder/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat_MyBookHistory
10-Jan-2017 21:56:30.104 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36
10-Jan-2017 21:56:30.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/cemalonder/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat_MyBookHistory/conf/logging.properties
10-Jan-2017 21:56:30.105 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
10-Jan-2017 21:56:30.108 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
10-Jan-2017 21:56:30.108 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
10-Jan-2017 21:56:30.108 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
10-Jan-2017 21:56:30.109 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
10-Jan-2017 21:56:30.109 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
10-Jan-2017 21:56:30.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
10-Jan-2017 21:56:30.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36/endorsed
10-Jan-2017 21:56:30.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/cemalonder/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat_MyBookHistory
10-Jan-2017 21:56:30.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36
10-Jan-2017 21:56:30.111 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36/temp
10-Jan-2017 21:56:30.112 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/cemalonder/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
10-Jan-2017 21:56:30.594 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
10-Jan-2017 21:56:30.716 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
10-Jan-2017 21:56:30.723 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
10-Jan-2017 21:56:30.725 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
10-Jan-2017 21:56:30.725 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1788 ms
10-Jan-2017 21:56:30.774 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
10-Jan-2017 21:56:30.774 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.36
10-Jan-2017 21:56:30.784 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
10-Jan-2017 21:56:30.792 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
10-Jan-2017 21:56:30.794 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 68 ms
Connected to server
[2017-01-10 09:56:31,273] Artifact MyBookHistory:war exploded: Artifact is being deployed, please wait...
[2017-01-10 09:56:31,946] Artifact MyBookHistory:war exploded: Artifact is deployed successfully
[2017-01-10 09:56:31,946] Artifact MyBookHistory:war exploded: Deploy took 673 milliseconds
10-Jan-2017 21:56:40.794 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36/webapps/manager
10-Jan-2017 21:56:40.857 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36/webapps/manager has finished in 63 ms
Okay I got it. It seems there is a problem with Intellij's maven configuration. I changed catalina base directory to catalina home and it works now.
Add this (which points same direction as Dcatalina.home)
-Dcatalina.base=/Users/cemalonder/Development/Libraries/apache-tomcat-8.0.36
to Run/Debug Configuration as a parameter

AWS Elastic Beanstalk: Tomcat ignoring my WAR-File

i'm trying to get my Spring Boot Application into AWS-EB and I already succeeded yesterday using Java as my Platform. However having Tomcat as Platform in EB allows me to configure platform-specific properties (database etc) directly in my AWS-Console so I created a new environment with Tomcat as the underlying platform.
Now I deployed my WAR-File (that worked yesterday with plain java) and the tomcat is completely ignoring me :(
See the log attached below. I don't see an error-message anywhere it just boots up but does not deploy the WAR-File anywhere. Does anyone have an idea what I'm missing? I haven't found anyone having the same problem.
Thanks in advance! :)
Catalina.out
23-Sep-2016 13:20:34.889 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.36
23-Sep-2016 13:20:34.892 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Aug 12 2016 18:14:42 UTC
23-Sep-2016 13:20:34.892 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.36.0
23-Sep-2016 13:20:34.892 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
23-Sep-2016 13:20:34.892 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.16-27.56.amzn1.x86_64
23-Sep-2016 13:20:34.892 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
23-Sep-2016 13:20:34.893 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.24.amzn1.x86_64/jre
23-Sep-2016 13:20:34.897 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_101-b13
23-Sep-2016 13:20:34.901 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
23-Sep-2016 13:20:34.901 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/share/tomcat8
23-Sep-2016 13:20:34.901 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/share/tomcat8
23-Sep-2016 13:20:34.902 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dspring.datasource.username=USERNAME
23-Sep-2016 13:20:34.903 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DPORT=8080
23-Sep-2016 13:20:34.903 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dspring.datasource.url=DATABASE_URL
23-Sep-2016 13:20:34.903 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DJDBC_CONNECTION_STRING=
23-Sep-2016 13:20:34.903 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dspring.datasource.password=PASS
23-Sep-2016 13:20:34.904 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms256m
23-Sep-2016 13:20:34.904 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
23-Sep-2016 13:20:34.904 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=64m
23-Sep-2016 13:20:34.904 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/tomcat8
23-Sep-2016 13:20:34.904 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/tomcat8
23-Sep-2016 13:20:34.905 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
23-Sep-2016 13:20:34.906 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=
23-Sep-2016 13:20:34.906 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/var/cache/tomcat8/temp
23-Sep-2016 13:20:34.906 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/tomcat8/conf/logging.properties
23-Sep-2016 13:20:34.906 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
23-Sep-2016 13:20:34.906 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-Sep-2016 13:20:35.119 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
23-Sep-2016 13:20:35.162 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-Sep-2016 13:20:35.174 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
23-Sep-2016 13:20:35.176 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-Sep-2016 13:20:35.181 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1218 ms
23-Sep-2016 13:20:35.237 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
23-Sep-2016 13:20:35.237 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.36
23-Sep-2016 13:20:35.261 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/ROOT
23-Sep-2016 13:20:38.313 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.
23-Sep-2016 13:20:38.362 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 3,101 ms
23-Sep-2016 13:20:38.368 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
23-Sep-2016 13:20:38.377 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
23-Sep-2016 13:20:38.377 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 3196 ms
Screenshot from my config:
Read http://tomcat.apache.org/native-doc/ , then download from http://tomcat.apache.org/download-native.cgi
then put to where Tomcat expected:
the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
I solved it by using the normal Java Platform in EB and parsing an environment-variable to a JVM arg, before I start my spring-server.
Here's the code for the Spring Boot-App
public class EnvironmentVariableParser {
private static final Log log = LogFactory.getLog(EnvironmentVariableParser.class);
public static void appendArguments() {
final String customJvmArgs = System.getenv().get("CUSTOM_JVM_ARGS");
if (customJvmArgs == null) {
return;
}
for (String entry : customJvmArgs.split(" ")) {
log.info(String.format("found custom jvm arg for: %s", entry));
final int separator = entry.indexOf('=');
System.setProperty(entry.substring(0, separator), entry.substring(separator + 1, entry.length()));
}
}
}
After that you can just call it, before you start your Application
public static void main(String[] args) {
EnvironmentVariableParser.appendArguments();
SpringApplication.run(MyServerApplication.class, args);
}
Then you can just specify "CUSTOM_JVM_ARGS" as an environment-variable and paste in your properties (seperated by spaces). Not the prettiest thing ever, but it works.. :P

Categories