zengkid / SmartTomcat

The Tomcat plugin for Intellij IDEA
Apache License 2.0
126 stars 55 forks source link

HTTP Status 404 – Not Found #34

Closed slandge closed 4 years ago

slandge commented 4 years ago

I trying to setup the spring-mvc project on intellij community edition 2019-3 on mac. I am using smart tomcat for it.

I am trying the example given by journalDev https://www.journaldev.com/14476/spring-mvc-example

It's getting build successfully.

Stacktrace

"/Applications/IntelliJ IDEA CE.app/Contents/jbr/Contents/Home/bin/java" -Dfile.encoding=UTF-8 -classpath /Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/bin/tomcat-juli.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/bin/commons-daemon.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/bin/bootstrap.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-ko.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/el-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-es.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-websocket.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/jasper.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/jasper-el.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-util.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-de.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/catalina-storeconfig.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/jsp-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/catalina-tribes.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-cs.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/catalina.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-jni.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-pt-BR.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/ecj-4.13.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/websocket-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-coyote.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/catalina-ha.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/annotations-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/jaspic-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-zh-CN.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/catalina-ant.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/servlet-api.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-util-scan.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-ja.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-ru.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-jdbc.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-i18n-fr.jar:/Users/slandge/Documents/Tomcat/apache-tomcat-9.0.29/lib/tomcat-dbcp.jar org.apache.catalina.startup.Bootstrap start Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/Users/slandge/.SmartTomcat/spring-mvc-example/spring-mvc-example/lib], exists: [false], isDirectory: [false], canRead: [false] Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/Users/slandge/.SmartTomcat/spring-mvc-example/spring-mvc-example/lib], exists: [false], isDirectory: [false], canRead: [false] Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/Users/slandge/.SmartTomcat/spring-mvc-example/spring-mvc-example/lib], exists: [false], isDirectory: [false], canRead: [false] Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/Users/slandge/.SmartTomcat/spring-mvc-example/spring-mvc-example/lib], exists: [false], isDirectory: [false], canRead: [false] Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version name: Apache Tomcat/9.0.29 Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Nov 16 2019 17:29:07 UTC Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version number: 9.0.29.0 Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Mac OS X Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version: 10.14.5 Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: x86_64 Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: /Applications/IntelliJ IDEA CE.app/Contents/jbr/Contents/Home Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 11.0.4+10-b520.11 Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: JetBrains s.r.o Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: /Users/slandge/.SmartTomcat/spring-mvc-example/spring-mvc-example Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: /Users/slandge/.SmartTomcat/spring-mvc-example/spring-mvc-example Dec 12, 2019 7:18:17 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dfile.encoding=UTF-8 Dec 12, 2019 7:18:17 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/slandge/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.] Dec 12, 2019 7:18:18 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-nio-8080"] Dec 12, 2019 7:18:18 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-nio-8009"] Dec 12, 2019 7:18:18 PM org.apache.catalina.startup.Catalina load INFO: Server initialization in [503] milliseconds Dec 12, 2019 7:18:18 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service [Catalina] Dec 12, 2019 7:18:18 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet engine: [Apache Tomcat/9.0.29] Dec 12, 2019 7:18:18 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-nio-8080"] Dec 12, 2019 7:18:18 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-nio-8009"] Dec 12, 2019 7:18:18 PM org.apache.catalina.startup.Catalina start INFO: Server startup in [338] milliseconds http://localhost:8080/spring-mvc-example

When I am trying to access the above url. I am getting below error.

HTTP Status 404 – Not Found Type Status Report

Message /spring-mvc-example/

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.29

Following are the run configuration

Screenshot 2019-12-13 at 2 56 53 PM
slandge commented 4 years ago

I am not sure about the module root. If I remove module root getting below error. "14:59 Error running 'spring-mvc-example': com.intellij.execution.ExecutionException: The Module Root specified is not a module according to Intellij "

slandge commented 4 years ago
Screenshot 2019-12-13 at 4 01 52 PM
zengkid commented 4 years ago

Deployment Directory path should be xxxx/WebContent, not xxxx/WebContent/WEB-INF. for more detail, please read the doc

btw, you had better upgrade the plugin to 3.5.0.

slandge commented 4 years ago

Thanks. It's worked for me.