tomcat控制台正在运行,但显示“找不到页面错误404”

oprakyz7  于 2021-07-09  发布在  Java
关注(0)|答案(2)|浏览(435)

在运行服务器之后,我在控制台中遇到的错误如下。我真的不认为,这是一个错误,因为它的状态,服务器已启动并运行。我正在使用动态web模块as2.5、tomcat7.0和java1.8。我尝试过改成3.0,也遇到了动态web模块错误的问题。你也可以建议我在开发web应用程序时使用的最佳组合。我还将向您展示pom.xml文件中使用的依赖项。每次更新项目时,我还将maven依赖项添加到“部署程序集”。
提前谢谢。

  1. Oct 31, 2017 4:04:25 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
  2. WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:spring-tutorial-73' did not find a matching property.
  3. Oct 31, 2017 4:04:25 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
  4. WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:logins' did not find a matching property.
  5. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  6. INFO: Server version: Apache Tomcat/7.0.81
  7. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  8. INFO: Server built: Aug 11 2017 10:21:27 UTC
  9. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  10. INFO: Server number: 7.0.81.0
  11. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  12. INFO: OS Name: Windows 10
  13. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  14. INFO: OS Version: 10.0
  15. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  16. INFO: Architecture: amd64
  17. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  18. INFO: Java Home: C:\Program Files\Java\jdk1.8.0_141\jre
  19. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  20. INFO: JVM Version: 1.8.0_141-b15
  21. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  22. INFO: JVM Vendor: Oracle Corporation
  23. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  24. INFO: CATALINA_BASE: C:\Users\S528130\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3
  25. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  26. INFO: CATALINA_HOME: C:\Program Files\apache-tomcat-7.0.81
  27. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  28. INFO: Command line argument: -Dcatalina.base=C:\Users\S528130\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3
  29. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  30. INFO: Command line argument: -Dcatalina.home=C:\Program Files\apache-tomcat-7.0.81
  31. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  32. INFO: Command line argument: -Dwtp.deploy=C:\Users\S528130\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps
  33. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  34. INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\apache-tomcat-7.0.81\endorsed
  35. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.VersionLoggerListener log
  36. INFO: Command line argument: -Dfile.encoding=Cp1252
  37. Oct 31, 2017 4:04:25 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  38. INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_141\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files/Java/jdk1.8.0_141/bin/../jre/bin/server;C:/Program Files/Java/jdk1.8.0_141/bin/../jre/bin;C:/Program Files/Java/jdk1.8.0_141/bin/../jre/lib/amd64;C:\Program Files\apache-maven-3.5.0\bin;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Program Files\Java\jdk1.8.0_141\bin;C:\Users\S528130\Desktop;;.
  39. Oct 31, 2017 4:04:25 PM org.apache.coyote.AbstractProtocol init
  40. INFO: Initializing ProtocolHandler ["http-bio-8080"]
  41. Oct 31, 2017 4:04:25 PM org.apache.coyote.AbstractProtocol init
  42. INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
  43. Oct 31, 2017 4:04:25 PM org.apache.catalina.startup.Catalina load
  44. INFO: Initialization processed in 1014 ms
  45. Oct 31, 2017 4:04:25 PM org.apache.catalina.core.StandardService startInternal
  46. INFO: Starting service Catalina
  47. Oct 31, 2017 4:04:25 PM org.apache.catalina.core.StandardEngine startInternal
  48. INFO: Starting Servlet Engine: Apache Tomcat/7.0.81
  49. Oct 31, 2017 4:04:26 PM org.apache.catalina.startup.TldConfig execute
  50. 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.
  51. Oct 31, 2017 4:04:26 PM org.apache.catalina.core.ApplicationContext log
  52. INFO: No Spring WebApplicationInitializer types detected on classpath
  53. Oct 31, 2017 4:04:26 PM org.apache.catalina.core.ApplicationContext log
  54. INFO: Initializing Spring FrameworkServlet 'log'
  55. Oct 31, 2017 4:04:26 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  56. INFO: FrameworkServlet 'log': initialization started
  57. Oct 31, 2017 4:04:26 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  58. INFO: Refreshing WebApplicationContext for namespace 'log-servlet': startup date [Tue Oct 31 16:04:26 CDT 2017]; root of context hierarchy
  59. Oct 31, 2017 4:04:27 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  60. INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/log-servlet.xml]
  61. Oct 31, 2017 4:04:27 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
  62. INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace 'log-servlet': startup date [Tue Oct 31 16:04:26 CDT 2017]; root of context hierarchy
  63. Oct 31, 2017 4:04:28 PM org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter initControllerAdviceCache
  64. INFO: Looking for @ControllerAdvice: WebApplicationContext for namespace 'log-servlet': startup date [Tue Oct 31 16:04:26 CDT 2017]; root of context hierarchy
  65. Oct 31, 2017 4:04:28 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  66. INFO: Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
  67. Oct 31, 2017 4:04:28 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  68. INFO: FrameworkServlet 'log': initialization completed in 1369 ms
  69. Oct 31, 2017 4:04:29 PM org.apache.catalina.startup.TldConfig execute
  70. 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.
  71. Oct 31, 2017 4:04:29 PM org.apache.catalina.core.ApplicationContext log
  72. INFO: No Spring WebApplicationInitializer types detected on classpath
  73. Oct 31, 2017 4:04:29 PM org.apache.catalina.core.ApplicationContext log
  74. INFO: Initializing Spring root WebApplicationContext
  75. Oct 31, 2017 4:04:29 PM org.springframework.web.context.ContextLoader initWebApplicationContext
  76. INFO: Root WebApplicationContext: initialization started
  77. Oct 31, 2017 4:04:29 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  78. INFO: Refreshing Root WebApplicationContext: startup date [Tue Oct 31 16:04:29 CDT 2017]; root of context hierarchy
  79. Oct 31, 2017 4:04:29 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  80. INFO: Loading XML bean definitions from class path resource [com/caveofprogramming/spring/web/config/dao-context.xml]
  81. Oct 31, 2017 4:04:29 PM org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFilters
  82. INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
  83. Oct 31, 2017 4:04:29 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  84. INFO: Loading XML bean definitions from class path resource [com/caveofprogramming/spring/web/config/service-context.xml]
  85. Oct 31, 2017 4:04:29 PM org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFilters
  86. INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
  87. Oct 31, 2017 4:04:29 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
  88. INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@68b78425: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,offersDao,dataSource,offersService,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
  89. Oct 31, 2017 4:04:29 PM org.springframework.web.context.ContextLoader initWebApplicationContext
  90. INFO: Root WebApplicationContext: initialization completed in 516 ms
  91. Oct 31, 2017 4:04:29 PM org.apache.catalina.core.ApplicationContext log
  92. INFO: Initializing Spring FrameworkServlet 'offers'
  93. Oct 31, 2017 4:04:29 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  94. INFO: FrameworkServlet 'offers': initialization started
  95. Oct 31, 2017 4:04:29 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  96. INFO: Refreshing WebApplicationContext for namespace 'offers-servlet': startup date [Tue Oct 31 16:04:29 CDT 2017]; parent: Root WebApplicationContext
  97. Oct 31, 2017 4:04:29 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  98. INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/offers-servlet.xml]
  99. Oct 31, 2017 4:04:29 PM org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFilters
  100. INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
  101. Oct 31, 2017 4:04:29 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
  102. INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7c57f80: defining beans [homeController,offersController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,mvcContentNegotiationManager,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,jspViewResolver,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@68b78425
  103. Oct 31, 2017 4:04:29 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
  104. INFO: Mapped "{[/],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.caveofprogramming.spring.web.controllers.HomeController.showHome()
  105. Oct 31, 2017 4:04:29 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
  106. INFO: Mapped "{[/offers],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.caveofprogramming.spring.web.controllers.OffersController.showOffers(org.springframework.ui.Model)
  107. Oct 31, 2017 4:04:29 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
  108. INFO: Mapped "{[/createoffer],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.caveofprogramming.spring.web.controllers.OffersController.createOffer(org.springframework.ui.Model)
  109. Oct 31, 2017 4:04:29 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
  110. INFO: Mapped "{[/test],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.caveofprogramming.spring.web.controllers.OffersController.showTest(org.springframework.ui.Model,java.lang.String)
  111. Oct 31, 2017 4:04:29 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
  112. INFO: Mapped "{[/docreate],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.caveofprogramming.spring.web.controllers.OffersController.doCreate(org.springframework.ui.Model,com.caveofprogramming.spring.web.dao.Offer,org.springframework.validation.BindingResult)
  113. Oct 31, 2017 4:04:29 PM org.hibernate.validator.internal.util.Version <clinit>
  114. INFO: HV000001: Hibernate Validator 5.0.1.Final
  115. Oct 31, 2017 4:04:30 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  116. INFO: Mapped URL path [/static/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
  117. Oct 31, 2017 4:04:30 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  118. INFO: FrameworkServlet 'offers': initialization completed in 779 ms
  119. Oct 31, 2017 4:04:30 PM org.apache.coyote.AbstractProtocol start
  120. INFO: Starting ProtocolHandler ["http-bio-8080"]
  121. Oct 31, 2017 4:04:30 PM org.apache.coyote.AbstractProtocol start
  122. INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  123. Oct 31, 2017 4:04:30 PM org.apache.catalina.startup.Catalina start
  124. INFO: Server startup in 4904 ms

log-servlet.xml文件

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:mvc="http://www.springframework.org/schema/mvc"
  6. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  7. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  8. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd">
  9. <context:component-scan base-package="com.logins.Controllers"></context:component-scan>
  10. <mvc:annotation-driven></mvc:annotation-driven>
  11. <mvc:default-servlet-handler/>
  12. <bean id="jspViewResolver"
  13. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  14. <property name="prefix" value="/WEB-INF/jsps"></property>
  15. <property name="suffix" value=".jsp"></property>
  16. </bean>
  17. </beans>

网站.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  3. <display-name>logins</display-name>
  4. <welcome-file-list>
  5. <welcome-file>index.html</welcome-file>
  6. <welcome-file>index.htm</welcome-file>
  7. <welcome-file>index.jsp</welcome-file>
  8. <welcome-file>default.html</welcome-file>
  9. <welcome-file>default.htm</welcome-file>
  10. <welcome-file>default.jsp</welcome-file>
  11. </welcome-file-list>
  12. <servlet>
  13. <description></description>
  14. <display-name>log</display-name>
  15. <servlet-name>log</servlet-name>
  16. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  17. <load-on-startup>1</load-on-startup>
  18. </servlet>
  19. <servlet-mapping>
  20. <servlet-name>log</servlet-name>
  21. <url-pattern>/</url-pattern>
  22. </servlet-mapping>
  23. </web-app>

使用的依赖项的pom.xml文件。

  1. <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">
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>logins</groupId>
  4. <artifactId>logins</artifactId>
  5. <version>0.0.1-SNAPSHOT</version>
  6. <packaging>war</packaging>
  7. <build>
  8. <sourceDirectory>src</sourceDirectory>
  9. <plugins>
  10. <plugin>
  11. <artifactId>maven-compiler-plugin</artifactId>
  12. <version>3.6.1</version>
  13. <configuration>
  14. <source>1.8</source>
  15. <target>1.8</target>
  16. </configuration>
  17. </plugin>
  18. <plugin>
  19. <artifactId>maven-war-plugin</artifactId>
  20. <version>3.0.0</version>
  21. <configuration>
  22. <warSourceDirectory>WebContent</warSourceDirectory>
  23. </configuration>
  24. </plugin>
  25. </plugins>
  26. </build>
  27. <dependencies>
  28. <dependency>
  29. <groupId>org.springframework</groupId>
  30. <artifactId>spring-core</artifactId>
  31. <version>5.0.0.RELEASE</version>
  32. </dependency>
  33. <dependency>
  34. <groupId>org.springframework</groupId>
  35. <artifactId>spring-beans</artifactId>
  36. <version>5.0.0.RELEASE</version>
  37. </dependency>
  38. <dependency>
  39. <groupId>org.springframework</groupId>
  40. <artifactId>spring-context</artifactId>
  41. <version>5.0.0.RELEASE</version>
  42. </dependency>
  43. <dependency>
  44. <groupId>org.springframework</groupId>
  45. <artifactId>spring-web</artifactId>
  46. <version>5.0.0.RELEASE</version>
  47. </dependency>
  48. <dependency>
  49. <groupId>org.springframework</groupId>
  50. <artifactId>spring-webmvc</artifactId>
  51. <version>5.0.0.RELEASE</version>
  52. </dependency>
  53. <dependency>
  54. <groupId>org.springframework</groupId>
  55. <artifactId>spring-jdbc</artifactId>
  56. <version>5.0.0.RELEASE</version>
  57. </dependency>
  58. </dependencies>
  59. </project>
ou6hu8tu

ou6hu8tu1#

从字面上看,日志中没有任何错误,都是为了调试而输出的详细信息,您担心什么?有什么问题吗?或者你只是认为有一个堆栈跟踪,然后决定发布一个问题?

xriantvc

xriantvc2#

我的答案是log-servlet.xml前缀值->“/web inf/jsps”

  1. <context:component-scan base-package="com.logins.Controllers"></context:component-scan>
  2. <mvc:annotation-driven></mvc:annotation-driven>
  3. <mvc:default-servlet-handler/>
  4. <bean id="jspViewResolver"
  5. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  6. <property name="prefix" value="/WEB-INF/jsps/"></property>
  7. <property name="suffix" value=".jsp"></property>
  8. </bean>
  9. </beans>

相关问题