【发布时间】:2016-12-12 16:17:53
【问题描述】:
我对 mortbay 的 maven jetty 插件 6 有相同的配置
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
</plugin>
对于来自 eclipse 的 maven jetty 插件 9
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.11.v20160721</version>
</plugin>
第一个有效,第二个无效,出现以下错误:
2016-08-06 11:43:59.281:INFO:oejs.Server:main: jetty-9.3.6.v20151106
2016-08-06 11:44:01.247:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.JettyWebAppContext@c85b0c{/,file:///C:/.../IdeaProjects/MultiModuleSimple/simple-webapp/src/main/webapp/,STARTING}{file:///C:/.../IdeaProjects/MultiModuleSimple/simple-webapp/src/main/webapp/}
java.lang.RuntimeException: Error scanning entry com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class from jar file:///C:/.../.m2/repository/com/ibm/icu/icu4j/2.6.1/icu4j-2.6.1.jar
at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:937)
...
最后显示 Started Jetty Server,但页面显示 503。
附加信息:我有一个多模块项目、父项目和两个子项目,其中一个是 webapp 和其他一些构建到 jar 的普通 Java。我在 webapp pom 中有 jetty 插件。
【问题讨论】:
-
我找到了解决方案。第一个 Jetty 插件 9 与我用来解析 XML 的 jaxen 库使用的 icu4j 库存在问题。我切换到 JSON。接下来在 jetty 插件 9 中,默认上下文是“/”(根模块),而在 jetty 插件 6 中,默认上下文是包含 jetty 的子模块。
-
jaxen ver 1.1.6 库工作正常!我只是简单地更新了 simple-weather 子模块中的 pom.xml 以使用最新版本的 jaxen。 (之前是 1.1.1,现在是 1.1.6)
标签: java maven server jetty maven-jetty-plugin