You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Hubert Felber <Hu...@abacus.ch> on 2015/09/15 11:27:52 UTC
log4j appender in felix OSGI -- ClassNotFoundException
Hi
I try to use a FileAppender in my jar with log4j
Of course log4j does not know my jar and so OSGI says:
log4j:ERROR Could not instantiate class [com.company.appender.CFileAppender].
java.lang.ClassNotFoundException: *** Class 'com.company.appender.CFileAppender'
was not found because bundle log4j [5] does not import 'com.company.appender'
even though bundle [logging [39](R 39.0)] osgi.wiring.package; {bundle-symbolic-name=logging, bundle-version=1.0.0.SNAPSHOT, version=1.0.0.SNAPSHOT, osgi.wiring.package=com.company.appender}
does export it. To resolve this issue, add an import for 'com.company.appender' to bundle log4j [5]. ***
Chaning the log4j manifest as proposed works, but I donĀ“t want to do this.
I tried to expand the classpath of log4j with a bundle fragment which imports 'com.company.appender' but endend
with errors I do not understand.
The fragment is solved, but as soon as I drop in my logging bundle with felix fileinstall I get BundleException("Stopping a starting or stopping bundle is currently not supported.");
And then the system exits.
Is there a way to do this, without touching the log4j Manifest? Should this work with fragment bundles with log4j as host?
Thank you
Hubert
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org