开发者社区> 问答> 正文

在 IntelliJ IDEA 中 配置 Jetty9 出现 Duplicate?报错

在 IDEA 中 配置 Jetty9 的时候 会 出现 "Duplicate config file paths found",但是安装 提示 取消 etc\jeety-jmx.xml 之后,虽然不会提示错误了,但是 配置完 之后 也是无法启动 jetty 的,会报错 "Could not find the main class: duplicate.  Program will exit."

这具体是为什么呢?

取消选择 etc\jetty-jxm.xml之后 启动 会报错,而不取消根本无法保存配置

"C:\Program Files\Java\jdk1.6.0_45\bin\java" -DSTOP.PORT=0 -Dcom.sun.management.jmxremote= -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -DOPTIONS=jmx -Didea.launcher.port=7533 "-Didea.launcher.bin.path=D:\CodeProgram\IntelliJ IDEA 11.1.5\bin" duplicate -Dfile.encoding=GBK -classpath "start.jar;D:\CodeProgram\IntelliJ IDEA 11.1.5\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.eclipse.jetty.start.Main "C:\Documents and Settings\Administrator\Local Settings\temp\context1942389928663380414config\contexts-config.xml"
java.lang.NoClassDefFoundError: duplicate
Caused by: java.lang.ClassNotFoundException: duplicate
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: duplicate.  Program will exit.
[2013-10-18 06:12:50,375] Artifact BaeTest:war exploded: Server is not connected. Press 'Deploy' to start deployment.
Exception in thread "main" Disconnected from server
 

Google 搜索了好久,就stackoverflow上面有两个提问。。。。而且还没人回答,真是个天坑呀。。。。

展开
收起
爱吃鱼的程序员 2020-06-22 15:03:32 554 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    没有人知道么? <imgsrc="http://www.oschina.net/js/ke/plugins/emoticons/images/1.gif"alt=""/>这个问题我也遇到了,琢磨了一下解决了。

    首先你可能把jettyserver设置乱了,需要在IntelliJ里删掉现有的JettyTemplate。下载新的Jetty放到新目录。然后将default里的JettyServer指向新的目录,注意:点击”configure。。。“,里面缺省会有四个xml是active的。所以在run/deploy的对话框里不需要再选中active任何xml,否则就会报错duplicateconfigfilefound。指向新的目录以后,defaultjettyserver不需要做任何修改了,你得到了一个新的defaultjettyserver,按+号重新做一个针对app的jettyserver,选中新建的defaultjettyserver做模板,不需要active任何xml,只需要设置startpage指向projectname,同时deploy你的warexploded。就设置好了。可以运行app了。不要选择多个mod配置,默认的就是第一个

    没想到这个问题现在还存在。

    JMX端口下面有一堆的xml文件,选中其中一个jetty-jmx.xml的文件就OK

    2020-06-22 15:03:51
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
蚂蚁金服高级开发工程师萧恺:IDEA 插件开发入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载