1

I'm using Jetty as an embedded web server within OSGi and spring-dm environment. All my bundles and war files are deployed successfully. However I'm observing the following warning in my logs:

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)

Though this warning is not impacting any functionality, i'm still curious to know why this error is happening. With little debugging I can see that the package "org.eclipse.jetty.servlet.listener" is not imported by any of the modules. I explicitly added this import to jetty-webapp and spring-osgi-web bundles, but that didn't help either.

geekprogrammer
  • 1,108
  • 1
  • 13
  • 39

1 Answers1

1

Upgrade your version of Jetty, you have a very old version with a faulty manifest.

This was fixed well over a year ago.

$ 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: .
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
  • Actually we ran into some other issues with jetty-9 so we refrained from upgrading. Thanks for informing that this issue has been fixed in the latest version of jetty. We will keep a note. – geekprogrammer Mar 26 '15 at 14:36
  • [Jetty 7 and Jetty 8 are EOL (End of Life) as of 2014.](https://dev.eclipse.org/mhonarc/lists/jetty-announce/msg00069.html) – Joakim Erdfelt Mar 26 '15 at 14:41
  • Yeah, we are aware of that. But as we ran into other dependency issues with jetty-9 we refrained from upgrading. We'll consider jetty-9 in our next release. BTW, i'm curious to know what was the fix for this issue. I can see that the package "org.eclipse.jetty.servlet.listener" is exported correctly in jetty-8 also : org.eclipse.jetty.servlet.li stener;uses:="javax.servlet,org.eclipse.jetty.util.log,org.eclipse.je tty.util";version="8.1.10" – geekprogrammer Mar 26 '15 at 14:49
  • Note: since you are using OSGi, if the "dependency issue" with jetty-9 is the minimum Java 7, know that [Jetty 9.3 just dropped Java 7 support for a minimum of Java 8](https://bugs.eclipse.org/467281) (this was done due to Java expiration, HTTP/2 support, TLS/ALPN requirements, and RFC recommended updates for HTTP/1.1) – Joakim Erdfelt May 14 '15 at 22:07