cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox
Date Wed, 11 Jun 2008 14:58:46 GMT

    [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604243#action_12604243
] 

Daniel Kulp commented on CXF-1642:
----------------------------------


Talked to Guillaume Nodet about this.   He suggested adding:
                        <DynamicImport-Package>
                            com.ctc.wstx.*,
                            com.ctc.wstx.sax.*
                        </DynamicImport-Package>
to the pom so the Class.forName would work without the introspector finding it.

I'll get the merged to trunk/2.0.x.   Hopefully that solves that problem.

> CXF Bundle is missing an Import-Package for woodstox
> ----------------------------------------------------
>
>                 Key: CXF-1642
>                 URL: https://issues.apache.org/jira/browse/CXF-1642
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.1, 2.0.6
>         Environment: Running CXF with cxf-bundle
>            Reporter: Guillaume Sauthier
>         Attachments: cxf-stacktrace.txt
>
>
> When running the cxf-bundle (2.0.6) in an OSGi environment (Felix), the Bus cannot initialize
sucesfuly:
> 2008-06-10 14:54:27,350 : SpringBusFactory.createBus : Failed to create application context.
> org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception
parsing XML document from class path resource [META-INF/cxf/cxf.xml]; nested exception is
javax.xml.transform.TransformerException: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt
is made to create or change an object in a way which is incorrect with regard to namespaces.
> After a bit of digging, I've found that Xerces was used instead of Woodstox.
> This is caused by the TunedDocumentLoader:
>         try {
>             Class<?> cls = Class.forName("com.ctc.wstx.sax.WstxSAXParserFactory");
>             saxParserFactory = (SAXParserFactory)cls.newInstance();
>             nsasaxParserFactory = (SAXParserFactory)cls.newInstance();
>         } catch (Exception e) {
>             //woodstox not found, use any other Stax parser
>             saxParserFactory = SAXParserFactory.newInstance();
>             nsasaxParserFactory = SAXParserFactory.newInstance();
>         }
> Indeed, the cxf-bundle do not import the 'com.ctc.wstx.sax' package, so we fall back
in the Exception handling, and CXF uses the default SAXParserFactory, which is provided by
Xerces.
> Just to be sure, I've added manually an Import-Package on 'com.ctc.wstx.sax', and provided
woodstox as a bundle, and everythings works better !
> I've only tested that on  2.0.6, but I've checked the Import-Package of the cxf-bundle
version 2.1 and there is still no import, so I guess the problem is there too.
> What I'm proposing is simply add an optional dependency on Woodstox, so that if it is
available, it will be used.
> Import-Package com.ctc.wstx.sax:resolution:=optional, *
> BTW, I'm curious, how about normal users who are not using OSGi ? What happen if they
remove the woodstox.jar ? Will they have the same behavior than me ? If so, CXF has a real
dependency on woodstox, and it should not try to hide it using Class.forName ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message