Quantcast

DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

ivoleitao
Hi !

I've created a custom karaf 4.1.0 distribution with the karaf maven plugin where I've added per configuration the following features:

<bootFeatures>
    <feature>standard</feature>
    <feature>scr</feature>
    <feature>http</feature>
    <feature>http-whiteboard</feature>
    <feature>webconsole</feature>
    <feature>cxf-dosgi-provider-rs</feature>
    <feature>cxf-dosgi-provider-ws</feature>
 </bootFeatures>

I've also added the same libraries that the default karaf 4.1 distribution adds (I' ve found the the link http://karaf.922171.n3.nabble.com/CXF-Dosgi-td4045786.html where that is mentioned) and checked that they are in the lib/endrosed folder of karaf

Concerning my use case, this is a simple rest service that internally calls a soap service. The problem is that as soon as the call is made I receive the following exception:
java.util.ServiceConfigurationError: javax.xml.stream.XMLOutputFactory: Provider com.ctc.wstx.stax.WstxOutputFactory not found
        at java.util.ServiceLoader.fail(ServiceLoader.java:239)
        at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
        at javax.xml.stream.FactoryFinder$1.run(FactoryFinder.java:353)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.xml.stream.FactoryFinder.findServiceProvider(FactoryFinder.java:341)
        at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:313)
        at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:227)
        at javax.xml.stream.XMLOutputFactory.newInstance(XMLOutputFactory.java:130)
        at org.apache.cxf.staxutils.StaxUtils.getXMLOutputFactory(StaxUtils.java:290)
        at org.apache.cxf.staxutils.StaxUtils.createXMLStreamWriter(StaxUtils.java:398)
        at org.apache.cxf.interceptor.StaxOutInterceptor.handleMessage(StaxOutInterceptor.java:82)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
        at com.sun.proxy.$Proxy117.getGeoIPContext(Unknown Source)

I've looked at org.apache.cxf.staxutils.StaxUtils.getXMLOutputFactory and I've retrieved the following code, that I've added to the bundle that calls the webservice to isolate the error:

                XMLOutputFactory xof = null;
                try {
                        error("#### INSTANCING XOF ####");
                        xof = XMLOutputFactory.newInstance();
                        error("#### XOF INSTANCED ####");
                        String xofClassName = xof.getClass().getName();
                        error("#### XOF CLASSNAME: {} ####", xofClassName);
                        if (!xofClassName.contains("ctc.wstx") && !xofClassName.contains("xml.xlxp")
                                        && !xofClassName.contains("xml.xlxp2") && !xofClassName.contains("bea.core")) {
                                xof = null;
                        }
                } catch (Throwable t) {
                        // ignore, can always drop down to the pooled factories
                        error("################## ERROR #####################", t);
                }

This line xof = XMLOutputFactory.newInstance(); gives me an immediate error and the pooled factories do not work also. Actually this fails later in StaxUtils method of cxf at the f = XMLOutputFactory.newInstance(); per stacktrace above:

private static XMLOutputFactory getXMLOutputFactory() {
        if (SAFE_OUTPUT_FACTORY != null) {
            return SAFE_OUTPUT_FACTORY;
        }
        XMLOutputFactory f = OUTPUT_FACTORY_POOL.poll();
        if (f == null) {
            f = XMLOutputFactory.newInstance();
        }
        return f;
    }

I've checked that I have Woodstox XML-processor i.e. woodstox-core-asl bundle with version 4.4.1 which is right according with cxf 3.1.7 (used by dosgi). Most curious is that I'm able to make this work perfectly with pax exam but it does not work with karaf...

Unfortunately I'm running out of ideas of how to handle this. Previously I've this working also in plain felix the diference was that I was using extension bundles and not libs on the endorsed folder. I've also commented those libraries in the configuration of the assembly and the result was the same...

Any idea what is causing the problem ?

Best Regards,
Ivo Leitão
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

ivoleitao
Just to add more detail to my report, this is the list of bundles that I currently have installed in karaf:

javax.annotation-api (1.2) "javax.annotation API" [active, 9]
javax.el-api (3.0.0) "Expression Language 3.0 API" [active, 10]
javax.mail (1.4.5) "JavaMail API (compat)" [active, 11]
javax.servlet-api (3.1.0) "Java Servlet API" [active, 12]
javax.websocket-api (1.1) "WebSocket server API" [active, 13]
org.apache.aries.blueprint.api (1.0.1) "Apache Aries Blueprint API" [active, 14]
org.apache.aries.blueprint.cm (1.0.9) "Apache Aries Blueprint CM" [active, 15]
org.apache.aries.blueprint.core (1.7.1) "Apache Aries Blueprint Core" [active, 16]
org.apache.aries.jmx.api (1.1.5) "Apache Aries JMX API" [active, 17]
org.apache.aries.jmx.blueprint.api (1.1.5) "Apache Aries JMX Blueprint API" [active, 18]
org.apache.aries.jmx.blueprint.core (1.1.5) "Apache Aries JMX Blueprint Core" [active, 19]
org.apache.aries.jmx.core (1.1.7) "Apache Aries JMX Core" [active, 20]
org.apache.aries.jmx.whiteboard (1.1.5) "Apache Aries Whiteboard support for JMX DynamicMBean services" [active, 21]
org.apache.aries.proxy.api (1.0.1) "Apache Aries Proxy API" [active, 22]
org.apache.aries.proxy.impl (1.0.6) "Apache Aries Proxy Service" [active, 23]
org.apache.aries.rsa.core (1.9.0) "Aries Remote Service Admin Core" [active, 24]
org.apache.aries.rsa.discovery.command (1.9.0) "Aries Remote Service Admin Discovery Gogo Commands" [active, 25]
org.apache.aries.rsa.spi (1.9.0) "Aries Remote Service Admin SPI" [active, 26]
org.apache.aries.rsa.topology-manager (1.9.0) "Aries Remote Service Admin Topology Manager" [active, 27]
org.apache.aries.spifly.dynamic.bundle (1.0.2) "Apache Aries SPI Fly Dynamic Weaving Bundle" [active, 28]
org.apache.aries.util (1.1.3) "Apache Aries Util" [active, 29]
org.apache.cxf.cxf-core (3.1.7) "Apache CXF Core" [active, 30]
org.apache.cxf.cxf-rt-bindings-soap (3.1.7) "Apache CXF Runtime SOAP Binding" [active, 31]
org.apache.cxf.cxf-rt-bindings-xml (3.1.7) "Apache CXF Runtime XML Binding" [active, 32]
org.apache.cxf.cxf-rt-databinding-aegis (3.1.7) "Apache CXF Runtime Aegis Databinding" [active, 33]
org.apache.cxf.cxf-rt-databinding-jaxb (3.1.7) "Apache CXF Runtime JAXB DataBinding" [active, 34]
org.apache.cxf.cxf-rt-frontend-jaxrs (3.1.7) "Apache CXF Runtime JAX-RS Frontend" [active, 35]
org.apache.cxf.cxf-rt-frontend-jaxws (3.1.7) "Apache CXF Runtime JAX-WS Frontend" [active, 36]
org.apache.cxf.cxf-rt-frontend-simple (3.1.7) "Apache CXF Runtime Simple Frontend" [active, 37]
org.apache.cxf.cxf-rt-management (3.1.7) "Apache CXF Runtime Management" [active, 38]
org.apache.cxf.cxf-rt-rs-client (3.1.7) "Apache CXF JAX-RS Client" [active, 39]
org.apache.cxf.cxf-rt-rs-extension-providers (3.1.7) "Apache CXF JAX-RS Extensions: Providers" [active, 40]
org.apache.cxf.cxf-rt-rs-extension-search (3.1.7) "Apache CXF JAX-RS Extensions: Search" [active, 41]
org.apache.cxf.cxf-rt-rs-service-description (3.1.7) "Apache CXF JAX-RS Service Description" [active, 42]
org.apache.cxf.cxf-rt-transports-http-jetty (3.1.7) "Apache CXF Runtime HTTP Jetty Transport" [active, 44]
org.apache.cxf.cxf-rt-transports-http (3.1.7) "Apache CXF Runtime HTTP Transport" [active, 43]
org.apache.cxf.cxf-rt-wsdl (3.1.7) "Apache CXF Runtime Core for WSDL" [active, 45]
org.apache.cxf.dosgi.cxf-dosgi-common (2.1.0) "CXF DOSGi Common" [active, 46]
org.apache.cxf.dosgi.cxf-dosgi-decorator (2.1.0) "CXF DOSGi Service decorator support" [active, 47]
org.apache.cxf.dosgi.cxf-dosgi-provider-rs (2.1.0) "CXF DOSGi provider rs" [active, 48]
org.apache.cxf.dosgi.cxf-dosgi-provider-ws (2.1.0) "CXF DOSGi provider ws" [active, 49]
org.apache.felix.configadmin (1.8.12) "Apache Felix Configuration Admin Service" [active, 5]
org.apache.felix.fileinstall (3.5.8) "Apache Felix File Install" [active, 6]
org.apache.felix.framework (5.6.1) "System Bundle" [active, 0]
org.apache.felix.inventory (1.0.4) "Apache Felix Inventory" [active, 50]
org.apache.felix.metatype (1.1.2) "Apache Felix Metatype Service" [active, 51]
org.apache.felix.scr.compat (1.0.4) "Apache Felix Declarative Services Compatibility Extension" [active, 53]
org.apache.felix.scr (2.0.8) "Apache Felix Declarative Services" [active, 52]
org.apache.felix.webconsole.plugins.ds (2.0.4) "Apache Felix Web Console Service Component Runtime/Declarative Services Plugin" [active, 54]
org.apache.geronimo.specs.geronimo-jaspic_1.0_spec (1.1) "Java Authentication SPI for Containers" [active, 55]
org.apache.geronimo.specs.geronimo-jta_1.1_spec (1.1.1) "geronimo-jta_1.1_spec" [active, 56]
org.apache.geronimo.specs.geronimo-osgi-registry (1.1) "Apache Geronimo OSGI factory registry" [active, 57]
org.apache.karaf.bundle.blueprintstate (4.1.0) "Apache Karaf :: Bundle :: BlueprintStateService" [active, 58]
org.apache.karaf.bundle.core (4.1.0) "Apache Karaf :: Bundle :: Core" [active, 59]
org.apache.karaf.config.core (4.1.0) "Apache Karaf :: ConfigAdmin :: Core" [active, 60]
org.apache.karaf.deployer.blueprint (4.1.0) "Apache Karaf :: Deployer :: Blueprint" [active, 61]
org.apache.karaf.deployer.features (4.1.0) "Apache Karaf :: Deployer :: Features" [active, 62]
org.apache.karaf.deployer.kar (4.1.0) "Apache Karaf :: Deployer :: Karaf Archive (.kar)" [active, 63]
org.apache.karaf.deployer.wrap (4.1.0) "Apache Karaf :: Deployer :: Wrap Non OSGi Jar" [active, 64]
org.apache.karaf.diagnostic.core (4.1.0) "Apache Karaf :: Diagnostic :: Core" [active, 65]
org.apache.karaf.features.command (4.1.0) "Apache Karaf :: Features :: Command" [active, 66]
org.apache.karaf.features.core (4.1.0) "Apache Karaf :: Features :: Core" [active, 7]
org.apache.karaf.features.extension (4.1.0) "Apache Karaf :: Features :: Extension" [resolved, 1] (fragment)
org.apache.karaf.http.core (4.1.0) "Apache Karaf :: HTTP :: Core" [active, 67]
org.apache.karaf.instance.core (4.1.0) "Apache Karaf :: Instance :: Core" [active, 68]
org.apache.karaf.jaas.blueprint.config (4.1.0) "Apache Karaf :: JAAS :: Blueprint :: Config" [active, 69]
org.apache.karaf.jaas.command (4.1.0) "Apache Karaf :: JAAS :: Command" [active, 70]
org.apache.karaf.jaas.config (4.1.0) "Apache Karaf :: JAAS :: Config" [active, 71]
org.apache.karaf.jaas.modules (4.1.0) "Apache Karaf :: JAAS :: Modules" [active, 72]
org.apache.karaf.kar.core (4.1.0) "Apache Karaf :: KAR :: Core" [active, 73]
org.apache.karaf.log.core (4.1.0) "Apache Karaf :: Log :: Core" [active, 74]
org.apache.karaf.management.server (4.1.0) "Apache Karaf :: Management" [active, 75]
org.apache.karaf.package.core (4.1.0) "Apache Karaf :: Package :: Core" [active, 76]
org.apache.karaf.scr.command (4.1.0) "Apache Karaf :: SCR :: Shell Commands" [active, 77]
org.apache.karaf.scr.management (4.1.0) "Apache Karaf :: SCR :: Management MBeans" [active, 78]
org.apache.karaf.scr.state (4.1.0) "Apache Karaf :: SCR :: Bundle State" [active, 79]
org.apache.karaf.service.core (4.1.0) "Apache Karaf :: Service :: Core" [active, 80]
org.apache.karaf.shell.commands (4.1.0) "Apache Karaf :: Shell :: Various Commands" [active, 81]
org.apache.karaf.shell.console (4.1.0) "Apache Karaf :: Shell :: Console" [resolved, 82] (fragment)
org.apache.karaf.shell.core (4.1.0) "Apache Karaf :: Shell :: Core" [active, 83]
org.apache.karaf.shell.ssh (4.1.0) "Apache Karaf :: Shell :: SSH" [active, 84]
org.apache.karaf.shell.table (4.1.0) "Apache Karaf :: Shell :: Table" [active, 85]
org.apache.karaf.system.core (4.1.0) "Apache Karaf :: System :: Core" [active, 86]
org.apache.karaf.webconsole.console (4.1.0) "Apache Karaf :: Web Console :: Console" [active, 87]
org.apache.karaf.webconsole.features (4.1.0) "Apache Karaf :: Web Console :: Features Plugin" [active, 88]
org.apache.karaf.webconsole.gogo (4.1.0) "Apache Karaf :: Web Console :: Gogo Plugin" [active, 89]
org.apache.karaf.webconsole.http (4.1.0) "Apache Karaf :: Web Console :: HTTP Plugin" [active, 90]
org.apache.karaf.webconsole.instance (4.1.0) "Apache Karaf :: Web Console :: Instance Plugin" [active, 91]
org.apache.servicemix.bundles.fastinfoset (1.2.13.1) "Apache ServiceMix :: Bundles :: FastInfoset" [active, 92]
org.apache.servicemix.bundles.jaxb-impl (2.2.11.1) "Apache ServiceMix :: Bundles :: jaxb-impl" [active, 93]
org.apache.servicemix.bundles.jaxb-xjc (2.2.11.1) "Apache ServiceMix :: Bundles :: jaxb-xjc" [active, 94]
org.apache.servicemix.bundles.not-yet-commons-ssl (0.3.11.1) "Apache ServiceMix :: Bundles :: not-yet-commons-ssl" [active, 95]
org.apache.servicemix.bundles.wsdl4j (1.6.3.1) "Apache ServiceMix :: Bundles :: wsdl4j" [active, 96]
org.apache.servicemix.bundles.xmlresolver (1.2.0.5) "Apache ServiceMix :: Bundles :: xmlresolver" [active, 97]
org.apache.servicemix.specs.jsr339-api-2.0.1 (2.6.0) "Apache ServiceMix :: Specs :: JSR-339 API 2.0.1" [active, 98]
org.apache.sshd.core (1.2.0) "Apache Mina SSHD :: Core" [active, 99]
org.apache.ws.xmlschema.core (2.2.1) "XmlSchema Core" [active, 100]
org.apache.xbean.bundleutils (4.1.0) "Apache XBean OSGI Bundle Utilities" [active, 101]
org.apache.xbean.finder (4.1.0) "Apache XBean :: Classpath Resource Finder" [active, 102]
org.codehaus.jettison.jettison (1.3.8) "jettison" [active, 103]
org.eclipse.jdt.core.compiler.batch (3.10.0.v20140604-1726) "Eclipse Compiler for Java(TM)" [active, 104]
org.eclipse.jetty.client (9.3.15.v20161220) "Jetty :: Asynchronous HTTP Client" [active, 105]
org.eclipse.jetty.continuation (9.3.15.v20161220) "Jetty :: Continuation" [active, 106]
org.eclipse.jetty.http (9.3.15.v20161220) "Jetty :: Http Utility" [active, 107]
org.eclipse.jetty.io (9.3.15.v20161220) "Jetty :: IO Utility" [active, 108]
org.eclipse.jetty.jaas (9.3.15.v20161220) "Jetty :: JAAS" [active, 109]
org.eclipse.jetty.jmx (9.3.15.v20161220) "Jetty :: JMX Management" [active, 110]
org.eclipse.jetty.jndi (9.3.15.v20161220) "Jetty :: JNDI Naming" [active, 111]
org.eclipse.jetty.plus (9.3.15.v20161220) "Jetty :: Plus" [active, 112]
org.eclipse.jetty.rewrite (9.3.15.v20161220) "Jetty :: Rewrite Handler" [active, 113]
org.eclipse.jetty.security.jaspi (9.3.15.v20161220) "Jetty :: JASPI Security" [active, 115]
org.eclipse.jetty.security (9.3.15.v20161220) "Jetty :: Security" [active, 114]
org.eclipse.jetty.server (9.3.15.v20161220) "Jetty :: Server Core" [active, 116]
org.eclipse.jetty.servlet (9.3.15.v20161220) "Jetty :: Servlet Handling" [active, 117]
org.eclipse.jetty.servlets (9.3.15.v20161220) "Jetty :: Utility Servlets and Filters" [active, 118]
org.eclipse.jetty.util.ajax (9.3.15.v20161220) "Jetty :: Utilities :: Ajax(JSON)" [active, 120]
org.eclipse.jetty.util (9.3.15.v20161220) "Jetty :: Utilities" [active, 119]
org.eclipse.jetty.webapp (9.3.15.v20161220) "Jetty :: Webapp Application Support" [active, 121]
org.eclipse.jetty.websocket.api (9.3.15.v20161220) "Jetty :: Websocket :: API" [active, 122]
org.eclipse.jetty.websocket.client (9.3.15.v20161220) "Jetty :: Websocket :: Client" [active, 123]
org.eclipse.jetty.websocket.common (9.3.15.v20161220) "Jetty :: Websocket :: Common" [active, 124]
org.eclipse.jetty.websocket.javax.websocket.server (9.3.15.v20161220) "Jetty :: Websocket :: javax.websocket.server :: Server Implementation" [active, 126]
org.eclipse.jetty.websocket.javax.websocket (9.3.15.v20161220) "Jetty :: Websocket :: javax.websocket :: Client Implementation" [active, 125]
org.eclipse.jetty.websocket.server (9.3.15.v20161220) "Jetty :: Websocket :: Server" [active, 127]
org.eclipse.jetty.websocket.servlet (9.3.15.v20161220) "Jetty :: Websocket :: Servlet Interface" [active, 128]
org.eclipse.jetty.xml (9.3.15.v20161220) "Jetty :: XML utilities" [active, 129]
org.fusesource.jansi (1.14.0) "jansi" [active, 130]
org.jline (3.1.3) "JLine" [active, 131]
org.objectweb.asm.all (5.0.2) "ASM all classes with debug info" [active, 132]
org.ops4j.pax.logging.pax-logging-api (1.9.1) "OPS4J Pax Logging - API" [active, 3]
org.ops4j.pax.logging.pax-logging-log4j2 (1.9.1) "OPS4J Pax Logging - Log4j v2" [active, 4]
org.ops4j.pax.url.mvn (2.5.2) "OPS4J Pax Url - aether:" [active, 2]
org.ops4j.pax.url.wrap (2.5.2) "OPS4J Pax Url - wrap:" [active, 133]
org.ops4j.pax.web.pax-web-api (6.0.2) "OPS4J Pax Web - API" [active, 134]
org.ops4j.pax.web.pax-web-extender-whiteboard (6.0.2) "OPS4J Pax Web - Extender - Whiteboard" [active, 135]
org.ops4j.pax.web.pax-web-jetty (6.0.2) "OPS4J Pax Web - Jetty" [active, 136]
org.ops4j.pax.web.pax-web-jsp (6.0.2) "OPS4J Pax Web - Jsp Support" [active, 137]
org.ops4j.pax.web.pax-web-runtime (6.0.2) "OPS4J Pax Web - Runtime" [active, 138]
org.ops4j.pax.web.pax-web-spi (6.0.2) "OPS4J Pax Web - Service SPI" [active, 139]
stax2-api (3.1.4) "Stax2 API" [active, 140]
woodstox-core-asl (4.4.1) "Woodstox XML-processor" [active, 141]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

ivoleitao
Also and sorry for the spam :-)

In my pax exam my test code above returns the following:

07-03-2017 23:27:39 [ERROR] - #### XOF INSTANCED ####
07-03-2017 23:27:39 [ERROR] - #### XOF CLASSNAME: com.sun.xml.internal.stream.XMLOutputFactoryImpl

For paxexam I'm not installing all the bundles from the feature cxf_specs (described at http://repo.maven.apache.org/maven2/org/apache/cxf/karaf/apache-cxf/3.1.7/apache-cxf-3.1.7-features.xml)

I'm doing something like this:

        public static Option cxf_specs() {
                return composite(
                                systemPackages("javax.xml.stream; version=\"1.0.0\"", "javax.xml.stream.events; version=\"1.0.0\"",
                                                "javax.xml.stream.util; version=\"1.0.0\""),
                                mavenBundle().groupId("org.codehaus.woodstox").artifactId("stax2-api").version(versionResolver),
                                mavenBundle().groupId("org.codehaus.woodstox").artifactId("woodstox-core-asl").version(versionResolver),
                                mavenBundle().groupId("org.apache.servicemix.specs")
                                                .artifactId("org.apache.servicemix.specs.jsr339-api-2.0.1").version(versionResolver));
        }

I'm not sure if the systemPackages configuration is the "why" this is working in paxexam or it's the removal of the other bundles in the cxf_specs feature (I've had a number of other problems and this was the winning combination :-) for paxexam)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

cschneider
The karaf way to provide java specs is to use "libraries" in the custom build. These override the spec apis to make them more OSGi friendly. 
As the DOSGi feature is built for this style you should add the necessary libraries:

See:


2017-03-08 0:33 GMT+01:00 ivoleitao <[hidden email]>:
Also and sorry for the spam :-)

In my pax exam my test code above returns the following:

07-03-2017 23:27:39 [ERROR] - #### XOF INSTANCED ####
07-03-2017 23:27:39 [ERROR] - #### XOF CLASSNAME:
com.sun.xml.internal.stream.XMLOutputFactoryImpl

For paxexam I'm not installing all the bundles from the feature cxf_specs
(described at
http://repo.maven.apache.org/maven2/org/apache/cxf/karaf/apache-cxf/3.1.7/apache-cxf-3.1.7-features.xml)

I'm doing something like this:

        public static Option cxf_specs() {
                return composite(
                                systemPackages("javax.xml.stream; version=\"1.0.0\"",
"javax.xml.stream.events; version=\"1.0.0\"",
                                                "javax.xml.stream.util; version=\"1.0.0\""),

mavenBundle().groupId("org.codehaus.woodstox").artifactId("stax2-api").version(versionResolver),

mavenBundle().groupId("org.codehaus.woodstox").artifactId("woodstox-core-asl").version(versionResolver),
                                mavenBundle().groupId("org.apache.servicemix.specs")

.artifactId("org.apache.servicemix.specs.jsr339-api-2.0.1").version(versionResolver));
        }

I'm not sure if the systemPackages configuration is the "why" this is
working in paxexam or it's the removal of the other bundles in the cxf_specs
feature (I've had a number of other problems and this was the winning
combination :-) for paxexam)



--
View this message in context: http://karaf.922171.n3.nabble.com/DOSGI-2-1-0-calling-soap-service-results-in-javax-xml-stream-XMLOutputFactory-cannot-be-created-tp4049778p4049780.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

ivoleitao
Hello Christian,

Thank you for your answer. Yes I mentioned that above. I'm doing that in my custom assembly and even with that it does not work. I've double checked and those libraries are in the endorsed folder...

Best Regards,

On 8 Mar 2017, at 08:50, cschneider [via Karaf] <[hidden email]> wrote:

The karaf way to provide java specs is to use "libraries" in the custom build. These override the spec apis to make them more OSGi friendly. 
As the DOSGi feature is built for this style you should add the necessary libraries:

See:


2017-03-08 0:33 GMT+01:00 ivoleitao <[hidden email]>:
Also and sorry for the spam :-)

In my pax exam my test code above returns the following:

07-03-2017 23:27:39 [ERROR] - #### XOF INSTANCED ####
07-03-2017 23:27:39 [ERROR] - #### XOF CLASSNAME:
com.sun.xml.internal.stream.XMLOutputFactoryImpl

For paxexam I'm not installing all the bundles from the feature cxf_specs
(described at
http://repo.maven.apache.org/maven2/org/apache/cxf/karaf/apache-cxf/3.1.7/apache-cxf-3.1.7-features.xml)

I'm doing something like this:

        public static Option cxf_specs() {
                return composite(
                                systemPackages("javax.xml.stream; version=\"1.0.0\"",
"javax.xml.stream.events; version=\"1.0.0\"",
                                                "javax.xml.stream.util; version=\"1.0.0\""),

mavenBundle().groupId("org.codehaus.woodstox").artifactId("stax2-api").version(versionResolver),

mavenBundle().groupId("org.codehaus.woodstox").artifactId("woodstox-core-asl").version(versionResolver),
                                mavenBundle().groupId("org.apache.servicemix.specs")

.artifactId("org.apache.servicemix.specs.jsr339-api-2.0.1").version(versionResolver));
        }

I'm not sure if the systemPackages configuration is the "why" this is
working in paxexam or it's the removal of the other bundles in the cxf_specs
feature (I've had a number of other problems and this was the winning
combination :-) for paxexam)



--
View this message in context: http://karaf.922171.n3.nabble.com/DOSGI-2-1-0-calling-soap-service-results-in-javax-xml-stream-XMLOutputFactory-cannot-be-created-tp4049778p4049780.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com



To start a new topic under Karaf - User, email [hidden email]
To unsubscribe from DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created", click here.
NAML
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

ivoleitao
Hello,

I've tested in 4.1.0 vanilla distribution and it works. I have issued the following commands:

feature:install scr
feature:install http
feature:install http-whiteboard
feature:install webconsole
feature:repo-add cxf-dosgi 2.1.0
feature:install cxf-dosgi-provider-rs
feature:install cxf-dosgi-provider-ws

and my bundles and it works :-S something is strange in my distribution... I'm going to investigate the causes and report it later.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created"

ivoleitao
Well, this was hard to discover but this is really a problem but not in DOSGi not even in karaf. It's a problem in the karaf-maven-plugin  I was using the karaf-maven-plugin namely the "run" goal to launch my karaf and  unfortunately it does not configure the endorsed folders :S

Launching karaf via maven plugin I have this in system properties (my computer folders):
java.endorsed.dirs = /app/epm/bin/jdk18/jre/lib/endorsed
java.ext.dirs = /app/epm/bin/jdk18/jre/lib/ext:/usr/java/packages/lib/ext 

Launching via karaf scripts (my computer folders):
java.endorsed.dirs = /app/epm/bin/jdk18/jre/lib/endorsed:/app/epm/bin/jdk18/lib/endorsed:/home/ivoleitao/Downloads/karaf41/apache-karaf-4.1.0/lib/endorsed
java.ext.dirs = /app/epm/bin/jdk18/jre/lib/ext:/app/epm/bin/jdk18/lib/ext:/home/ivoleitao/Downloads/karaf41/apache-karaf-4.1.0/lib/ext

As seen above it adds the endorsed folders of the local karaf. I've changed manually and it works.

I'm going to create a new topic about this and an issue.

Thanks a lot Christian for your input.
Best Regards,   

On 8 March 2017 at 12:01, ivoleitao [via Karaf] <[hidden email]> wrote:
Hello,

I've tested in 4.1.0 vanilla distribution and it works. I have issued the following commands:

feature:install scr
feature:install http
feature:install http-whiteboard
feature:install webconsole
feature:repo-add cxf-dosgi 2.1.0
feature:install cxf-dosgi-provider-rs
feature:install cxf-dosgi-provider-ws

and my bundles and it works :-S something is strange in my distribution... I'm going to investigate the causes and report it later.


To start a new topic under Karaf - User, email [hidden email]
To unsubscribe from DOSGI 2.1.0 calling soap service results in "javax.xml.stream.XMLOutputFactory cannot be created", click here.
NAML

Loading...