You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by "Siano, Stephan" <st...@sap.com> on 2018/09/06 12:14:50 UTC
org.apache.karaf.specs.locator on Karaf 4.2.1
Hi,
with Karaf 4.2.0 Guillaume Nodet introduced some mechanism around the org.apache.karaf.specs.activator bundle that allowed the lookup of registered service implementations (like woodstox for the Stax-API) in Karaf 4.2.0.
With 4.2.1 the jar is gone from the boot classpath (with two commits with Freeman Fang that say "ensure Karaf can build and run with JDK11/JDK10").
So with Karaf 4.2.1 the lookup for the Woodstox does not work anymore (probably because of that).
Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:97)
at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:74)
at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:129)
at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106)
at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:52)
at javax.xml.stream.XMLInputFactory.newFactory(XMLInputFactory.java:57)
at ...
... 1 common frames omitted
Caused by: java.lang.ClassNotFoundException: com/ctc/wstx/stax/WstxInputFactory
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forNameFW(Class.java:357)
at java.lang.Class.forName(Class.java:350)
at javax.xml.stream.$FactoryFinder.getProviderClass($FactoryFinder.java:64)
at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:87)
... 12 common frames omitted
Was that bundle removed on purpose from the boot classpath, or was this just an accident? Other bundles related to this are still there (except org.apache.karaf.specs.java.xml.ws which was removed from the lib/endorsed directory).
Best regards
Stephan
RE: org.apache.karaf.specs.locator on Karaf 4.2.1
Posted by "Siano, Stephan" <st...@sap.com>.
Hi,
Thanks for the confirmation. I already added the two bundles to my custom distribution, so it works for me, but I wondered if the bundles were missed out by accident or on purpose, so I asked on this list before creating an issue in JIRA.
Best regards
Stephan
-----Original Message-----
From: Freeman Fang <fr...@gmail.com>
Sent: Freitag, 7. September 2018 10:07
To: dev@karaf.apache.org
Subject: Re: org.apache.karaf.specs.locator on Karaf 4.2.1
Hi Stephan,
Thanks!
Yes, I can reproduce and this is a bug I need to fix. And this is fixed by KARAF-5897[1].
For now, as a workaround, you can download [2] and copy it to $KARAF_HOME/lib/boot folder then it should work.
Sorry for any inconvenience.
[1]https://issues.apache.org/jira/browse/KARAF-5897
[2]http://repo2.maven.org/maven2/org/apache/karaf/specs/org.apache.karaf.specs.activator/4.2.1/org.apache.karaf.specs.activator-4.2.1.jar
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
> On Sep 6, 2018, at 10:05 PM, Siano, Stephan <st...@sap.com> wrote:
>
> Hi,
>
> I am using JDK 8 (and a custom karaf distribution). However it should not be so difficult to reproduce:
> 1. Install Woodstox on the system (e.g. mvn:org.codehaus.woodstox/stax2-api/3.1.4 and mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1) (I am aware that these are not the latest version, but that should actually not matter) What does matter is that the woodstox-core-asl bundle contains a directory META-INF/services with files like javax.xml.stream.XMLInputFactory containing the class name of the factory implementation provided by this bundle.
> 2. set a set of system properties
> javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory
> javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
> javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory
> when you restart your karaf. The system property and the value should match name and the content of the files in META-INF/services of the woodstox bundle. Note: for the operation of the feature to look up the factory this is not necessary, but if you don't set these properties, the lookup in the next step will just return the JDK implementation of the factory, which might work but is not desired in this case.
> 3. have another bundle that does not import the Woodstox implementation packages (only javax.xml.stream). Call the static method javax.xml.stream.XMLInputFactory.newFactory() from this bundle. This should give you an instance of the com.ctc.wstx.stax.WstxInputFactory (when woodstox is installed).
>
> Best regards
> Stephan
>
> -----Original Message-----
> From: Freeman Fang <fr...@gmail.com>
> Sent: Donnerstag, 6. September 2018 15:44
> To: dev@karaf.apache.org
> Subject: Re: org.apache.karaf.specs.locator on Karaf 4.2.1
>
> Hi Stephan,
>
> What’s the JDK version you are using?
> And could you please tell me the steps to reproduce this error?
>
> I want to reproduce it and take a close look.
>
> Thanks!
>
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
>
>
>
>> On Sep 6, 2018, at 8:14 PM, Siano, Stephan <st...@sap.com> wrote:
>>
>> Hi,
>>
>> with Karaf 4.2.0 Guillaume Nodet introduced some mechanism around the org.apache.karaf.specs.activator bundle that allowed the lookup of registered service implementations (like woodstox for the Stax-API) in Karaf 4.2.0.
>>
>> With 4.2.1 the jar is gone from the boot classpath (with two commits with Freeman Fang that say "ensure Karaf can build and run with JDK11/JDK10").
>> So with Karaf 4.2.1 the lookup for the Woodstox does not work anymore (probably because of that).
>>
>> Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
>> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:97)
>> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:74)
>> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:129)
>> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106)
>> at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:52)
>> at javax.xml.stream.XMLInputFactory.newFactory(XMLInputFactory.java:57)
>> at ...
>> ... 1 common frames omitted
>> Caused by: java.lang.ClassNotFoundException: com/ctc/wstx/stax/WstxInputFactory
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forNameFW(Class.java:357)
>> at java.lang.Class.forName(Class.java:350)
>> at javax.xml.stream.$FactoryFinder.getProviderClass($FactoryFinder.java:64)
>> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:87)
>> ... 12 common frames omitted
>>
>>
>> Was that bundle removed on purpose from the boot classpath, or was this just an accident? Other bundles related to this are still there (except org.apache.karaf.specs.java.xml.ws which was removed from the lib/endorsed directory).
>>
>> Best regards
>> Stephan
>
Re: org.apache.karaf.specs.locator on Karaf 4.2.1
Posted by Freeman Fang <fr...@gmail.com>.
Hi Stephan,
Thanks!
Yes, I can reproduce and this is a bug I need to fix. And this is fixed by KARAF-5897[1].
For now, as a workaround, you can download [2] and copy it to $KARAF_HOME/lib/boot folder then it should work.
Sorry for any inconvenience.
[1]https://issues.apache.org/jira/browse/KARAF-5897
[2]http://repo2.maven.org/maven2/org/apache/karaf/specs/org.apache.karaf.specs.activator/4.2.1/org.apache.karaf.specs.activator-4.2.1.jar
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
> On Sep 6, 2018, at 10:05 PM, Siano, Stephan <st...@sap.com> wrote:
>
> Hi,
>
> I am using JDK 8 (and a custom karaf distribution). However it should not be so difficult to reproduce:
> 1. Install Woodstox on the system (e.g. mvn:org.codehaus.woodstox/stax2-api/3.1.4 and mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1) (I am aware that these are not the latest version, but that should actually not matter) What does matter is that the woodstox-core-asl bundle contains a directory META-INF/services with files like javax.xml.stream.XMLInputFactory containing the class name of the factory implementation provided by this bundle.
> 2. set a set of system properties
> javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory
> javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
> javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory
> when you restart your karaf. The system property and the value should match name and the content of the files in META-INF/services of the woodstox bundle. Note: for the operation of the feature to look up the factory this is not necessary, but if you don't set these properties, the lookup in the next step will just return the JDK implementation of the factory, which might work but is not desired in this case.
> 3. have another bundle that does not import the Woodstox implementation packages (only javax.xml.stream). Call the static method javax.xml.stream.XMLInputFactory.newFactory() from this bundle. This should give you an instance of the com.ctc.wstx.stax.WstxInputFactory (when woodstox is installed).
>
> Best regards
> Stephan
>
> -----Original Message-----
> From: Freeman Fang <fr...@gmail.com>
> Sent: Donnerstag, 6. September 2018 15:44
> To: dev@karaf.apache.org
> Subject: Re: org.apache.karaf.specs.locator on Karaf 4.2.1
>
> Hi Stephan,
>
> What’s the JDK version you are using?
> And could you please tell me the steps to reproduce this error?
>
> I want to reproduce it and take a close look.
>
> Thanks!
>
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
>
>
>
>> On Sep 6, 2018, at 8:14 PM, Siano, Stephan <st...@sap.com> wrote:
>>
>> Hi,
>>
>> with Karaf 4.2.0 Guillaume Nodet introduced some mechanism around the org.apache.karaf.specs.activator bundle that allowed the lookup of registered service implementations (like woodstox for the Stax-API) in Karaf 4.2.0.
>>
>> With 4.2.1 the jar is gone from the boot classpath (with two commits with Freeman Fang that say "ensure Karaf can build and run with JDK11/JDK10").
>> So with Karaf 4.2.1 the lookup for the Woodstox does not work anymore (probably because of that).
>>
>> Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
>> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:97)
>> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:74)
>> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:129)
>> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106)
>> at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:52)
>> at javax.xml.stream.XMLInputFactory.newFactory(XMLInputFactory.java:57)
>> at ...
>> ... 1 common frames omitted
>> Caused by: java.lang.ClassNotFoundException: com/ctc/wstx/stax/WstxInputFactory
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forNameFW(Class.java:357)
>> at java.lang.Class.forName(Class.java:350)
>> at javax.xml.stream.$FactoryFinder.getProviderClass($FactoryFinder.java:64)
>> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:87)
>> ... 12 common frames omitted
>>
>>
>> Was that bundle removed on purpose from the boot classpath, or was this just an accident? Other bundles related to this are still there (except org.apache.karaf.specs.java.xml.ws which was removed from the lib/endorsed directory).
>>
>> Best regards
>> Stephan
>
RE: org.apache.karaf.specs.locator on Karaf 4.2.1
Posted by "Siano, Stephan" <st...@sap.com>.
Hi,
I am using JDK 8 (and a custom karaf distribution). However it should not be so difficult to reproduce:
1. Install Woodstox on the system (e.g. mvn:org.codehaus.woodstox/stax2-api/3.1.4 and mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1) (I am aware that these are not the latest version, but that should actually not matter) What does matter is that the woodstox-core-asl bundle contains a directory META-INF/services with files like javax.xml.stream.XMLInputFactory containing the class name of the factory implementation provided by this bundle.
2. set a set of system properties
javax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory
javax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
javax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory
when you restart your karaf. The system property and the value should match name and the content of the files in META-INF/services of the woodstox bundle. Note: for the operation of the feature to look up the factory this is not necessary, but if you don't set these properties, the lookup in the next step will just return the JDK implementation of the factory, which might work but is not desired in this case.
3. have another bundle that does not import the Woodstox implementation packages (only javax.xml.stream). Call the static method javax.xml.stream.XMLInputFactory.newFactory() from this bundle. This should give you an instance of the com.ctc.wstx.stax.WstxInputFactory (when woodstox is installed).
Best regards
Stephan
-----Original Message-----
From: Freeman Fang <fr...@gmail.com>
Sent: Donnerstag, 6. September 2018 15:44
To: dev@karaf.apache.org
Subject: Re: org.apache.karaf.specs.locator on Karaf 4.2.1
Hi Stephan,
What’s the JDK version you are using?
And could you please tell me the steps to reproduce this error?
I want to reproduce it and take a close look.
Thanks!
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
> On Sep 6, 2018, at 8:14 PM, Siano, Stephan <st...@sap.com> wrote:
>
> Hi,
>
> with Karaf 4.2.0 Guillaume Nodet introduced some mechanism around the org.apache.karaf.specs.activator bundle that allowed the lookup of registered service implementations (like woodstox for the Stax-API) in Karaf 4.2.0.
>
> With 4.2.1 the jar is gone from the boot classpath (with two commits with Freeman Fang that say "ensure Karaf can build and run with JDK11/JDK10").
> So with Karaf 4.2.1 the lookup for the Woodstox does not work anymore (probably because of that).
>
> Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:97)
> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:74)
> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:129)
> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106)
> at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:52)
> at javax.xml.stream.XMLInputFactory.newFactory(XMLInputFactory.java:57)
> at ...
> ... 1 common frames omitted
> Caused by: java.lang.ClassNotFoundException: com/ctc/wstx/stax/WstxInputFactory
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forNameFW(Class.java:357)
> at java.lang.Class.forName(Class.java:350)
> at javax.xml.stream.$FactoryFinder.getProviderClass($FactoryFinder.java:64)
> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:87)
> ... 12 common frames omitted
>
>
> Was that bundle removed on purpose from the boot classpath, or was this just an accident? Other bundles related to this are still there (except org.apache.karaf.specs.java.xml.ws which was removed from the lib/endorsed directory).
>
> Best regards
> Stephan
Re: org.apache.karaf.specs.locator on Karaf 4.2.1
Posted by Freeman Fang <fr...@gmail.com>.
Hi Stephan,
What’s the JDK version you are using?
And could you please tell me the steps to reproduce this error?
I want to reproduce it and take a close look.
Thanks!
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
> On Sep 6, 2018, at 8:14 PM, Siano, Stephan <st...@sap.com> wrote:
>
> Hi,
>
> with Karaf 4.2.0 Guillaume Nodet introduced some mechanism around the org.apache.karaf.specs.activator bundle that allowed the lookup of registered service implementations (like woodstox for the Stax-API) in Karaf 4.2.0.
>
> With 4.2.1 the jar is gone from the boot classpath (with two commits with Freeman Fang that say "ensure Karaf can build and run with JDK11/JDK10").
> So with Karaf 4.2.1 the lookup for the Woodstox does not work anymore (probably because of that).
>
> Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:97)
> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:74)
> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:129)
> at javax.xml.stream.$FactoryFinder.find($FactoryFinder.java:106)
> at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:52)
> at javax.xml.stream.XMLInputFactory.newFactory(XMLInputFactory.java:57)
> at ...
> ... 1 common frames omitted
> Caused by: java.lang.ClassNotFoundException: com/ctc/wstx/stax/WstxInputFactory
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forNameFW(Class.java:357)
> at java.lang.Class.forName(Class.java:350)
> at javax.xml.stream.$FactoryFinder.getProviderClass($FactoryFinder.java:64)
> at javax.xml.stream.$FactoryFinder.newInstance($FactoryFinder.java:87)
> ... 12 common frames omitted
>
>
> Was that bundle removed on purpose from the boot classpath, or was this just an accident? Other bundles related to this are still there (except org.apache.karaf.specs.java.xml.ws which was removed from the lib/endorsed directory).
>
> Best regards
> Stephan