当我将所有弹簧罐转储到WEB-INF / lib目录时,Spring MVC抛出404

时间:2017-04-27 14:57:16

标签: java spring spring-mvc jar

我正在通过以下链接进行spring web MVC教程 https://www.tutorialspoint.com/spring/spring_mvc_hello_world_example.htm

当我只将指定的指定JAR文件添加到WEB-INF / lib

时,项目工作正常
  • 共享记录-1.2.jar
  • 弹簧AOP-4.3.7.RELEASE.jar
  • 弹簧方面-4.3.7.RELEASE.jar
  • 弹簧豆-4.3.7.RELEASE.jar
  • 弹簧上下文4.3.7.RELEASE.jar
  • 弹簧芯4.3.7.RELEASE.jar
  • 弹簧表达-4.3.7.RELEASE.jar
  • 弹簧网络4.3.7.RELEASE.jar
  • 弹簧webmvc-4.3.7.RELEASE.jar enter image description here

但是当我添加ALL spring 4.3.7 java jar时,URL映射无法正常工作。 Failure when I add all JARS to WEB-INF/lib directory

有人可以解释为什么会这样吗?我该如何调试这些问题? Spring是否有可以打开的调试标志?

PS:我不想使用maven,因为它隐藏了这种复杂性。

Tomcat控制台日志在这里

cat ~/failurepath
Apr 27, 2017 7:40:59 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWebTake2' did not find a matching property.
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/8.5.14
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Apr 13 2017 12:55:45 UTC
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         8.5.14.0
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Mac OS X
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.12.4
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          x86_64
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.8.0_121-b13
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         /Users/raghuramg/wstutorialspoint/.metadata/.plugins/org.eclipse.wst.server.core/tmp5
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         /Users/raghuramg/mysoftwares/apache-tomcat-8.5.14
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/Users/raghuramg/wstutorialspoint/.metadata/.plugins/org.eclipse.wst.server.core/tmp5
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/Users/raghuramg/mysoftwares/apache-tomcat-8.5.14
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=/Users/raghuramg/wstutorialspoint/.metadata/.plugins/org.eclipse.wst.server.core/tmp5/wtpwebapps
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/Users/raghuramg/mysoftwares/apache-tomcat-8.5.14/endorsed
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=UTF-8
Apr 27, 2017 7:40:59 AM 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/raghuramg/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Apr 27, 2017 7:40:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Apr 27, 2017 7:40:59 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 27, 2017 7:40:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Apr 27, 2017 7:40:59 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 27, 2017 7:40:59 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 439 ms
Apr 27, 2017 7:40:59 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 27, 2017 7:40:59 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.14
Apr 27, 2017 7:41:00 AM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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.
Apr 27, 2017 7:41:00 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Apr 27, 2017 7:41:00 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'HelloWeb'
Apr 27, 2017 7:41:00 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'HelloWeb': initialization started
Apr 27, 2017 7:41:01 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'HelloWeb-servlet': startup date [Thu Apr 27 07:41:01 PDT 2017]; root of context hierarchy
Apr 27, 2017 7:41:01 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
Apr 27, 2017 7:41:01 AM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/hello] onto handler 'helloController'
Apr 27, 2017 7:41:01 AM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/hello.*] onto handler 'helloController'
Apr 27, 2017 7:41:01 AM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/hello/] onto handler 'helloController'
Apr 27, 2017 7:41:01 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'HelloWeb': initialization completed in 567 ms
Apr 27, 2017 7:41:01 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Apr 27, 2017 7:41:01 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Apr 27, 2017 7:41:01 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1710 ms
Apr 27, 2017 7:41:02 AM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/HelloWebTake2/] in DispatcherServlet with name 'HelloWeb'

enter code here

0 个答案:

没有答案