Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332200

Summary: Eliminate expected exceptions from log while using org.eclipse.jetty.jmx bundle in Apache Felix
Product: [RT] Jetty Reporter: Martin <martin>
Component: osgiAssignee: Michael Gorovoy <mgorovoy>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gregw, martin, mgorovoy
Version: 7.2.0   
Target Milestone: 7.1.x   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch with the fix
none
Modified patch
none
Updated patch none

Description Martin CLA 2010-12-09 04:58:45 EST
Build Identifier: 7.2.0.v20101020

org.eclipse.jetty.jmx bundle tries to load various non-existing classes like:
org.eclipse.jetty.server.handler.jmx.ScopedHandlerMBean
org.eclipse.jetty.server.session.jmx.SessionHandlerMBean
org.eclipse.jetty.servlet.jmx.ServletContextHandlerMBean
org.eclipse.jetty.util.component.jmx.AbstractLifeCycleMBean
...

When running on latest Apache Felix, it prints stacktraces to the console.

See also: http://www.mail-archive.com/users@felix.apache.org/msg08593.html

Reproducible: Always

Steps to Reproduce:
Use OSGi and this code with latest Apache Felix:

Server server = new Server();
...
Thread.currentThread().setContextClassLoader(MBeanContainer.class.getClassLoader()); // for JMX
server.getContainer().addEventListener(mBeanContainer);
mBeanContainer.start();
server.start();

Then watch logs/console.
Comment 1 Martin CLA 2011-02-22 07:14:33 EST
How is the progress?
Comment 2 Martin CLA 2011-03-02 11:20:17 EST
Created attachment 190177 [details]
patch with the fix

attached patch against jetty 7.3.0

The problem is that Apache Felix adds more details to ClassNotFoundException message. Example:

org.eclispe.jetty.jmx.JettyConnectorMBean not found by org.eclipse.jetty.jmx [41]
Comment 3 Michael Gorovoy CLA 2011-03-14 17:15:11 EDT
Martin,

Thank you very much for your patch. I've modified it a little bit, and need to test it to make sure everything is working correctly. It will be applied to the codebase shortly.

Thanks,
Michael
Comment 4 Michael Gorovoy CLA 2011-03-14 17:19:18 EDT
Created attachment 191172 [details]
Modified patch
Comment 5 Michael Gorovoy CLA 2011-03-14 17:38:41 EDT
Created attachment 191173 [details]
Updated patch
Comment 6 Michael Gorovoy CLA 2011-06-23 17:54:24 EDT
I've committed the latest patch that I've posted. Please re-open this issue if this fix doesn't work for you.

Committed r3416.