I don't know what happened, but I recreated the project under a different name in net beans and it works.
I just copied the files out of the orginal and pasted them in the new one too...strange. The only thing I could think of is that my project name/war file was the same name as my database. This may have cause conflicts in xml.
I have almost the same issue. My Spring application is being started by Tomcat on my own laptop, but on the Amazon Linux server EC2 in catalina.out I have this:
22-Sep-2020 09:39:14.986 INFO [http-nio-8080-exec-48] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war]
22-Sep-2020 09:39:24.263 INFO [http-nio-8080-exec-48] 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.
22-Sep-2020 09:39:24.407 INFO [http-nio-8080-exec-48] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war] has finished in [9,421] ms
On local computer there is java 8, Tomcat 9. The same is on the EC2
Dave Tolls wrote:According to those logs it deployed.
Also according to the logs, it deployed under the context path /mobile-app-ws-0.0.1-SNAPSHOT.
Meaning that you'd have URLs in the format of http://my.server:8080/mobile-app-ws-0.0.1-SNAPSHOT/index.jsp.
Tomcat deploys WARS by default using the WAR's name as its context path. So to get a simpler/more meaningful context path, you either have to rename the WAR before you deploy it or use an alternative deployment scheme.
I usually use the second option. I put the WAR outside of Tomcat - for example as /opt/com/javaranch/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war. Then I create a Context file in TOMCAT_HOME/conf/Catalina/localhost/mywebapp.xml. It will point to the WAR file under /opt/com/javaranch/webapps. Don't create the Context in TOMCAT_HOME/conf/server.xml!
The webapp will be deployed under the name of its Context file, so that would deploy my webapp as http://my.server:8080/mywebapp Note that a name within the Context will be ignored. It's the name of the Context xml file (minux the "xml" suffix) that Tomcat deploys under.
Sources may include data from the Fakebook Research Foundation with support from Gargle University