尝试在 Ubuntu 中的 Tomcat 上运行我的 JSF 项目,但出现以下错误 当我尝试使用内置管理器部署 WAR 文件时:
FAIL - 上下文路径/Server Communication 中的应用程序无法启动 失败 - 遇到异常 org.apache.catalina.LifecycleException:无法启动组件 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Server Communication]]
Log:
Mar 06, 2015 9:22:27 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/Server Communication/WEB-INF/lib/tomcat-el-api-8.0.18.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class
Mar 06, 2015 9:22:27 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/Server Communication/WEB-INF/lib/tomcat-servlet-api-8.0.18.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Mar 06, 2015 9:22:27 PM org.apache.catalina.deploy.WebXml setVersion
WARNING: Unknown version string [3.1]. Default version will be used.
Mar 06, 2015 9:22:27 PM org.apache.catalina.deploy.WebXml setVersion
WARNING: Unknown version string [3.1]. Default version will be used.
Mar 06, 2015 9:22:30 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI:
http://java.sun.com/jsf/html
is already defined
Mar 06, 2015 9:22:30 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsf/core is already defined
Mar 06, 2015 9:22:30 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://mojarra.dev.java.net/mojarra_ext is already defined
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [web-app_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [web-fragment_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [web-common_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [javaee_7.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [jsp_2_3.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [javaee_web_services_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
Mar 06, 2015 9:22:30 PM org.apache.tomcat.util.descriptor.DigesterFactory locationFor
WARNING: The XML schema [javaee_web_services_client_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
最佳答案
尝试通过 Eclipse Luna 在 Tomcat 上部署我的项目时,我遇到了同样的一组错误。幸运的是,我使用的是 Maven,可以创建一个以 tomcat:run
为目标的新运行配置。然后在 Tomcat 上运行该应用程序就可以正常工作了。或者,如果您使用 Maven,只需运行以下命令:
> mvn clean install tomcat:run
关于java - 在tomcat上部署war文件时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28910753/