Github user jpullmann commented on the pull request:

    https://github.com/apache/jena/pull/134#issuecomment-209474708
  
    I created a new folder containing the initial Apache Karaf feature 
definition (jena-osgi-features). We might think of providing different 
distributions in the future each one defined by own feature. It has been reused 
to define the bundle set for the integration test:
    ```
                  ... features(maven().groupId("org.apache.jena")
                        .artifactId("jena-osgi-features").type("xml")
                        .classifier("features")
                        .version("3.1.0-SNAPSHOT"), "jena") ...
    ```
    While testing I was reminded harshly why I removed xerces from the bundle 
earlier: Apache Karaf (3* and 4*) ships with endorsed xerces 2.11.0 and exports 
it per default to any installed bundle via boot delegation. The bundle cant's 
suppress (not import) these classes, resulting in 2 versions available and 
tests failing with: 
    ```
    Caused by: java.lang.VerifyError: (class: 
org/apache/xerces/impl/dv/xs/AbstractDateTimeDV, method: <clinit> signature: 
()V) Bad type in putfield/putstatic
        at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.<clinit>(Unknown 
Source)[:]
        at 
org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown 
Source)[:]
        at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.<clinit>(Unknown 
Source)[:]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)[:1.8.0_05]
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_05]
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_05]
        at 
java.lang.reflect.Constructor.newInstance(Constructor.java:408)[:1.8.0_05]
        at java.lang.Class.newInstance(Class.java:433)[:1.8.0_05]
        at org.apache.xerces.impl.dv.ObjectFactory.newInstance(Unknown 
Source)[:]
    
    ``` 
    As expected, these configurations were proved to work:
    1. Apache Karaf * with endorsed xerces-2.11.0 + plain Jena-osgi (without 
xerces)
    2. Apache Karaf 4.0.4 without xerces-2.11.0 + Jena-osgi with inline xerces
    3. Apache Karaf 4.0.4 without xerces-2.11.0 + plain Jena-osgi with "xerces" 
feature installed
    
    In case 2,3 I removed "xerces-2.11.0.jar" from "lib/endorsed/" and from the 
configuration of packages implicitly provided by runtime 
(org.osgi.framework.bootdelegation) in  "etc/config.properties".
    Case 3 seems to confirm, that importing xerces might work. Users may either 
install the "xerces" feature or resolve the indicated bundles manually:
    ```
    <feature name="xerces" version="2.11.0">
    
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xerces/2.11.0_1</bundle><bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5</bundle>
    </feature>
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to