ivan-ra commented on issue #595:
URL: https://github.com/apache/camel-karaf/issues/595#issuecomment-2734470231

   Cant reproduce it with online karaf/project tests. It loads both jaxb 
runtime versions.
   But for intranet projects I've made offline assembly with 
karaf-maven-plugin, and for some reason it loads only jaxb-osgi 3.0.2.
   I don't know if this will be fixed, but at least there are extra imports to 
be deleted from camel-blueprint manifest (!com.sun.xml.\*,!org.jvnet.\*, in 
pom.xml). This packages from jaxb 3.0.2, but camel-blueprint uses jaxb runtime 
4.0.5.
   
   For offline karaf my solution is:
   - exclude unused imports from camel-blueprint manifest 
(!com.sun.xml.\*,!org.jvnet.\*, in pom.xml)
   ```
           <camel.osgi.import>
               jakarta.xml.bind*;version="[3,5)",!com.sun.xml.*,!org.jvnet.*,
               *
           </camel.osgi.import>
   ```
   - fix both jaxb-runtime features (remove dependency="true" attribute). This 
jaxb bundles exports the same packages, but different versions. So, we cant use 
optional dependency, but only exact:
   ```
       <feature name="jaxb-runtime" version="${jaxb3-core-version}">
           <feature version="[3,4)">jakarta-xml-bind</feature>
           <bundle>mvn:com.sun.xml.bind/jaxb-core/${jaxb3-core-version}</bundle>
           <bundle>mvn:com.sun.xml.bind/jaxb-impl/${jaxb3-impl-version}</bundle>
           <bundle>mvn:com.sun.xml.bind/jaxb-osgi/${jaxb3-osgi-version}</bundle>
       </feature>
   
       <feature name="jaxb-runtime" version="${jaxb-core-version}">
           <feature version="[4,5)">jakarta-xml-bind</feature>
           <bundle 
dependency="true">mvn:com.sun.istack/istack-commons-runtime/${auto-detect-version}</bundle>
           
<bundle>mvn:org.glassfish.jaxb/jaxb-core/${glassfish-jaxb-runtime-version}</bundle>
           
<bundle>mvn:org.glassfish.jaxb/jaxb-runtime/${glassfish-jaxb-runtime-version}</bundle>
           
<bundle>mvn:org.glassfish.hk2/osgi-resource-locator/${osgi-resource-locator-version}</bundle>
       </feature>
   ```
   tested for 4.8.x branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to