<dependency><groupId>com.jfinal</groupId><artifactId>jetty-server</artifactId><version>8.1.8</version><scope>compile</scope>
</dependency>
把scope该为compile
设置成这个就可以了~具体报什么错误?贴下图还没有想好呢,估计是没有引入jetty-serverExceptioninthread"main"java.lang.NoClassDefFoundError:org/eclipse/jetty/server/Connector
atcom.jfinal.server.ServerFactory.getServer(ServerFactory.java:44)
atcom.jfinal.core.JFinal.start(JFinal.java:158)
atcom.forever.jfinal.Server.main(Server.java:22)
Causedby:java.lang.ClassNotFoundException:org.eclipse.jetty.server.Connector
atjava.net.URLClassLoader$1.run(URLClassLoader.java:372)
atjava.net.URLClassLoader$1.run(URLClassLoader.java:361)
atjava.security.AccessController.doPrivileged(NativeMethod)
atjava.net.URLClassLoader.findClass(URLClassLoader.java:360)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)
atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:357)
...3more
@Jfinal
Exceptioninthread"main"java.lang.NoClassDefFoundError:org/eclipse/jetty/server/nio/SelectChannelConnector
atcom.jfinal.server.JettyServer.doStart(JettyServer.java:84)
atcom.jfinal.server.JettyServer.start(JettyServer.java:64)
atcom.jfinal.core.JFinal.start(JFinal.java:159)
atcom.forever.jfinal.Server.main(Server.java:22)
atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
atjava.lang.reflect.Method.invoke(Method.java:483)
atcom.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Causedby:java.lang.ClassNotFoundException:org.eclipse.jetty.server.nio.SelectChannelConnector
atjava.net.URLClassLoader$1.run(URLClassLoader.java:372)
atjava.net.URLClassLoader$1.run(URLClassLoader.java:361)
atjava.security.AccessController.doPrivileged(NativeMethod)
atjava.net.URLClassLoader.findClass(URLClassLoader.java:360)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)
atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:357)
...9more
引用来自“彪悍的人纸糊的心”的评论
Exceptioninthread"main"java.lang.NoClassDefFoundError:org/eclipse/jetty/server/Connector
atcom.jfinal.server.ServerFactory.getServer(ServerFactory.java:44)
atcom.jfinal.core.JFinal.start(JFinal.java:158)
atcom.forever.jfinal.Server.main(Server.java:22)
Causedby:java.lang.ClassNotFoundException:org.eclipse.jetty.server.Connector
atjava.net.URLClassLoader$1.run(URLClassLoader.java:372)
atjava.net.URLClassLoader$1.run(URLClassLoader.java:361)
atjava.security.AccessController.doPrivileged(NativeMethod)
atjava.net.URLClassLoader.findClass(URLClassLoader.java:360)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)
atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:357)
...3more
@Jfinal
引用来自“彪悍的人纸糊的心”的评论
Exceptioninthread"main"java.lang.NoClassDefFoundError:org/eclipse/jetty/server/Connector
atcom.jfinal.server.ServerFactory.getServer(ServerFactory.java:44)
atcom.jfinal.core.JFinal.start(JFinal.java:158)
atcom.forever.jfinal.Server.main(Server.java:22)
Causedby:java.lang.ClassNotFoundException:org.eclipse.jetty.server.Connector
atjava.net.URLClassLoader$1.run(URLClassLoader.java:372)
atjava.net.URLClassLoader$1.run(URLClassLoader.java:361)
atjava.security.AccessController.doPrivileged(NativeMethod)
atjava.net.URLClassLoader.findClass(URLClassLoader.java:360)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)
atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:357)
...3more
@Jfinal
加进去还是一样报错.估计是我哪里弄错了。能给一个纯净mavenhelloworld的jfinal项目我?
引用来自“彪悍的人纸糊的心”的评论
Exceptioninthread"main"java.lang.NoClassDefFoundError:org/eclipse/jetty/server/Connector
atcom.jfinal.server.ServerFactory.getServer(ServerFactory.java:44)
atcom.jfinal.core.JFinal.start(JFinal.java:158)
atcom.forever.jfinal.Server.main(Server.java:22)
Causedby:java.lang.ClassNotFoundException:org.eclipse.jetty.server.Connector
atjava.net.URLClassLoader$1.run(URLClassLoader.java:372)
atjava.net.URLClassLoader$1.run(URLClassLoader.java:361)
atjava.security.AccessController.doPrivileged(NativeMethod)
atjava.net.URLClassLoader.findClass(URLClassLoader.java:360)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)
atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
atjava.lang.ClassLoader.loadClass(ClassLoader.java:357)
...3more
@Jfinal
maven库的 jetty-server-8.1.8.jar只有100多k明显是文件损坏了
<dependency><groupId>com.jfinal</groupId><artifactId>jetty-server</artifactId><version>8.1.8</version><!--此处的scope值为compile仅为支持IDEA下启动项目打war包时需要改成provided,以免将一些无用的jar打进去--><scope>compile</scope></dependency>