Skip to main content

Calling an OSGI service from an implementation java.util.logging.Handler

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2013-09-24

Hi All,

We have a requirement to have an OSGI service handle a logging event. We have produced an OSGI bundle that implements the java.util.logging.Handler interface and the plan was for this to pass the LogRecord to another OSGI service that would actually process it. We deployed the Handler by adding the implementation class to the handlers= line in Glassfish doesn't seem to like the Handler being an OSGI bundle, however. A NoClassDefFoundError on org/osgi/util/tracker/ServiceTracker was raised fairly early in the boot suggesting the OSGI runtime is not available at the point that Handlers get configured. Can anyone suggest how me might get this working or alternatively suggest an efficient way to pass a LogRecord between a non-OSGI Handler and an OSGI service.


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-10-06

I have a very similar requirement. I have got it working on Jboss 7.2 but the same approach produces the same NoClassDefFoundError as you are getting on Glassfish.

I was thinking of registering my OSGi bundle in JNDI to make it available outside of the OSGi container.

Did you get anywhere with this?