[
https://issues.apache.org/activemq/browse/SMX4-256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50675#action_50675
]
Patrick Huber commented on SMX4-256:
------------------------------------
Thanks for the hint, the pom from the link I posted didn't quite work, yours
works out of the box...
I've added the extra export and now I somehow get less far than before. Before,
I got an exception while some of my code was executed, now I'm stuck in the
osgi wiring process:
----------
DEBUG: WIRE: 66.0 ->
schemaorg_apache_xmlbeans.namespace.http_3A_2F_2Fwww_2Ebea_2Ecom_2F2003_2F05_2Fxmlbean_2Fltgfmt
-> 66.0
DEBUG: WIRE: 66.0 ->
schemaorg_apache_xmlbeans.javaname.org.apache.xmlbeans.impl.xb.xmlconfig.Extensionconfig
-> 66.0
DEBUG: WIRE: 66.0 ->
schemaorg_apache_xmlbeans.javaname.org.apache.xmlbeans.impl.xb.xsdschema.NarrowMaxMin
-> 66.0
DEBUG: WIRE: 66.0 -> org.apache.xmlbeans.impl.xb.ltgfmt -> 66.0
DEBUG: WIRE: 66.0 ->
schemaorg_apache_xmlbeans.element.URI_SHA_1_0072531D5C2BA64B5A3672B694CDAA153CD30788
-> 66.0
ERROR BundleException: Unresolved constraint in bundle 67: package;
(&(package=org.apache.xmlbeans.impl.xb.xsdschema)(version>=2.4.0))
----------
In my own bundle, I imported that package explicitly because it wouldn't build
otherwise. Now when I check the enriched jar file, that package is exported
numerous times and yet I get an error...
Ok I just went trough the manifest and looked a bit harder. It seems most if
not all Export statements look something like this:
----------
org.apache.xmlbeans.impl.inst2xsd.util;uses:="org.apache.xmlbeans.impl.values,org.apache.xmlbeans.impl.xb.xsdschema,org.apache.xmlbeans,org.apache.xmlbeans.impl.common,javax.xml.namespace"
----------
So xsdschema is only referenced in uses but never exported itself. How is that
possible? The config in the pom should clearly export that package too:
----------
<servicemix.osgi.export.pkg>
!repackage,
org.apache.xmlbeans*,
schemaorg_apache_xmlbeans*
</servicemix.osgi.export.pkg>
----------
The import in my app would be this:
----------
<ws-gateway.osgi.import.package>
...
org.apache.xmlbeans;version="${xmlbeans-version}",
org.apache.xmlbeans.impl.xb.xsdschema;version="${xmlbeans-version}",
...
</ws-gateway.osgi.import.package>
----------
Without the second import, I get a build error...
I hoped I could just add that package and be done but apparently there's more
to that... Since I'm not an osgi expert I have no clue why this happens... I'm
open for suggestions on what to try next... thanks...
> Add another Export to the XMLBeans bundle
> -----------------------------------------
>
> Key: SMX4-256
> URL: https://issues.apache.org/activemq/browse/SMX4-256
> Project: ServiceMix 4
> Issue Type: Bug
> Environment: all
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlbeans/2.4.0_1
> Reporter: Patrick Huber
> Priority: Minor
>
> I use the xmlbeans bundle provided here:
> http://repo1.maven.org/maven2/org/apache/servicemix/bundles/org.apache.servicemix.bundles.xmlbeans/2.4.0_1/org.apache.servicemix.bundles.xmlbeans-2.4.0_1.pom
> Of xmlbeans, I use org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument to
> parse an xsd file and read a bunch of things from that. I added the imports
> org.apache.xmlbeans and org.apache.xmlbeans.impl.xb.xsdschema and when I
> start the bundle, I get the following exception:
> ----------
> Caused by: java.lang.ExceptionInInitializerError
> at
> org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument$Factory.parse(SchemaDocument.java:778)
> at ...
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at
> org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
> ... 17 more
> Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable
> to load class with name
> schemaorg_apache_xmlbeans.system.sXMLSCHEMA.TypeSystemHolder. Make sure the
> generated binary files are on the classpath.
> at
> org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
> at
> org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument.<clinit>(SchemaDocument.java:19)
> ... 25 more
> Caused by: java.lang.ClassNotFoundException: *** Class
> 'schemaorg_apache_xmlbeans.system.sXMLSCHEMA.TypeSystemHolder' was not found.
> Bundle 66 does not import package
> 'schemaorg_apache_xmlbeans.system.sXMLSCHEMA', nor is the package exported by
> any other bundle or available from the system class loader. ***
> at
> org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:198)
> at
> org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)
> at
> org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClass(ContentClassLoader.java:109)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at
> org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769)
> ... 26 more
> Caused by: java.lang.ClassNotFoundException:
> schemaorg_apache_xmlbeans.system.sXMLSCHEMA.TypeSystemHolder
> at
> org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:486)
> at
> org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:185)
> ... 30 more
> ----------
> ... with bundle 66 being the xmlbeans bundle. When I look at the pom and
> manifest of the xmlbeans-2.4.0_1.jar, that export is not present and the
> exception makes sense.
> Thus my request: please add "schemaorg_apache_xmlbeans" to the exported
> packages...
> If I knew how to build the custom jar myself I would happily test and verify
> the export myself and give you guys the complete list of required exports.
> Thank you!
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.