incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Minto van der Sluis <mi...@xup.nl>
Subject Re: LinkageError when using Clerezza in combination with CXF on Karaf
Date Thu, 06 Dec 2012 16:54:15 GMT
Further investigation raise a question regarding

    org.apache.clerezza.ext:com.hp.hpl.jena.tdb

Why is this bundle both importing and exporting org.apache.xerces.util?
When I remove "org.apache.xerces.util" from both the import-package and
export-package I no longer have the reported error.

Hope someone can explain why importing an exporting
"org.apache.xerces.util" is necessary?

Regards,

Minto

Op 6-12-2012 16:07, Minto van der Sluis schreef:
> Hi Folks,
>
> I am using Clerezza in combination with Karaf for approximately a month
> now and am quite satisfied this far. Now I am trying to add a CXF based
> Rest interface to store triples in our Jena TDB store. The interface
> looks something like this:
>
>   @Override
>   @POST
>   @Path( "/" )
>   public void put( String data ) {
>       InputStream in = new ByteArrayInputStream( data.getBytes( "UTF-8" ) );
>       MGraph graph = new SimpleMGraph();
>       getParserService().parse( graph, in, SupportedFormat.RDF_XML ); 
> // LinkageError
>
>       ... further processing
>   }
>
> When doing this I end up with the following error:
>
> Caused by: java.lang.LinkageError: loader constraint violation: when
> resolving method
> "org.apache.xerces.util.ParserConfigurationSettings.<init>(Lorg/apache/xerces/xni/parser/XMLComponentManager;)V"
> the class loader (instance of
> org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of
> the current class, org/apache/xerces/parsers/BasicParserConfiguration,
> and the class loader (instance of
> org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for
> resolved class, org/apache/xerces/util/ParserConfigurationSettings, have
> different Class objects for the type
> gs.<init>(Lorg/apache/xerces/xni/parser/XMLComponentManager;)V used in
> the signature
>     at org.apache.xerces.parsers.BasicParserConfiguration.<init>(Unknown
> Source)
>     at org.apache.xerces.parsers.DTDConfiguration.<init>(Unknown Source)
>     at
> org.apache.xerces.parsers.StandardParserConfiguration.<init>(Unknown Source)
>     at
> org.apache.xerces.parsers.StandardParserConfiguration.<init>(Unknown Source)
>     at
> com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.create(RDFXMLParser.java:117)
>     at com.hp.hpl.jena.rdf.arp.JenaReader.<init>(JenaReader.java:62)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)[:1.7.0_02]
>     at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.7.0_02]
>     at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_02]
>     at
> java.lang.reflect.Constructor.newInstance(Constructor.java:525)[:1.7.0_02]
>     at java.lang.Class.newInstance0(Class.java:372)[:1.7.0_02]
>     at java.lang.Class.newInstance(Class.java:325)[:1.7.0_02]
>     at
> com.hp.hpl.jena.rdf.model.impl.RDFReaderFImpl.getReader(RDFReaderFImpl.java:113)
>     at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:226)
>     at
> org.apache.clerezza.rdf.jena.parser.JenaParserProvider.parse(JenaParserProvider.java:68)
>     ...
>
> Prior to introducing the Rest interface I have been using a custom Karaf
> command to do nearly the same thing. Up until introducing the Rest
> interface that command worked without problems. Now it gives this exact
> same error.
>
> I suspect there is something wrong with my packaging. But am not sure
> what is causing this. Looking up the class in question gives the
> following result:
>
>     karaf@root>osgi:find-class XMLComponentManager
>
>     Apache ServiceMix :: Bundles :: saaj-impl (143)
>     com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.class
>
>     Apache ServiceMix :: Bundles :: xercesImpl (144)
>     org/apache/xerces/xni/parser/XMLComponentManager.class
>
>     Clerezza Ext - Jena TDB OSGi Bundle (176)
>     org/apache/xerces/xni/parser/XMLComponentManager.class
>
> Unfortunately I am starting to run out of options. Does this look
> familiar to anyone here on the list? Any other clues are highly appreciated.
>
> Regards,
>
> Minto van der Sluis
>


-- 
ir. ing. Minto van der Sluis
Software innovator / renovator
Xup BV

Mobiel: +31 (0) 626 014541


Mime
View raw message