Yes, the problem is that we added activation in lib/endorsed as it's required by other specs in the same folder (see KARAF-2290 for details).

I would like to see if there is no a better way than putting activation in lib/endorsed (like spec features, or so).

I keep you posted asap.

Regards
JB

On 07/16/2014 12:58 PM, jkraushaar wrote:
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.


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to