13

我的 Windows 7 机器上有 IntelliJ Idea 12 和 Jetty 9。

我还有一个在 Tomcat 7.0 上运行良好的示例 JSF 项目。当我尝试使用 Jetty 添加运行时时,出现错误:

发现重复的配置文件路径

当我删除

等\jetty-jmx.xml

从此屏幕上的 Jetty Server Settings 中,我没有收到此错误,但是当我尝试启动项目时,我得到:

2013-03-27 17:50:42.076:WARN:oejx.XmlParser:main: FATAL@file:/D:/Jetty-9/start.d/ line:1 col:1: org.xml.sax.SAXParseException; systemId:file:/D:/Jetty-9/start.d/;行号:1;列号:1;序言中不能有内容。java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.jetty.start.Main.invokeMain(Main.java:453) at org.eclipse.jetty.start.Main.start(Main. java:595) 在 org.eclipse.jetty.start.Main.main(Main.java:96) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect。NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:601) 在 com.intellij.rt.execution .application.AppMain.main(AppMain.java:120) 引起:org.xml.sax.SAXParseException; systemId:file:/D:/Jetty-9/start.d/;行号:1;列号:1;序言中不能有内容。在 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) 在 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)在 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) 在 com.sun.org.apache.xerces.internal.impl.XMLErrorReporter。

用法:java -jar start.jar [options] [properties] [configs] java -jar start.jar --help # 获取更多信息

那么,如何在 IntelliJ 12 上正确配置 Jetty?

4

2 回答 2

2

我遇到了同样的问题,但在 Intellij 2016.2.5 和 Jetty 9.3.13 上以这种方式解决了

在 start.ini 中默认启用以下模块

--module=ext
--module=resources
--module=server
--module=http
--module=deploy
--module=jsp
--module=websocket

当我在 IntelliJ 中配置 Jetty 时,我再次将上述一些内容添加到“Jetty Server Settings”部分,因此出现错误。

只添加“modules/jmx.mod”

在此处输入图像描述

解决方案是在此处(IntelliJ > Run > Edit Configurations > Jetty server > local)或“start.ini”文件中添加模块。

于 2016-10-31T19:40:43.577 回答
0

到目前为止,我知道,Idea 12 不支持 Jetty 9。仅此而已。

于 2014-11-28T19:50:56.753 回答