我正在使用带有 java 8 的 ubuntu 7 上运行一个带有 tomcat 7 (7.0.42) 的 java 应用程序,我刚刚将我的 tomcat 升级到 tomcat 8.5.30,但错误不断阻止我的应用程序的正常运行。 服务器继续运行,但不加载网页。
我的错误 :
09-Jul-2018 14:17:04.099 INFO [main] org.apache.catalina.core.AprLifecycleListener.init 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
09-Jul-2018 14:17:04.177 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
09-Jul-2018 14:17:04.271 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-bio-8080"]
09-Jul-2018 14:17:04.280 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-bio-8009"]
09-Jul-2018 14:17:04.282 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 433 ms
09-Jul-2018 14:17:04.318 INFO [main] com.mchange.v2.log.MLog.<clinit> MLog clients using java 1.4+ standard logging.
09-Jul-2018 14:17:04.340 INFO [main] com.mchange.v2.c3p0.C3P0Registry.banner Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
09-Jul-2018 14:17:04.378 INFO [main] org.apache.catalina.core.StandardService.startInternal Démarrage du service Catalina
09-Jul-2018 14:17:04.378 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/7.0.42
09-Jul-2018 14:17:04.496 GRAVE [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.getServletContainerInitializer The ServletContentInitializer [# Licensed to the Apache Software Foundation (ASF) under one or more] could not be created
java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1652)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1562)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
如您所见
09-Jul-2018 14:17:04.378 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/7.0.42
可能是由版本错误引起的 这是我的网络.xml :
<?xml version="1.0" encoding="UTF-8"?>
<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">
<display-name>osiris-web</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>softwareName</param-name>
<param-value>OSIRIS</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>faces/pages/home.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>osirisGuiServlet</servlet-name>
<servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>osirisGuiServlet</servlet-name>
<url-pattern>/osirisGui</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>*.jsf</url-pattern>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FULL_STATE_SAVING_VIEW_IDS</param-name>
<param-value>/faces/pages/diva/diva.xhtml</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>blueSky</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>com.airbus.osiris.generic.utils.constant.WebConstantsInitializer</listener-class>
</listener>
<listener>
<listener-class>com.eurocopter.osiris.utils.webapp.jsf.ApplicationConstantsInitializer</listener-class>
</listener>
<listener>
<listener-class>com.eurocopter.osiris.utils.listener.OsirisSessionListener</listener-class>
</listener>
<context-param>
<param-name>org.richfaces.fileUpload.maxRequestSize</param-name>
<param-value>200000000</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.fileUpload.createTempFiles</param-name>
<param-value>false</param-value>
</context-param>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<servlet>
<description></description>
<display-name>ServletSystemProperties</display-name>
<servlet-name>ServletSystemProperties</servlet-name>
<servlet-class>com.eurocopter.osiris.utils.system.servlet.ServletSystemProperties</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletSystemProperties</servlet-name>
<url-pattern>/systemProperties</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.richfaces.webapp.PushServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/__richfaces_push</url-pattern>
</servlet-mapping>
<context-param>
<param-name>org.richfaces.push.handlerMapping</param-name>
<param-value>/__richfaces_push</param-value>
</context-param>
<filter>
<display-name>SessionTimeoutFilter</display-name>
<filter-name>SessionTimeoutFilter</filter-name>
<filter-class>com.eurocopter.osiris.utils.filter.SessionTimeoutFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SessionTimeoutFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
<!-- Check database connection -->
<filter>
<display-name>DatabaseUnvailableFilter</display-name>
<filter-name>DatabaseUnvailableFilter</filter-name>
<filter-class>com.eurocopter.osiris.utils.filter.DatabaseUnvailableFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>DatabaseUnvailableFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</filter-mapping>
</web-app>
当你搜索这个问题时,你会发现这个: https://bz.apache.org/bugzilla/show_bug.cgi?id=55210 但我不知道是否应用了补丁或如何做。 有什么想法吗?
你说你升级到了tomcat 8.5,但日志表明你仍在运行7,所以我不确定你的意思。
tomcat 8 的一个变化是他们将支持的 servlet 版本更新到 3.1,但您仍在运行 2.5:
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">
我的 tomcat8 服务器配置为 3.1,如下所示:
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
您可以在此处找到有关从 tomcat 7 迁移到 tomcat 8 的更多信息,也可以在此处找到迁移到 8.5 的更多信息。