Jetty无法部署war文件

时间:2016-09-17 19:10:13

标签: java-ee intellij-idea jetty

我试图部署一个简单的JSF" hello world"应用于Jetty 9.3.11并收到以下错误:

2016-09-17 21:05:45.660:WARN:oejw.WebAppContext:Scanner-1: Failed startup of context o.e.j.w.WebAppContext@b3fe46b{/JSFProject_war,jar:file:///E:/12345/JSFProject/out/artifacts/JSFProject_war/JSFProject_war.war!/,null}{E:\12345\JSFProject\out\artifacts\JSFProject_war\JSFProject_war.war}
java.io.FileNotFoundException: JAR entry WEB-INF/lib/javax.faces-2.2.1.jar!/ not found in E:\12345\JSFProject\out\artifacts\JSFProject_war\JSFProject_war.war
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:142)
    at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
    at org.eclipse.jetty.webapp.MetaInfConfiguration.getTlds(MetaInfConfiguration.java:409)
    at org.eclipse.jetty.webapp.MetaInfConfiguration.scanForTlds(MetaInfConfiguration.java:326)
    at org.eclipse.jetty.webapp.MetaInfConfiguration.scanJars(MetaInfConfiguration.java:143)
    at org.eclipse.jetty.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.java:94)
    at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:483)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:519)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:499)
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:147)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
    at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:458)
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
    at org.eclipse.jetty.util.Scanner$1.run(Scanner.java:329)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

war文件包含路径WEB-INF / lib / javax.faces-2.2.1.jar 可能是什么问题?

2 个答案:

答案 0 :(得分:3)

我遇到了同样的问题。

Project Structure Project Settings Artifacts中的工件从Web Application: Archive更改为Web Application: Exploded以某种方式解决了问题。

答案 1 :(得分:0)

您需要将javax.faces-2.2.1.jar放入WAR工件中。 您在项目选项中没有任何错误吗?