获取java.lang.ClassNotFoundException:org.eclipse.jetty.servlet.listener.IntrospectorCleaner

时间:2015-03-26 08:55:03

标签: jetty osgi embedded-jetty spring-dm

我正在使用Jetty作为OSGi和spring-dm环境中的嵌入式Web服务器。我的所有捆绑包和war文件都已成功部署。但是我在日志中观察到以下警告:

2015-03-25 17:32:13.748:WARN:oejw.StandardDescriptorProcessor:Could not instantiate listener org.eclipse.jetty.servlet.listener.IntrospectorCleaner
java.lang.ClassNotFoundException: org.eclipse.jetty.servlet.listener.IntrospectorCleaner
    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 java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.eclipse.jetty.server.handler.ContextHandler.loadClass(ContextHandler.java:1517)
    at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1863)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:85)
    at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:72)
    at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:366)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.springframework.osgi.web.deployer.jetty.JettyWarDeployer.startWebAppContext(JettyWarDeployer.java:218)
    at org.springframework.osgi.web.deployer.jetty.JettyWarDeployer.startDeployment(JettyWarDeployer.java:123)
    at org.springframework.osgi.web.deployer.support.AbstractWarDeployer.deploy(AbstractWarDeployer.java:93)
    at org.springframework.osgi.web.extender.internal.activator.WarLoaderListener$DeploymentManager$DeployTask.doRun(WarLoaderListener.java:261)
    at org.springframework.osgi.web.extender.internal.activator.WarLoaderListener$DeploymentManager$BaseTask.run(WarLoaderListener.java:219)
    at org.springframework.scheduling.timer.DelegatingTimerTask.run(DelegatingTimerTask.java:70)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

虽然这个警告不影响任何功能,但我仍然很想知道为什么会发生这种错误。通过很少的调试,我可以看到任何模块都没有导入包“org.eclipse.jetty.servlet.listener”。我明确地将此导入添加到jetty-webapp和spring-osgi-web包,但这也没有帮助。

1 个答案:

答案 0 :(得分:1)

升级你的Jetty版本,你有一个非常旧版本的错误清单。

一年多以前修好了。

$ cd jetty-distribution-9.2.10.v20150310
$ jar -xvf lib/jetty-servlet-9.2.10.v20150310.jar META-INF/MANIFEST.MF
 inflated: META-INF/MANIFEST.MF
$ grep -A3 Export-Package META-INF/MANIFEST.MF 
Export-Package: org.eclipse.jetty.servlet;version="9.2.10",org.eclipse
 .jetty.servlet.jmx;version="9.2.10",org.eclipse.jetty.servlet.listene
 r;version="9.2.10"
Bundle-Classpath: .