idea启动项目报错

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector

at com.jfinal.core.JFinal.start(JFinal.java:168)

at cn.disicn.common.config.MainConfig.main(MainConfig.java:142)

Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:425)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:358)

... 2 more


Process finished with exit code 1

请求大神帮忙!


评论区

lyh061619

2018-01-09 23:31

看贴出的异常信息,异常很明显了Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector,把依赖的jetty包引入,然后记得刷新下容器。

张佳坤

2018-01-10 11:39

@lyh061619 idea好像加入
com.jfinal
jetty-server
8.1.8
provided

这个dependency就会报
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
at com.jfinal.core.JFinal.start(JFinal.java:168)
at cn.jfinal.config.MainConfig.main(MainConfig.java:37)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 2 more
错误

lyh061619

2018-01-10 22:15

@张佳坤 你就把这个依赖包引入就行了,异常错误就已经很明显了【Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector】,不必纠结了,根据提示做就好了。

热门反馈

扫码入社