Re: Karaf 4.2.10 - NullPointerException during xml parsing

2021-03-03 Thread Jean-Baptiste Onofre
Hi Brock,

It will be short for 4.2.11 (eventually 4.2.12): I don’t want to hold 4.2.11 
any longer.

As you have a workaround (removing xml jar from lib/endorsed), I would prefer 
to target 4.2.12 if you don’t mind.

Regards
JB

> Le 3 mars 2021 à 21:14, brock samson  a écrit :
> 
> would it be possible to have this fixed in the upcoming 4.2.11 release?
> 
> From: Jean-Baptiste Onofre 
> Sent: Wednesday, March 3, 2021 2:50 AM
> To: user 
> Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing
>  
> Hi,
> 
> Yes, 90% of the use cases don’t need java.xml in lib/endorsed.
> 
> Regards
> JB
> 
>> Le 3 mars 2021 à 08:42, brock samson > > a écrit :
>> 
>> Hi JB
>> 
>> I know you are quite busy so no need to apologize.
>> 
>> Just to make sure I understood you correctly, the 
>> org.apache.karaf.specs.java.xml-4.2.10.jar can be permanently removed from 
>> the /endorsed dir without any negative side effects, right?
>> 
>>  
>> From: Jean-Baptiste Onofre mailto:j...@nanthrax.net>>
>> Sent: Wednesday, March 3, 2021 12:14 AM
>> To: user mailto:user@karaf.apache.org>>
>> Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing
>>  
>> Hi Brock,
>> 
>> Sorry for the very late answer.
>> 
>> The reason why javax.xml is in lib/endorsed folder is because core Karaf 
>> loads just the spec and let you install the impl.
>> Anyway, you can remove it from endorsed and install bundles, it works as 
>> well.
>> It’s basically what we plan to do by default as part of KARAF-6703.
>> 
>> Regards
>> JB
>> 
>>> Le 3 mars 2021 à 05:50, brock samson >> > a écrit :
>>> 
>>> Hi João
>>> 
>>> Thank you for looking into this issue. Its nice to know it no longer 
>>> appears in karaf 4.3, but is there another way to resolve this in 4.2.10 
>>> without changing the code? More specifically, is there a reason why 
>>> org.apache.karaf.specs.java.xml-4.2.10.jar resides in the /endorsed 
>>> directory as opposed to being exposed by a bundle? The reason for me asking 
>>> is because the bundle approach would allow me to choose which 
>>> implementation my bundle would reference, while the current endorsed 
>>> approach leaves me no choice.
>>> 
>>> Regards,
>>> 
>>> Brock
>>> 
>>>  
>>> From: João Assunção >> >
>>> Sent: Tuesday, March 2, 2021 5:28 PM
>>> To: user@karaf.apache.org  
>>> mailto:user@karaf.apache.org>>
>>> Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing
>>>  
>>> Hi Brock,
>>> 
>>> I tried your jar but it failed due to the layout of the jar (the MANIFEST 
>>> was not the first entry in the jar or something like that). I created a 
>>> bundle with our code and when I tried with karaf 4.3 it passed.
>>> I then tried with 4.2.7 and I experienced the same NPE. Apparently the 
>>> behavior when the errorHandler is set to null is different between 
>>> implementations of the XML libs supplied in these two versions of karaf.
>>> In your code setting the error handler to builder.setErrorHandler(new 
>>> org.xml.sax.helpers.DefaultHandler()); seems to do the trick.
>>> 
>>> I noticed your manifest is importing a bunch of packages not required for 
>>> the code in question. 
>>> 
>>> Regards
>>> João Assunção
>>> 
>>> Email: joao.assun...@exploitsys.com 
>>> Mobile: +351 916968984
>>> Phone: +351 211933149
>>> Web: www.exploitsys.com 
>>> 
>>> 
>>> 
>>> 
>>> On Tue, Mar 2, 2021 at 3:33 AM brock samson >> > wrote:
>>> hi, JB. did you get a chance to run my bundle?
>>> 
>>>  
>>> From: brock samson >> >
>>> Sent: Wednesday, February 24, 2021, 11:18 PM
>>> To: user@karaf.apache.org 
>>> Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing
>>> 
>>> hi, JB.
>>> 
>>> thank you for looking at this. The attached zip (rename its extension from 
>>> .txt to .zip) contains both the bundle (rename its extension from .txt to 
>>> .jar) and its feature file. the bundle should be placed in the /bundles 
>>> dir, and you know what to do with the feature file =)
>>> here are some points regarding the bundle:
>>> 1) the bundle executes automatically during Karaf startup to make it easier 
>>> for you.
>>> 2) The bundle contains both the schema and the xml, so you dont have to 
>>> really do anything to the bundle itself in order for it to just run
>>> 3) The bundle contains props.properties where you can specify external 
>>> locations to both schema and xml file if you choose to do so for any 
>>> reason. The provided files will be ignored in such case.
>>> 4) I have also provided the source .java alongside the binary just in case.
>>> 
>>> again, really appreciate you taking the time to look at it. thanks!!!
>>> 
>>> Brock Samson
>>> 
>>>  
>>> From: Jean-Baptiste Onofre mailto:j...@nanthrax.net>>
>>> 

Re: feature:install hangs, how to troubleshoot??

2021-03-03 Thread Jean-Baptiste Onofre
Nothing is the log as well setting features service in DEBUG ?

Regards
JB

> Le 3 mars 2021 à 19:04, Oleg Cohen  a écrit :
> 
> Hi JB,
> 
> Ran with -t -v and the behavior was the same. Feels like some kind of 
> infinite loop, but all was very quiet.
> 
> Thank you,
> Oleg
> 
>> On Mar 3, 2021, at 12:05 AM, Jean-Baptiste Onofre > > wrote:
>> 
>> Hi Oleg,
>> 
>> Did you try feature:install -t -v (to do a "simulate") ?
>> 
>> You might have message from the resolver in the log.
>> 
>> Regards
>> JB
>> 
>>> Le 2 mars 2021 à 20:30, Oleg Cohen >> > a écrit :
>>> 
>>> Greetings,
>>> 
>>> I am using version 4.3.0. I have a top-level feature that depends on other 
>>> features.
>>> 
>>> When I run feature:install -r -v FEATURE, it sits there for a long while 
>>> and then blows up with an OutOfMemory exception. Is there any way to get 
>>> logging for what is taking place? Would appreciate any idea on how to 
>>> troubleshoot the issue.
>>> 
>>> Thank you,
>>> Oleg
>>> 
>>> -- 
>>> Oleg Cohen  |  Principal  |  A S S U R E B R I D G E
>>> Office: +1 617 564 0737 <>  |  Mobile: +1 617 455 7927 <>  |  Fax: +1 888 
>>> 409 6995 <>
>>> Email: oleg.co...@assurebridge.com   |  
>>> www.assurebridge.com 
> 



Re: Build Issue

2021-03-03 Thread Jean-Baptiste Onofre
Do you have log feature as boot feature ?

Don’t you try to add Aries-proxy as boot feature as well ?

It seems to be related to startup/boot features you defined (not really 
environment).

Regards
JB

> Le 3 mars 2021 à 18:22, Matthias Leinweber  a 
> écrit :
> 
> Hello Karafers,
> 
> i have a very strange build issue with assembly plugin.
> I can build my package on my machine, on my machine inside a container using 
> podman as well as submitting my dockerfile to a kaniko builder. A colleague 
> of mine can also build it on his machine. With our internal artifactory as 
> well as with maven.repo.org  (proxy).
> 
> However as soon as we try to build inside our kubernetes it fails with 
> changing the dependencies somehow randomly changes the missing package
> 
> [ERROR] Failed to execute goal 
> org.apache.karaf.tooling:karaf-maven-plugin:4.3.0:assembly (default-assembly) 
> on project rahla: Unable to build assembly: 
> org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: 
> missing requirement [root] osgi.identity; osgi.identity=service-security; 
> type=karaf.feature; version=4.3.0; 
> filter:="(&(osgi.identity=service-security)(type=karaf.feature)(version>=4.3.0))"
>  [caused by: Unable to resolve service-security/4.3.0: missing requirement 
> [service-security/4.3.0] osgi.identity; osgi.identity=aries-proxy; 
> type=karaf.feature [caused by: Unable to resolve aries-proxy/4.3.0: missing 
> requirement [aries-proxy/4.3.0] osgi.identity; 
> osgi.identity=org.apache.aries.proxy; type=osgi.bundle; 
> version="[1.1.8,1.1.8]"; resolution:=mandatory [caused by: Unable to resolve 
> org.apache.aries.proxy/1.1.8: missing requirement 
> [org.apache.aries.proxy/1.1.8] osgi.wiring.package; 
> filter:="(&(osgi.wiring.package=org.slf4j)(version>=1.7.0)(!(version>=2.0.0)))"]]]
>  -> [Help 1]
> 
> We are building inside kubernetes using maven:3.6.3-jdk-11 as build image. 
> Same which i am using locally.
> 
> Do you have any ideas/hints how i could debug this?
> 
> br,
> Matthias



Re: Karaf 4.2.10 - NullPointerException during xml parsing

2021-03-03 Thread brock samson
would it be possible to have this fixed in the upcoming 4.2.11 release?


From: Jean-Baptiste Onofre 
Sent: Wednesday, March 3, 2021 2:50 AM
To: user 
Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing

Hi,

Yes, 90% of the use cases don’t need java.xml in lib/endorsed.

Regards
JB

Le 3 mars 2021 à 08:42, brock samson 
mailto:brock.sams...@hotmail.com>> a écrit :

Hi JB

I know you are quite busy so no need to apologize.

Just to make sure I understood you correctly, the 
org.apache.karaf.specs.java.xml-4.2.10.jar can be permanently removed from the 
/endorsed dir without any negative side effects, right?


From: Jean-Baptiste Onofre mailto:j...@nanthrax.net>>
Sent: Wednesday, March 3, 2021 12:14 AM
To: user mailto:user@karaf.apache.org>>
Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing

Hi Brock,

Sorry for the very late answer.

The reason why javax.xml is in lib/endorsed folder is because core Karaf loads 
just the spec and let you install the impl.
Anyway, you can remove it from endorsed and install bundles, it works as well.
It’s basically what we plan to do by default as part of KARAF-6703.

Regards
JB

Le 3 mars 2021 à 05:50, brock samson 
mailto:brock.sams...@hotmail.com>> a écrit :

Hi João

Thank you for looking into this issue. Its nice to know it no longer appears in 
karaf 4.3, but is there another way to resolve this in 4.2.10 without changing 
the code? More specifically, is there a reason why 
org.apache.karaf.specs.java.xml-4.2.10.jar resides in the /endorsed directory 
as opposed to being exposed by a bundle? The reason for me asking is because 
the bundle approach would allow me to choose which implementation my bundle 
would reference, while the current endorsed approach leaves me no choice.

Regards,

Brock



From: João Assunção 
mailto:joao.assun...@exploitsys.com>>
Sent: Tuesday, March 2, 2021 5:28 PM
To: user@karaf.apache.org 
mailto:user@karaf.apache.org>>
Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing

Hi Brock,

I tried your jar but it failed due to the layout of the jar (the MANIFEST was 
not the first entry in the jar or something like that). I created a bundle with 
our code and when I tried with karaf 4.3 it passed.
I then tried with 4.2.7 and I experienced the same NPE. Apparently the behavior 
when the errorHandler is set to null is different between implementations of 
the XML libs supplied in these two versions of karaf.
In your code setting the error handler to builder.setErrorHandler(new 
org.xml.sax.helpers.DefaultHandler()); seems to do the trick.

I noticed your manifest is importing a bunch of packages not required for the 
code in question.

Regards
João Assunção

Email: joao.assun...@exploitsys.com
Mobile: +351 916968984
Phone: +351 211933149
Web: www.exploitsys.com




On Tue, Mar 2, 2021 at 3:33 AM brock samson 
mailto:brock.sams...@hotmail.com>> wrote:
hi, JB. did you get a chance to run my bundle?



From: brock samson mailto:brock.sams...@hotmail.com>>
Sent: Wednesday, February 24, 2021, 11:18 PM
To: user@karaf.apache.org
Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing

hi, JB.

thank you for looking at this. The attached zip (rename its extension from .txt 
to .zip) contains both the bundle (rename its extension from .txt to .jar) and 
its feature file. the bundle should be placed in the /bundles dir, and you know 
what to do with the feature file =)
here are some points regarding the bundle:
1) the bundle executes automatically during Karaf startup to make it easier for 
you.
2) The bundle contains both the schema and the xml, so you dont have to really 
do anything to the bundle itself in order for it to just run
3) The bundle contains props.properties where you can specify external 
locations to both schema and xml file if you choose to do so for any reason. 
The provided files will be ignored in such case.
4) I have also provided the source .java alongside the binary just in case.

again, really appreciate you taking the time to look at it. thanks!!!

Brock Samson



From: Jean-Baptiste Onofre mailto:j...@nanthrax.net>>
Sent: Tuesday, February 23, 2021 11:56 AM
To: user@karaf.apache.org 
mailto:user@karaf.apache.org>>
Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing

Hi Brock,

Maybe you have xerces installed as bundle in your distribution ?

It sounds like a version mismatch.

Can you share the bundles installed ?

Thanks,
Regards
JB

Le 23 févr. 2021 à 16:55, brock samson 
mailto:brock.sams...@hotmail.com>> a écrit :

Hello,

I am using Karaf 4.2.10 and attempting to perform a rather simple xml parsing:

Caused by: java.lang.NullPointerException
 

Re: Strange error when re-installing a feature on 4.3.0

2021-03-03 Thread Oleg Cohen
Hi JB,

Yes, just doing install for the previously and successfully installed feature. 
I think before the behavior was to perform an update/upgrade.

Thank you!
Oleg

> On Mar 3, 2021, at 12:09 AM, Jean-Baptiste Onofre  wrote:
> 
> Hi Oleg,
> 
> Does it mean you do feature:install while the feature is already installed ? 
> So, you might have some refresh happening.
> 
> It remembers me a Jira we have (related to Felix Framework) about the 
> "system/JDK" packages (let me looking for the Jira).
> 
> Regards
> JB
> 
>> Le 3 mars 2021 à 01:05, Oleg Cohen > > a écrit :
>> 
>> Greetings,
>> 
>> I am getting the following error when I run feature:install for the feature 
>> that was previously installed. It also happens when I run install on a 
>> feature that lists the previously installed feature as its dependency.
>> 
>> Error executing command: Unable to resolve root: missing requirement [root] 
>> osgi.identity; osgi.identity=bundle; type=karaf.feature; 
>> version="[4.3.0,4.3.0]"; 
>> filter:="(&(osgi.identity=bundle)(type=karaf.feature)(version>=4.3.0)(version<=4.3.0))"
>>  [caused by: Unable to resolve bundle/4.3.0: missing requirement 
>> [bundle/4.3.0] osgi.identity; osgi.identity=org.apache.karaf.bundle.core; 
>> type=osgi.bundle; version="[4.3.0,4.3.0]"; resolution:=mandatory [caused by: 
>> Unable to resolve org.apache.karaf.bundle.core/4.3.0: missing requirement 
>> [org.apache.karaf.bundle.core/4.3.0] osgi.wiring.package; 
>> filter:="(osgi.wiring.package=javax.management)"]]
>> 
>> Thank you!
>> Oleg
>> 
>> -- 
>> Oleg Cohen  |  Principal  |  A S S U R E B R I D G E
>> Office: +1 617 564 0737 <>  |  Mobile: +1 617 455 7927 <>  |  Fax: +1 888 
>> 409 6995 <>
>> Email: oleg.co...@assurebridge.com   |  
>> www.assurebridge.com 



Re: feature:install hangs, how to troubleshoot??

2021-03-03 Thread Oleg Cohen
Hi JB,

Ran with -t -v and the behavior was the same. Feels like some kind of infinite 
loop, but all was very quiet.

Thank you,
Oleg

> On Mar 3, 2021, at 12:05 AM, Jean-Baptiste Onofre  wrote:
> 
> Hi Oleg,
> 
> Did you try feature:install -t -v (to do a "simulate") ?
> 
> You might have message from the resolver in the log.
> 
> Regards
> JB
> 
>> Le 2 mars 2021 à 20:30, Oleg Cohen > > a écrit :
>> 
>> Greetings,
>> 
>> I am using version 4.3.0. I have a top-level feature that depends on other 
>> features.
>> 
>> When I run feature:install -r -v FEATURE, it sits there for a long while and 
>> then blows up with an OutOfMemory exception. Is there any way to get logging 
>> for what is taking place? Would appreciate any idea on how to troubleshoot 
>> the issue.
>> 
>> Thank you,
>> Oleg
>> 
>> -- 
>> Oleg Cohen  |  Principal  |  A S S U R E B R I D G E
>> Office: +1 617 564 0737 <>  |  Mobile: +1 617 455 7927 <>  |  Fax: +1 888 
>> 409 6995 <>
>> Email: oleg.co...@assurebridge.com   |  
>> www.assurebridge.com 



Build Issue

2021-03-03 Thread Matthias Leinweber
Hello Karafers,

i have a very strange build issue with assembly plugin.
I can build my package on my machine, on my machine inside a container
using podman as well as submitting my dockerfile to a kaniko builder. A
colleague of mine can also build it on his machine. With our internal
artifactory as well as with maven.repo.org (proxy).

However as soon as we try to build inside our kubernetes it fails with
changing the dependencies somehow randomly changes the missing package

[ERROR] Failed to execute goal
org.apache.karaf.tooling:karaf-maven-plugin:4.3.0:assembly
(default-assembly) on project rahla: Unable to build assembly:
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root:
missing requirement [root] osgi.identity; osgi.identity=service-security;
type=karaf.feature; version=4.3.0;
filter:="(&(osgi.identity=service-security)(type=karaf.feature)(version>=4.3.0))"
[caused by: Unable to resolve service-security/4.3.0: missing requirement
[service-security/4.3.0] osgi.identity; osgi.identity=aries-proxy;
type=karaf.feature [caused by: Unable to resolve aries-proxy/4.3.0: missing
requirement [aries-proxy/4.3.0] osgi.identity;
osgi.identity=org.apache.aries.proxy; type=osgi.bundle;
version="[1.1.8,1.1.8]"; resolution:=mandatory [caused by: Unable to
resolve org.apache.aries.proxy/1.1.8: missing requirement
[org.apache.aries.proxy/1.1.8] osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.slf4j)(version>=1.7.0)(!(version>=2.0.0)))"]]]
-> [Help 1]

We are building inside kubernetes using maven:3.6.3-jdk-11 as build image.
Same which i am using locally.

Do you have any ideas/hints how i could debug this?

br,
Matthias