Re: Karaf 4.2.10 - NullPointerException during xml parsing

2021-03-04 Thread brock samson
sounds good

From: Jean-Baptiste Onofre 
Sent: Wednesday, March 3, 2021 10:47:26 PM
To: user 
Subject: Re: Karaf 4.2.10 - NullPointerException during xml parsing

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 
mailto:brock.sams...@hotmail.com>> a écrit :

would it be possible to have this fixed in the upcoming 4.2.11 release?


From: Jean-Baptiste Onofre mailto:j...@nanthrax.net>>
Sent: Wednesday, March 3, 2021 2:50 AM
To: user mailto:user@karaf.apache.org>>
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, 

Re: Need some help with running the HTTP example in the code base

2021-03-04 Thread Som Shankar Bhattacharyya
thank you very much for the quick response. I will keep you posted.

On Thu, Mar 4, 2021 at 9:24 PM Jean-Baptiste Onofre  wrote:
>
> Just to be clear
>
> 1. Download Karaf 4.2.10
> 2. Then use Karaf 4.2.10 example like this:
>
> feature:repo-add 
> mv:org.apache.karaf.examples/karaf-rest-example-features/4.2.10/xml
> feature:install http
> feature:install karaf-rest-example-scr
>
> Regards
> JB
>
> Le 4 mars 2021 à 16:41, Som Shankar Bhattacharyya 
>  a écrit :
>
> Hello,
>
> So I am trying to set up a http example on karaf using JaxRS.
> While following the instructions I am running into certain issues that I am 
> not sure how to proceed with.
>
> I am using Karaf version 4.1.3
> I do a maven clean install using the code in 
> https://github.com/apache/karaf/tree/master/examples/karaf-rest-example
> I do a feature:repo-add 
> mvn:org.apache.karaf.examples/karaf-rest-example-features/LATEST/xml
>
> I get this error ,
>
> Error executing command: Unable to resolve root: missing requirement [root] 
> osgi.identity; osgi.identity=http; type=karaf.feature; 
> version="[7.3.13,7.3.13]"; 
> filter:="(&(osgi.identity=http)(type=karaf.feature)(version>=7.3.13)(version<=7.3.13))"
>  [caused by: Unable to resolve http/7.3.13: missing requirement [http/7.3.13] 
> osgi.identity; osgi.identity=pax-web-http; type=karaf.feature [caused by: 
> Unable to resolve pax-web-http/7.3.13: missing requirement 
> [pax-web-http/7.3.13] osgi.identity; 
> osgi.identity=org.apache.karaf.http.core; type=osgi.bundle; 
> version="[4.3.1.SNAPSHOT,4.3.1.SNAPSHOT]"; resolution:=mandatory [caused by: 
> Unable to resolve org.apache.karaf.http.core/4.3.1.SNAPSHOT: missing 
> requirement [org.apache.karaf.http.core/4.3.1.SNAPSHOT] osgi.wiring.package; 
> filter:="(&(osgi.wiring.package=org.osgi.service.cm)(version>=1.6.0)(!(version>=2.0.0)))"]]]
>
> I am a newbie to Karaf and am having difficulty in understanding this error. 
> Do I need to install something else ?
>
>


Re: Need some help with running the HTTP example in the code base

2021-03-04 Thread Jean-Baptiste Onofre
Just to be clear

1. Download Karaf 4.2.10
2. Then use Karaf 4.2.10 example like this:

feature:repo-add 
mv:org.apache.karaf.examples/karaf-rest-example-features/4.2.10/xml
feature:install http
feature:install karaf-rest-example-scr

Regards
JB

> Le 4 mars 2021 à 16:41, Som Shankar Bhattacharyya 
>  a écrit :
> 
> Hello,
> 
> So I am trying to set up a http example on karaf using JaxRS.
> While following the instructions I am running into certain issues that I am 
> not sure how to proceed with.
> 
> I am using Karaf version 4.1.3
> I do a maven clean install using the code in 
> https://github.com/apache/karaf/tree/master/examples/karaf-rest-example 
> 
> I do a feature:repo-add 
> mvn:org.apache.karaf.examples/karaf-rest-example-features/LATEST/xml
> I get this error ,
> 
> Error executing command: Unable to resolve root: missing requirement [root] 
> osgi.identity; osgi.identity=http; type=karaf.feature; 
> version="[7.3.13,7.3.13]"; 
> filter:="(&(osgi.identity=http)(type=karaf.feature)(version>=7.3.13)(version<=7.3.13))"
>  [caused by: Unable to resolve http/7.3.13: missing requirement [http/7.3.13] 
> osgi.identity; osgi.identity=pax-web-http; type=karaf.feature [caused by: 
> Unable to resolve pax-web-http/7.3.13: missing requirement 
> [pax-web-http/7.3.13] osgi.identity; 
> osgi.identity=org.apache.karaf.http.core; type=osgi.bundle; 
> version="[4.3.1.SNAPSHOT,4.3.1.SNAPSHOT]"; resolution:=mandatory [caused by: 
> Unable to resolve org.apache.karaf.http.core/4.3.1.SNAPSHOT: missing 
> requirement [org.apache.karaf.http.core/4.3.1.SNAPSHOT] osgi.wiring.package; 
> filter:="(&(osgi.wiring.package=org.osgi.service.cm 
> )(version>=1.6.0)(!(version>=2.0.0)))"]]]
> 
> I am a newbie to Karaf and am having difficulty in understanding this error. 
> Do I need to install something else ?
> 



Re: Need some help with running the HTTP example in the code base

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

The LATEST example only run on Karaf 4.3.x.

I suggest to use at least Karaf 4.2.x and use the example corresponding to the 
Karaf version.

Regards
JB

> Le 4 mars 2021 à 16:41, Som Shankar Bhattacharyya 
>  a écrit :
> 
> 



Need some help with running the HTTP example in the code base

2021-03-04 Thread Som Shankar Bhattacharyya
Hello,

So I am trying to set up a http example on karaf using JaxRS.
While following the instructions I am running into certain issues that I am
not sure how to proceed with.


   1. I am using Karaf version *4.1.3*
   2. I do a *maven clean install* using the code in
   https://github.com/apache/karaf/tree/master/examples/karaf-rest-example
   3. I do a f*eature:repo-add
   mvn:org.apache.karaf.examples/karaf-rest-example-features/LATEST/xml*

*I get this error ,*

Error executing command: Unable to resolve root: missing requirement [root]
osgi.identity; osgi.identity=http; type=karaf.feature;
version="[7.3.13,7.3.13]";
filter:="(&(osgi.identity=http)(type=karaf.feature)(version>=7.3.13)(version<=7.3.13))"
[caused by: Unable to resolve http/7.3.13: missing requirement
[http/7.3.13] osgi.identity; osgi.identity=pax-web-http; type=karaf.feature
[caused by: Unable to resolve pax-web-http/7.3.13: missing requirement
[pax-web-http/7.3.13] osgi.identity;
osgi.identity=org.apache.karaf.http.core; type=osgi.bundle;
version="[4.3.1.SNAPSHOT,4.3.1.SNAPSHOT]"; resolution:=mandatory [caused
by: Unable to resolve org.apache.karaf.http.core/4.3.1.SNAPSHOT: missing
requirement [org.apache.karaf.http.core/4.3.1.SNAPSHOT]
osgi.wiring.package; filter:="(&(osgi.wiring.package=org.osgi.service.cm
)(version>=1.6.0)(!(version>=2.0.0)))"]]]

I am a newbie to Karaf and am having difficulty in understanding this
error. Do I need to install something else ?


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

2021-03-04 Thread Jean-Baptiste Onofre
Hi Oleg,

Can you please etc/org.ops4j.pax.logging.cfg with this:

log4j2.logger.featureservice.name = org.apache.karaf.features
log4j2.logger.featureservice.level = DEBUG

And send the karaf.log to me ?

Thanks,
Regards
JB

> Le 4 mars 2021 à 12:19, Oleg Cohen  a écrit :
> 
> I did’t change any logging levels. How do I set the features service logging 
> to DEBUG?
> 
> Thank you!
> Oleg
> 
>> On Mar 3, 2021, at 11:44 PM, Jean-Baptiste Onofre > > wrote:
>> 
>> 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: feature:install hangs, how to troubleshoot??

2021-03-04 Thread Oleg Cohen
I did’t change any logging levels. How do I set the features service logging to 
DEBUG?

Thank you!
Oleg

> On Mar 3, 2021, at 11:44 PM, Jean-Baptiste Onofre  wrote:
> 
> 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-04 Thread Matthias Leinweber
My plugin configuration looks actually like (i removed my own feature)

thats my pom .. karaf bundle plgin extensions is set to true in parent pom

  
false
false
UTF-8
  

  

  
maven-install-plugin

  true

org.apache.maven.plugins
  
  
karaf-maven-plugin

  false
  false
  
standard
  
  
wrapper
aries-blueprint
shell-compat
  
  11
  
  
eventadmin
  

org.apache.karaf.tooling
  


  
src/main/resources
false

  **/*

  
  
src/main/filtered-resources
true

  **/*

  

  


  

  framework
  org.apache.karaf.features
  kar


  standard
  features
  org.apache.karaf.features
  xml


  framework
  features
  org.apache.karaf.features
  runtime
  xml


  enterprise
  features
  org.apache.karaf.features
  runtime
  xml



  






[INFO]Loading startup repositories
[INFO]Resolving startup features and bundles
[INFO]   Features: framework, framework-security/4.3.0,
service-security/4.3.0, aries-proxy/4.3.0, aries-blueprint/4.3.0,
feature/4.3.0, jaas-boot/4.3.0, shell/4.3.0, jline/3.16.0,
shell-compat/4.3.0, deployer/4.3.0, wrapper/4.3.0, service-wrapper/4.3.0,
obr/4.3.0, bundle/4.3.0, config/4.3.0, diagnostic/4.3.0, instance/4.3.0,
jaas-deployer/4.3.0, jaas/4.3.0, log/4.3.0, package/4.3.0, service/4.3.0,
system/4.3.0, felix-httplite/0.1.6, felix-http/4.1.2, pax-web-http/7.3.9,
http/7.3.9, pax-web-http-whiteboard/7.3.9, http-whiteboard/7.3.9,
pax-web-war/4.3.0, war/4.3.0, kar/4.3.0, webconsole/4.3.0, ssh/4.3.0,
management/4.3.0, scheduler/4.3.0, eventadmin/4.3.0,
jasypt-encryption/4.3.0, scr/4.3.0, blueprint-web/4.3.0, wrap/2.6.2,
profile/4.3.0, jolokia/1.6.2, maven/4.3.0, audit-log/4.3.0,
documentation/4.3.0, standard/4.3.0, minimal/4.3.0
[INFO]   Bundles:


br,
Matthias

Am Do., 4. März 2021 um 05:44 Uhr schrieb Jean-Baptiste Onofre <
j...@nanthrax.net>:

> 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
>
>
>