jfinal用jetty启动时出错

使用的日志文件为默认值log4j,其他均无改动,但使用jetty启动jfinal就报错,已经两天了找不到解决办法

错误提示:

2021-07-18 10:33:29.388:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@551aa95a{/,file:///G:/workspace/douyijia.category.com/WebRoot/,UNAVAILABLE}

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:84)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:71)

at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:409)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1457)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)

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:416)

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:383)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at com.jfinal.server.jetty.JettyServer.doStart(JettyServer.java:154)

at com.jfinal.server.jetty.JettyServer.start(JettyServer.java:70)

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

at com.category.douyijia.JfinalStart.main(JfinalStart.java:22)

Caused by: 

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

at org.apache.shiro.web.env.EnvironmentLoader.<clinit>(EnvironmentLoader.java:113)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.eclipse.jetty.server.handler.ContextHandler$Context.createInstance(ContextHandler.java:2655)

at org.eclipse.jetty.webapp.StandardDescriptorProcessor.newListenerInstance(StandardDescriptorProcessor.java:1967)

at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1916)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:84)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:71)

at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:409)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1457)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)

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:416)

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:383)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at com.jfinal.server.jetty.JettyServer.doStart(JettyServer.java:154)

at com.jfinal.server.jetty.JettyServer.start(JettyServer.java:70)

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

at com.category.douyijia.JfinalStart.main(JfinalStart.java:22)

Caused by: 

java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)

at com.jfinal.server.jetty.JFinalClassLoader.loadClass(JFinalClassLoader.java:60)

at org.apache.shiro.web.env.EnvironmentLoader.<clinit>(EnvironmentLoader.java:113)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.eclipse.jetty.server.handler.ContextHandler$Context.createInstance(ContextHandler.java:2655)

at org.eclipse.jetty.webapp.StandardDescriptorProcessor.newListenerInstance(StandardDescriptorProcessor.java:1967)

at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1916)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:84)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:71)

at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:409)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1457)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)

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:416)

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:383)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at com.jfinal.server.jetty.JettyServer.doStart(JettyServer.java:154)

at com.jfinal.server.jetty.JettyServer.start(JettyServer.java:70)

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

at com.category.douyijia.JfinalStart.main(JfinalStart.java:22)

10:33:29,458 ERROR LogKit:106 - 

java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:84)

at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:71)

at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:409)

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1457)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)

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:416)

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:383)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at com.jfinal.server.jetty.JettyServer.doStart(JettyServer.java:154)

at com.jfinal.server.jetty.JettyServer.start(JettyServer.java:70)

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

at com.category.douyijia.JfinalStart.main(JfinalStart.java:22)

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

at org.apache.shiro.web.env.EnvironmentLoader.<clinit>(EnvironmentLoader.java:113)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at org.eclipse.jetty.server.handler.ContextHandler$Context.createInstance(ContextHandler.java:2655)

at org.eclipse.jetty.webapp.StandardDescriptorProcessor.newListenerInstance(StandardDescriptorProcessor.java:1967)

at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1916)

... 22 more

Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565)

at com.jfinal.server.jetty.JFinalClassLoader.loadClass(JFinalClassLoader.java:60)

... 30 more


评论区

杜福忠

2021-07-18 15:44

Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

happyboy

2021-07-20 08:52

@杜福忠 小杜一针见血