gpt4 book ai didi

intellij-idea - IntelliJ 想法 - 发现 Jetty 重复配置?

转载 作者:行者123 更新时间:2023-12-04 01:13:33 25 4
gpt4 key购买 nike

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

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

Duplicate config file paths found



当我删除

etc\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/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. 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) at org.eclipse.jetty.start.Main.main(Main.java:96) 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: org.xml.sax.SAXParseException; systemId: file:/D:/Jetty-9/start.d/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1388) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:996) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302) at org.eclipse.jetty.xml.XmlParser.parse(XmlParser.java:204) at org.eclipse.jetty.xml.XmlParser.parse(XmlParser.java:220) at org.eclipse.jetty.xml.XmlConfiguration.(XmlConfiguration.java:138) at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1209) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1160) ... 12 more

Usage: java -jar start.jar [options] [properties] [configs] java -jar start.jar --help # for more information



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

最佳答案

我有同样的问题,但以这种方式解决了
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”

enter image description here

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

关于intellij-idea - IntelliJ 想法 - 发现 Jetty 重复配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15663391/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com