- 在https://get.nutz.io/页面,构筑中心,选中Nutz.Mvc,Nutz.Dao,Jetty,Jdbc,Beetl。
- 下载的压缩包,解压后,用eclipse导入成“已存在的maven项目”。
- 待maven各种包加载完成后,运行MainLauncher的main方法。控制台出现以下日志。
错误日志:
[WARN ] 21:54:52.853 org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:554) - Failed startup of context o.e.j.w.WebAppContext@7905a0b8{/,[file:///C:/Users/z/Downloads/demo/target/classes/static/, jar:file:/C:/Users/z/.m2/repository/org/nutz/nutzboot-starter-swagger/2.2-SNAPSHOT/nutzboot-starter-swagger-2.2-SNAPSHOT.jar!/static/],UNAVAILABLE}
java.lang.NoClassDefFoundError: io/swagger/util/ReflectionUtils
at io.swagger.servlet.Reader.read(Reader.java:68)
at io.swagger.servlet.Reader.read(Reader.java:58)
at org.nutz.boot.starter.swagger.SwaggerServletStarter.init(SwaggerServletStarter.java:75)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:670)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:427)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:374)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:419)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:386)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.nutz.boot.starter.jetty.JettyStarter.start(JettyStarter.java:125)
at org.nutz.boot.AppContext.startServers(AppContext.java:306)
at org.nutz.boot.NbApp.execute(NbApp.java:204)
at org.nutz.boot.NbApp.run(NbApp.java:177)
at io.nutz.demo.MainLauncher.main(MainLauncher.java:24)
Caused by: java.lang.ClassNotFoundException: io.swagger.util.ReflectionUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 24 more