Hi, why did you add those jars to the endorsed lib? I think this is a rather "hacky" solution. If you need those make sure those bundles are installed prior to the logging bundles, for this you'll need to add a custom feature which contains your required bundles and is marked as bootfeature in the org.apache.karaf.features.cfg.
To my understanding this should be all you need to do for this. regards, Achim 2014-07-16 12:58 GMT+02:00 jkraushaar <[email protected]>: > Hi, > > I want to start a discussion about how logging mails in Karaf can be > enabled > and what's the best way to do this. > > Situation: > > Our software is a web application. We use Karaf as a custom distribution. > Fatal errors in our software should not only be logged, but also sent to > developers per mail. In order to do this, a log4j SMTPAppender is added to > the logging configuration. > > Setup: > > The SMTPAppender uses the mail and activation API. The activation API is > already part of Karaf > (lib/endorsed/org.apache.servicemix.specs.activation-api-1.1-2.4.0.jar). > The > mail API has to be loaded by the same classloader as the activation API. > Otherwise an exception will be thrown. Hence the mail API has to be copied > to lib/endorsed and the mail API packages have to be exported by the system > bundle. Now both APIs are handled by the same classloader. > > As our application is a web app, we also install jetty and war feature. > Both > features transitively require pax-jetty feature, which installs the mail > API > as a bundle. The mail API exists two times. > > Problem: > > When we try to send a log mail, a > "javax.activation.UnsupportedDataTypeException: multipart/mixed;" exception > is thrown. This problem can easily be fixed by uninstalling the mail API > bundle which was added by pax-jetty. The real problem is: This task has to > be done manually after first start up, but our software is designed as > "install and forget" assembly. > > What is the best way to enable log mails? I'm not even sure if installing > the mail API in lib/endorsed is the correct solution. On the other hand I > didn't find another way to enable log mails at all. Can the mail API be > excluded from pax-jetty feature e.g. by overwriting the feature? Or can the > bundle be uninstalled by a startup script? > > Regards > Jochen > > > > -- > View this message in context: > http://karaf.922171.n3.nabble.com/Discussion-Enabling-logging-mails-in-Karaf-tp4034241.html > Sent from the Karaf - User mailing list archive at Nabble.com. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Software Architect / Project Manager / Scrum Master
