JDK 20 and Karaf

2023-03-21 Thread Mark Derricutt
Hey all,

With todays release of JDK 20, will we likely to see a patch release of karaf 
adding it into jre.properties soon?

I have no issue patching it myself in our distribution, but I'm sure there's 
some new updates/fixes to be found?

Cheers
Mark


---
"The ease with which a change can be implemented has no relevance at all to 
whether it is the right change for the (Java) Platform for all time." — 
Mark Reinhold.

Mark Derricutt
http://www.chaliceofblood.net
http://www.theoryinpractice.net
http://twitter.com/talios
http://facebook.com/mderricutt


signature.asc
Description: OpenPGP digital signature


Re: Using Decanter log appender/collector and mail alerting fails with "javax.activation.UnsupportedDataTypeException: text/plain"

2023-03-21 Thread Paul Spencer
Bert,
You can test alerts with Decanter 2.9.0 on Karaf 4.3.x in the interim.

Since it is very easy to create an email storm, I suggest using a tool like 
Greenmail, https://greenmail-mail-test.github.io/greenmail/#deploy_standalone, 
as an email server for testing.


Paul Spencer


> On Mar 21, 2023, at 1:21 PM, Speckels, Bert  wrote:
> 
> Perfect Paul!
> 
> Thanx alot for your work to reproduce my problem here.
> 
> @Jean-Baptiste: I didn't use a mail template yet. As far as I understood 
> that's optional: I wanted to make one step after another 🙂
> 
> So currently there is no easy solution for decanter alerts using email?
> 
> Von: Paul Spencer 
> Gesendet: Dienstag, 21. März 2023 15:57
> An: user@karaf.apache.org 
> Betreff: Re: Using Decanter log appender/collector and mail alerting fails 
> with "javax.activation.UnsupportedDataTypeException: text/plain"
>  
> JB,
> I am using JavaMail 1.6.7 in karaf 4.3.x and used this question to test email 
> in Karaf 4.4.3.  As a result I have reproduced this issue. In attempt to 
> upgrade EmailAlerter to Jakarta Mail 2.1.1 with an Eclipse Angus 
> implementation, I found a bundled dependency issue and filed the following 
> issue 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feclipse-ee4j%2Fangus-mail%2Fissues%2F87&data=05%7C01%7CBert.Speckels%40btc-ag.com%7Cb9254dbaf8534596f5db08db2a1ca655%7Cc064efb078954eebb406a40bc377bc7d%7C0%7C0%7C638150074770709219%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CgEsWPuxgkvLjB2MTlYEQKRxnBZ2NZOV0CIxrSeahwY%3D&reserved=0
> 
> # Start karaf
> bin/karaf clean
> 
> # Add decanter repo and install email alerting feature
> feature:repo-add decanter
> feature:install decanter-alerting-email
> 
> # Edit etc/org.apache.karaf.decanter.alerting.email.cfg
> 
> # Send an event the alerter
> event:send decanter/alert/ERROR “foo=bar”
> 
> # Display the karaf.log 
> log:display
> 
> 10:52:25.772 INFO [features-3-thread-1] Registering commands for bundle 
> org.apache.karaf.decanter.alerting.service/2.10.0
> 10:52:25.772 INFO [features-3-thread-1]   com.sun.mail.javax.mail/1.6.2
> 10:52:25.773 INFO [features-3-thread-1]   
> org.apache.karaf.decanter.marshaller.raw/2.10.0
> 10:52:25.775 INFO [features-3-thread-1]   
> org.apache.karaf.decanter.alerting.email/2.10.0
> 10:52:25.777 INFO [features-3-thread-1] Done.
> 10:52:48.142 ERROR [pipe-event:send decanter/alert/ERROR "foo=bar"] Can't 
> send the alert e-mail
> javax.mail.MessagingException: IOException while sending message
> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) ~[?:?]
> at javax.mail.Transport.send0(Transport.java:255) ~[?:?]
> at javax.mail.Transport.send(Transport.java:174) ~[?:?]
> at 
> org.apache.karaf.decanter.alerting.email.EmailAlerter.handleEvent(EmailAlerter.java:140)
>  ~[?:?]
> at 
> org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:432)
>  ~[?:?]
> at 
> org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutDenylistTiming(HandlerTask.java:82)
>  ~[?:?]
> at 
> org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:107)
>  ~[?:?]
> at 
> org.apache.felix.eventadmin.impl.handler.EventAdminImpl.sendEvent(EventAdminImpl.java:196)
>  ~[?:?]
> at 
> org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.sendEvent(EventAdminSecurityDecorator.java:96)
>  ~[?:?]
> at 
> org.apache.karaf.event.command.EventSendCommand.execute(EventSendCommand.java:49)
>  ~[?:?]
> at 
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
>  ~[?:?]
> at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
>  ~[?:?]
> at 
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
>  ~[?:?]
> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?]
> at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) 
> ~[?:?]
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]
> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
> at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
>  ~[?:?]
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
>  ~[?:?]
> at java.lang.Thread.run(Thread.java:833) ~[?:?]
> Caused by: javax.activation.UnsupportedDataTypeException: text/plain
> at javax.activation.DataHandler.writeTo(DataHandler.java:75) 
> ~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
> at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) ~[?:?]
> at javax.mail.internet.MimeMessage.writeT

AW: Using Decanter log appender/collector and mail alerting fails with "javax.activation.UnsupportedDataTypeException: text/plain"

2023-03-21 Thread Speckels, Bert
Perfect Paul!

Thanx alot for your work to reproduce my problem here.

@Jean-Baptiste: I didn't use a mail template yet. As far as I understood that's 
optional: I wanted to make one step after another 🙂

So currently there is no easy solution for decanter alerts using email?


Von: Paul Spencer 
Gesendet: Dienstag, 21. März 2023 15:57
An: user@karaf.apache.org 
Betreff: Re: Using Decanter log appender/collector and mail alerting fails with 
"javax.activation.UnsupportedDataTypeException: text/plain"

JB,
I am using JavaMail 1.6.7 in karaf 4.3.x and used this question to test email 
in Karaf 4.4.3.  As a result I have reproduced this issue. In attempt to 
upgrade EmailAlerter to Jakarta Mail 2.1.1 with an Eclipse Angus 
implementation, I found a bundled dependency issue and filed the following 
issue 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feclipse-ee4j%2Fangus-mail%2Fissues%2F87&data=05%7C01%7CBert.Speckels%40btc-ag.com%7Cb9254dbaf8534596f5db08db2a1ca655%7Cc064efb078954eebb406a40bc377bc7d%7C0%7C0%7C638150074770709219%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CgEsWPuxgkvLjB2MTlYEQKRxnBZ2NZOV0CIxrSeahwY%3D&reserved=0

# Start karaf
bin/karaf clean

# Add decanter repo and install email alerting feature
feature:repo-add decanter
feature:install decanter-alerting-email

# Edit etc/org.apache.karaf.decanter.alerting.email.cfg

# Send an event the alerter
event:send decanter/alert/ERROR “foo=bar”

# Display the karaf.log
log:display

10:52:25.772 INFO [features-3-thread-1] Registering commands for bundle 
org.apache.karaf.decanter.alerting.service/2.10.0
10:52:25.772 INFO [features-3-thread-1]   com.sun.mail.javax.mail/1.6.2
10:52:25.773 INFO [features-3-thread-1]   
org.apache.karaf.decanter.marshaller.raw/2.10.0
10:52:25.775 INFO [features-3-thread-1]   
org.apache.karaf.decanter.alerting.email/2.10.0
10:52:25.777 INFO [features-3-thread-1] Done.
10:52:48.142 ERROR [pipe-event:send decanter/alert/ERROR "foo=bar"] Can't send 
the alert e-mail
javax.mail.MessagingException: IOException while sending message
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) ~[?:?]
at javax.mail.Transport.send0(Transport.java:255) ~[?:?]
at javax.mail.Transport.send(Transport.java:174) ~[?:?]
at 
org.apache.karaf.decanter.alerting.email.EmailAlerter.handleEvent(EmailAlerter.java:140)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:432)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutDenylistTiming(HandlerTask.java:82)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:107)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.handler.EventAdminImpl.sendEvent(EventAdminImpl.java:196)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.sendEvent(EventAdminSecurityDecorator.java:96)
 ~[?:?]
at 
org.apache.karaf.event.command.EventSendCommand.execute(EventSendCommand.java:49)
 ~[?:?]
at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
 ~[?:?]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) 
~[?:?]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 
~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 
~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: javax.activation.UnsupportedDataTypeException: text/plain
at javax.activation.DataHandler.writeTo(DataHandler.java:75) 
~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) ~[?:?]
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) ~[?:?]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ~[?:?]
... 22 more

karaf@root()>



> On Mar 21, 2023, at 6:01 AM, Jean-Baptiste Onofré  wrote:
>
> Hi Bert
>
> Let me try to reproduce. Do you use a mail template ?
>
> Regards
> JB
>
> On Sat, Mar 18, 2023 at 11:27 AM Speckels, Bert
>  wrote:
>>
>> Hello everyone
>>
>> Maybe you have a hint for me where to look for a solution.
>> I started to use "decanter" to send emails for error logging.
>>
>> I start

Re: Using Decanter log appender/collector and mail alerting fails with "javax.activation.UnsupportedDataTypeException: text/plain"

2023-03-21 Thread Paul Spencer
JB,
I am using JavaMail 1.6.7 in karaf 4.3.x and used this question to test email 
in Karaf 4.4.3.  As a result I have reproduced this issue. In attempt to 
upgrade EmailAlerter to Jakarta Mail 2.1.1 with an Eclipse Angus 
implementation, I found a bundled dependency issue and filed the following 
issue https://github.com/eclipse-ee4j/angus-mail/issues/87

# Start karaf
bin/karaf clean

# Add decanter repo and install email alerting feature
feature:repo-add decanter
feature:install decanter-alerting-email

# Edit etc/org.apache.karaf.decanter.alerting.email.cfg

# Send an event the alerter
event:send decanter/alert/ERROR “foo=bar”

# Display the karaf.log 
log:display

10:52:25.772 INFO [features-3-thread-1] Registering commands for bundle 
org.apache.karaf.decanter.alerting.service/2.10.0
10:52:25.772 INFO [features-3-thread-1]   com.sun.mail.javax.mail/1.6.2
10:52:25.773 INFO [features-3-thread-1]   
org.apache.karaf.decanter.marshaller.raw/2.10.0
10:52:25.775 INFO [features-3-thread-1]   
org.apache.karaf.decanter.alerting.email/2.10.0
10:52:25.777 INFO [features-3-thread-1] Done.
10:52:48.142 ERROR [pipe-event:send decanter/alert/ERROR "foo=bar"] Can't send 
the alert e-mail
javax.mail.MessagingException: IOException while sending message
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) ~[?:?]
at javax.mail.Transport.send0(Transport.java:255) ~[?:?]
at javax.mail.Transport.send(Transport.java:174) ~[?:?]
at 
org.apache.karaf.decanter.alerting.email.EmailAlerter.handleEvent(EmailAlerter.java:140)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:432)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutDenylistTiming(HandlerTask.java:82)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:107)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.handler.EventAdminImpl.sendEvent(EventAdminImpl.java:196)
 ~[?:?]
at 
org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.sendEvent(EventAdminSecurityDecorator.java:96)
 ~[?:?]
at 
org.apache.karaf.event.command.EventSendCommand.execute(EventSendCommand.java:49)
 ~[?:?]
at 
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
 ~[?:?]
at 
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
 ~[?:?]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) 
~[?:?]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?]
at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 
~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 
~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: javax.activation.UnsupportedDataTypeException: text/plain
at javax.activation.DataHandler.writeTo(DataHandler.java:75) 
~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) ~[?:?]
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) ~[?:?]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ~[?:?]
... 22 more

karaf@root()>  



> On Mar 21, 2023, at 6:01 AM, Jean-Baptiste Onofré  wrote:
> 
> Hi Bert
> 
> Let me try to reproduce. Do you use a mail template ?
> 
> Regards
> JB
> 
> On Sat, Mar 18, 2023 at 11:27 AM Speckels, Bert
>  wrote:
>> 
>> Hello everyone
>> 
>> Maybe you have a hint for me where to look for a solution.
>> I started to use "decanter" to send emails for error logging.
>> 
>> I started to use the following features:
>>   decanter-collector-log
>>   decanter-appender-log
>>   decanter-alerting-email
>> 
>> ... configured a simple rule in 
>> "org.apache.karaf.decanter.alerting.service.cfg"
>>   rule.error="{'condition':'message:*','level':'ERROR'}"
>> 
>> ... and configured my email server in 
>> "org.apache.karaf.decanter.alerting.email.cfg"
>> 
>> But when decanter tries to send an email the following error is logged:
>> 
>> Caused by: javax.activation.UnsupportedDataTypeException: text/plain
>> at javax.activation.DataHandler.writeTo(DataHandler.java:75) 
>> ~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
>> at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) ~[?:?]
>> at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) ~[?:?]
>> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) 
>> ~[?:?]
>> 
>> 

RE: Custom Karaf hangs on first boot if containing folder is renamed

2023-03-21 Thread Maurice Betzel
Hi JB,

I extracted the zip from the build, renamed the folder and deleted the data 
folder (which had nothing in it except the readme).
The result is the same, the shell displays:

platform.bat: KARAF_LOG doesn't exist: 
"C:\Users\User\Downloads\runtime5\bin\..\data\log"
platform.bat: Creating "C:\Users\user\Downloads\runtime5\bin\..\data\log"
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

But no ascii art, logging as mentioned below. If I stop and restart all is 
working as it should.

Van: Jean-Baptiste Onofré 
Verzonden: dinsdag 21 maart 2023 11:03
Aan: user@karaf.apache.org
Onderwerp: Re: Custom Karaf hangs on first boot if containing folder is renamed

 CAUTION: This email originated from outside of Gaston Schul. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Did you try to remove the data folder ?

Not only Karaf is using caching, Felix FileInstall/ConfigAdmin does too.

Regards
JB

On Mon, Mar 20, 2023 at 2:42 PM Maurice Betzel 
mailto:m.bet...@gaston-schul.com>> wrote:
Dear community,

Having built several custom Karaf distributions the past 10 years, we now face 
a strange behavior not seen before.
Environment is Windows 11 64bit, base Karaf version 4.4.3 with upgraded pax-web 
8.0.17 component.
If I extract the runtime ZIP after build and start it from the default 
containing folder, all works well. But if I rename the folder before first 
start, Karaf hangs on disabling logging, see below.
If I start and stop Karaf from its original folder and then rename this folder, 
all is well.
Seems that Karaf home gets cached somewhere? I cannot find it so I am hoping 
this behavior has been noticed before?

2023-03-20T14:28:48,405 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 | Starting bundles:
2023-03-20T14:28:48,407 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.util/9.4.50.v20221201
2023-03-20T14:28:48,408 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.jmx/9.4.50.v20221201
2023-03-20T14:28:48,409 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.io/9.4.50.v20221201
2023-03-20T14:28:48,410 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.http/9.4.50.v20221201
2023-03-20T14:28:48,411 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
jakarta.servlet-api/4.0.0
2023-03-20T14:28:48,411 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.ops4j.pax.web.pax-web-api/8.0.17
2023-03-20T14:28:48,412 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.ops4j.pax.web.pax-web-spi/8.0.17
2023-03-20T14:28:48,413 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.server/9.4.50.v20221201
2023-03-20T14:28:48,413 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.security/9.4.50.v20221201
2023-03-20T14:28:48,414 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.util.ajax/9.4.50.v20221201
2023-03-20T14:28:48,415 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.servlet/9.4.50.v20221201
2023-03-20T14:28:48,415 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.xml/9.4.50.v20221201
2023-03-20T14:28:48,416 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.jaas/9.4.50.v20221201
2023-03-20T14:28:48,417 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.servlets/9.4.50.v20221201
2023-03-20T14:28:48,418 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.ops4j.pax.web.pax-web-jetty/8.0.17
2023-03-20T14:28:48,419 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.eclipse.jetty.continuation/9.4.50.v20221201
2023-03-20T14:28:48,420 | INFO  | features-2-thread-1 | FeaturesServiceImpl 
 | 17 - org.apache.karaf.features.core - 4.4.3 |   
org.ops4j.pax.web.pax-web-tomcat-common/8.0.17
2023-03-20T14

EventAdmin RejectedExecutionException

2023-03-21 Thread Steven Huypens
Hi,

When starting our custom Karaf distribution, we regularly see the error
below. I'm not sure I understand it OK, but it looks like the Felix
ConfigurationManager tries to log something, but an exception is thrown,
stopping the update-Thread. Maybe the eventAdmin bundle is restarted
somehow during boot, which makes it unavailable for a short period, but I
feel that a logLine should never have this kind of impact. At the bottom
you can find the configuration of our karaf-maven-plugin.

Can I prevent the eventAdmin bundle from being restarted, or should the
exception be handled differently somewhere ?



RejectedExecutionException: Task java.util.concurrent.FutureTask@616ff6e9[Not
completed, task =
java.util.concurrent.Executors$RunnableAdapter@35bad341[Wrapped
task =
org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter@6de671aa]]
rejected from java.util.concurrent.ThreadPoolExecutor@20fbc2ac[Shutting
down, pool size = 4, active threads = 0, queued tasks = 0, completed tasks
= 176]
 java.util.concurrent.RejectedExecutionException: Task
java.util.concurrent.FutureTask@616ff6e9[Not completed, task =
java.util.concurrent.Executors$RunnableAdapter@35bad341[Wrapped task =
org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter@6de671aa]]
rejected from java.util.concurrent.ThreadPoolExecutor@20fbc2ac[Shutting
down, pool size = 4, active threads = 0, queued tasks = 0, completed tasks
= 176]
at
java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2055)
at
java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:825)
at
java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1350)
at
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at
org.apache.felix.eventadmin.impl.tasks.DefaultThreadPool.executeTask(DefaultThreadPool.java:134)
at
org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks.execute(AsyncDeliverTasks.java:102)
at
org.apache.felix.eventadmin.impl.handler.EventAdminImpl.postEvent(EventAdminImpl.java:180)
at
org.apache.felix.eventadmin.impl.security.EventAdminSecurityDecorator.postEvent(EventAdminSecurityDecorator.java:79)
at
org.ops4j.pax.logging.spi.support.EventAdminTracker.deliver(EventAdminTracker.java:103)
at
org.ops4j.pax.logging.spi.support.EventAdminTracker.postEvent(EventAdminTracker.java:65)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.handleEvents(PaxLoggingServiceImpl.java:417)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog0(PaxLoggerImpl.java:1127)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog(PaxLoggerImpl.java:1098)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.debug(PaxLoggerImpl.java:252)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.logImpl(PaxLoggingServiceImpl.java:402)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.access$000(PaxLoggingServiceImpl.java:70)
at
org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.log(PaxLoggingServiceImpl.java:678)
at org.apache.felix.cm.impl.Log.log(Log.java:186)
at org.apache.felix.cm.impl.Log.log(Log.java:168)
at
org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1383)
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122)
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:84)
at java.base/java.lang.Thread.run(Thread.java:829)


org.apache.karaf.tooling
karaf-maven-plugin
${karaf.plugin.version}


false


http
pax-web-*


diagnostic




transaction





mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/2.9.0



mvn:org.apache.karaf.features/spring/${karaf.runtime.version}/xml/features


eventadmin


scr
standard
webconsole
felix-http


decanter-collector-jmx

decanter-appender-prometheus

11
false


${project.build.directory}/maven-shared-archive-resources/propertyFileEdits/assembly-property-edits.xml

distribution
true



Kind regards,
Steven Huypens


Re: Custom Karaf hangs on first boot if containing folder is renamed

2023-03-21 Thread Jean-Baptiste Onofré
Did you try to remove the data folder ?

Not only Karaf is using caching, Felix FileInstall/ConfigAdmin does too.

Regards
JB

On Mon, Mar 20, 2023 at 2:42 PM Maurice Betzel 
wrote:

> Dear community,
>
>
>
> Having built several custom Karaf distributions the past 10 years, we now
> face a strange behavior not seen before.
>
> Environment is Windows 11 64bit, base Karaf version 4.4.3 with upgraded
> pax-web 8.0.17 component.
>
> If I extract the runtime ZIP after build and start it from the default
> containing folder, all works well. But if I rename the folder before first
> start, Karaf hangs on disabling logging, see below.
>
> If I start and stop Karaf from its original folder and then rename this
> folder, all is well.
>
> Seems that Karaf home gets cached somewhere? I cannot find it so I am
> hoping this behavior has been noticed before?
>
>
>
> 2023-03-20T14:28:48,405 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 | Starting bundles:
>
> 2023-03-20T14:28:48,407 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.util/9.4.50.v20221201
>
> 2023-03-20T14:28:48,408 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.jmx/9.4.50.v20221201
>
> 2023-03-20T14:28:48,409 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.io/9.4.50.v20221201
>
> 2023-03-20T14:28:48,410 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.http/9.4.50.v20221201
>
> 2023-03-20T14:28:48,411 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   jakarta.servlet-api/4.0.0
>
> 2023-03-20T14:28:48,411 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.ops4j.pax.web.pax-web-api/8.0.17
>
> 2023-03-20T14:28:48,412 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.ops4j.pax.web.pax-web-spi/8.0.17
>
> 2023-03-20T14:28:48,413 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.server/9.4.50.v20221201
>
> 2023-03-20T14:28:48,413 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.security/9.4.50.v20221201
>
> 2023-03-20T14:28:48,414 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.util.ajax/9.4.50.v20221201
>
> 2023-03-20T14:28:48,415 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.servlet/9.4.50.v20221201
>
> 2023-03-20T14:28:48,415 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.xml/9.4.50.v20221201
>
> 2023-03-20T14:28:48,416 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.jaas/9.4.50.v20221201
>
> 2023-03-20T14:28:48,417 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.servlets/9.4.50.v20221201
>
> 2023-03-20T14:28:48,418 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.ops4j.pax.web.pax-web-jetty/8.0.17
>
> 2023-03-20T14:28:48,419 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.continuation/9.4.50.v20221201
>
> 2023-03-20T14:28:48,420 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.ops4j.pax.web.pax-web-tomcat-common/8.0.17
>
> 2023-03-20T14:28:48,421 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.ops4j.pax.web.pax-web-runtime/8.0.17
>
> 2023-03-20T14:28:48,421 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.eclipse.jetty.client/9.4.50.v20221201
>
> 2023-03-20T14:28:48,422 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.apache.karaf.http.core/4.4.3
>
> 2023-03-20T14:28:48,423 | INFO  | features-2-thread-1 |
> FeaturesServiceImpl  | 17 - org.apache.karaf.features.core -
> 4.4.3 |   org.jolokia.osgi/1.7.1
>
> 2023-03-20T14:28:48,424 | INFO  | features-2-thread-1 |
>

Re: Using Decanter log appender/collector and mail alerting fails with "javax.activation.UnsupportedDataTypeException: text/plain"

2023-03-21 Thread Jean-Baptiste Onofré
Hi Bert

Let me try to reproduce. Do you use a mail template ?

Regards
JB

On Sat, Mar 18, 2023 at 11:27 AM Speckels, Bert
 wrote:
>
> Hello everyone
>
> Maybe you have a hint for me where to look for a solution.
> I started to use "decanter" to send emails for error logging.
>
> I started to use the following features:
>decanter-collector-log
>decanter-appender-log
>decanter-alerting-email
>
> ... configured a simple rule in 
> "org.apache.karaf.decanter.alerting.service.cfg"
>rule.error="{'condition':'message:*','level':'ERROR'}"
>
> ... and configured my email server in 
> "org.apache.karaf.decanter.alerting.email.cfg"
>
> But when decanter tries to send an email the following error is logged:
>
> Caused by: javax.activation.UnsupportedDataTypeException: text/plain
> at javax.activation.DataHandler.writeTo(DataHandler.java:75) 
> ~[org.apache.servicemix.specs.activation-api-1.2.1-1.2.1_3.jar:1.2.1_3]
> at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) ~[?:?]
> at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) ~[?:?]
> at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ~[?:?]
>
>
> Does anyone have an idea what is missing?
> I am a little bit confused and could not find any source of information about 
> this problem.
>
> I am using karaf 4.4.3, decanter 2.10.0, camel 3.20.2
>
> karaf@root()> feature:list | grep decanter | grep Started
> decanter-common (0x 2.10.0   │  │ 
> Started │ karaf-decanter-2.10.0 │ Karaf Decanter API
> decanter-collector-log  (0x 2.10.0   │  │ 
> Started │ karaf-decanter-2.10.0 │ Karaf Decanter Log Messages 
> Collector
> decanter-appender-log   (0x 2.10.0   │  │ 
> Started │ karaf-decanter-2.10.0 │ Karaf Decanter Log Appender
> decanter-alerting-core  (0x 2.10.0   │  │ 
> Started │ karaf-decanter-2.10.0 │ Karaf Decanter Alerting core
> decanter-alerting-email-core(0x 2.10.0   │  │ 
> Started │ karaf-decanter-2.10.0 │ Karaf Decanter alerting 
> email alerter core
> decanter-alerting-email (0x 2.10.0   │  │ 
> Started │ karaf-decanter-2.10.0 │ Karaf Decanter alerting 
> email alerter
>
> Thanx for any help
> Bert Speckels