Karaf
  1. Karaf
  2. KARAF-1334

Use the new servicemix spec to allow the use of both the JRE implementations and implementations from bundles

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0, 3.0.0
    • Component/s: None
    • Labels:
      None

      Issue Links

        Activity

        Gavin made changes -
        Link This issue is depended upon by KARAF-1118 [ KARAF-1118 ]
        Gavin made changes -
        Link This issue blocks KARAF-1118 [ KARAF-1118 ]
        Andrei Pozolotin made changes -
        Link This issue relates to KARAF-1955 [ KARAF-1955 ]
        Hide
        Andrei Pozolotin added a comment -

        yes, there is inconsistency here:

        for example:

        karaf 3.0.0-SNAPSHOT

        provides
        org.apache.servicemix.specs.jaxp-api-1.4-2.0.0.jar

        by default as part of $

        {karaf.base}

        /lib/endorsed

        which overrides JDK XPathFactoryFinder.java
        where it replaces
        com.sun.org.apache...XPathFactory
        with
        org.apache...XPathFactory

        but org.apache...XPathFactory is nowhere to be found in the standard karaf distribution

        or may be it is an error in the service mix spec locator

        regardless, the issue is still there, and affects

        javax.xml.xpath.XPathFactory.newInstance()

        as in the stack trace above

        Show
        Andrei Pozolotin added a comment - yes, there is inconsistency here: for example: karaf 3.0.0-SNAPSHOT provides org.apache.servicemix.specs.jaxp-api-1.4-2.0.0.jar by default as part of $ {karaf.base} /lib/endorsed which overrides JDK XPathFactoryFinder.java where it replaces com.sun.org.apache...XPathFactory with org.apache...XPathFactory but org.apache...XPathFactory is nowhere to be found in the standard karaf distribution or may be it is an error in the service mix spec locator regardless, the issue is still there, and affects javax.xml.xpath.XPathFactory.newInstance() as in the stack trace above
        Hide
        Ben Doerr added a comment -

        Hi,

        This is great that CXF will now function within Karaf. However I ran into an issue that this change caused. The issue was with MyBatis and MyBatis-Spring. When MyBatis-Spring was trying to parse a SqlMapConfig.xml it was unable to find an XPathFactory implementation. This resulted in an exception and a failure to startup the blueprint context of my bundle.

        I was able to solve this by moving org.apache.servicemix.specs.jaxb-api-2.2-2.0.0.jar, org.apache.servicemix.specs.jaxp-api-1.4-2.0.0.jar, and org.apache.servicemix.specs.jaxws-api-2.2-2.0.0.jar out of lib/endorsed and into lib.

        Following is the regression stacktrace:

        org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean sqlSessionFactory of class null
        	at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:236)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:706)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:799)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:773)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:754)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:720)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:799)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:773)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:754)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:720)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:370)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:278)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.ServiceRecipe.internalCreate(ServiceRecipe.java:140)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:640)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:331)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)[13:org.apache.aries.blueprint:0.3.1]
        	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_33]
        	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_33]
        	at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_33]
        	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_33]
        	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)[:1.6.0_33]
        	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_33]
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_33]
        	at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
        Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
        	at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)[:2.0.0]
        	at org.apache.ibatis.parsing.XPathParser.commonConstructor(XPathParser.java:261)
        	at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:121)
        	at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:71)
        	at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:313)
        	at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295)
        	at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:435)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
        	at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
        	at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[13:org.apache.aries.blueprint:0.3.1]
        	at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:234)[13:org.apache.aries.blueprint:0.3.1]
        	... 39 more
        
        Show
        Ben Doerr added a comment - Hi, This is great that CXF will now function within Karaf. However I ran into an issue that this change caused. The issue was with MyBatis and MyBatis-Spring. When MyBatis-Spring was trying to parse a SqlMapConfig.xml it was unable to find an XPathFactory implementation. This resulted in an exception and a failure to startup the blueprint context of my bundle. I was able to solve this by moving org.apache.servicemix.specs.jaxb-api-2.2-2.0.0.jar , org.apache.servicemix.specs.jaxp-api-1.4-2.0.0.jar , and org.apache.servicemix.specs.jaxws-api-2.2-2.0.0.jar out of lib/endorsed and into lib . Following is the regression stacktrace: org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean sqlSessionFactory of class null at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:236)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:706)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:799)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:773)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:754)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:720)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:799)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:773)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:754)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:720)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:60)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:370)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:278)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.ServiceRecipe.internalCreate(ServiceRecipe.java:140)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:640)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:331)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)[13:org.apache.aries.blueprint:0.3.1] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_33] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_33] at java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_33] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_33] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)[:1.6.0_33] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_33] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_33] at java.lang.Thread.run(Thread.java:680)[:1.6.0_33] Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)[:2.0.0] at org.apache.ibatis.parsing.XPathParser.commonConstructor(XPathParser.java:261) at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:121) at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:71) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:313) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295) at org.mybatis.spring.SqlSessionFactoryBean.getObject(SqlSessionFactoryBean.java:435) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33] at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33] at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[13:org.apache.aries.blueprint:0.3.1] at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:234)[13:org.apache.aries.blueprint:0.3.1] ... 39 more
        Jean-Baptiste Onofré made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jean-Baptiste Onofré added a comment -

        The system.properties should be also updated with the following properties:

        org.apache.servicemic.specs.debug=false
        org.apache.servicemic.specs.timeout=0

        Show
        Jean-Baptiste Onofré added a comment - The system.properties should be also updated with the following properties: org.apache.servicemic.specs.debug=false org.apache.servicemic.specs.timeout=0
        Jean-Baptiste Onofré made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Christian Schneider [ chris@die-schneider.net ] Jean-Baptiste Onofré [ jbonofre ]
        Christian Schneider made changes -
        Link This issue blocks KARAF-1118 [ KARAF-1118 ]
        Christian Schneider made changes -
        Link This issue incorporates KARAF-1411 [ KARAF-1411 ]
        Christian Schneider made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Christian Schneider added a comment -

        Ok

        Show
        Christian Schneider added a comment - Ok
        Christian Schneider made changes -
        Field Original Value New Value
        Assignee Guillaume Nodet [ gnt ] Christian Schneider [ chris@die-schneider.net ]
        Hide
        Guillaume Nodet added a comment -

        Feel free to try to backport to trunk if you wish, I don't have much time unfortunately to look at that in the coming days.

        Show
        Guillaume Nodet added a comment - Feel free to try to backport to trunk if you wish, I don't have much time unfortunately to look at that in the coming days.
        Hide
        Christian Schneider added a comment -

        I just checked out 2.3.x, built and installed CXF 2.6.0 on it. Works fine.

        Show
        Christian Schneider added a comment - I just checked out 2.3.x, built and installed CXF 2.6.0 on it. Works fine.
        Hide
        Guillaume Nodet added a comment -

        It is supposed to work on 2.3.x
        Another set of eyes is always welcomed if you want to give it a try.

        Show
        Guillaume Nodet added a comment - It is supposed to work on 2.3.x Another set of eyes is always welcomed if you want to give it a try.
        Hide
        Christian Schneider added a comment -

        If it is a time issue I can also try to port that to the trunk. Would be great to be able to install camel and cxf without changing the jre.properties. Does this already work on 2.3.x?

        Show
        Christian Schneider added a comment - If it is a time issue I can also try to port that to the trunk. Would be great to be able to install camel and cxf without changing the jre.properties. Does this already work on 2.3.x?
        Hide
        Guillaume Nodet added a comment -

        That's on my todo list, I just haven't had any time to do that yet, and that's really the only reason why I left this issue opened.

        Show
        Guillaume Nodet added a comment - That's on my todo list, I just haven't had any time to do that yet, and that's really the only reason why I left this issue opened.
        Hide
        Christian Schneider added a comment -

        Hi Guillaume. Can you also apply this to trunk? It is a bit risky when we have features that are on the branch but not on trunk

        Show
        Christian Schneider added a comment - Hi Guillaume. Can you also apply this to trunk? It is a bit risky when we have features that are on the branch but not on trunk
        Guillaume Nodet created issue -

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Guillaume Nodet
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development