You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Guillaume Sauthier (JIRA)" <ji...@apache.org> on 2008/06/10 16:10:46 UTC

[jira] Created: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

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.0.6, 2.1
         Environment: Running CXF with cxf-bundle
            Reporter: Guillaume Sauthier


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.


[jira] Commented: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Guillaume Sauthier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604253#action_12604253 ] 

Guillaume Sauthier commented on CXF-1642:
-----------------------------------------

Good suggestion. I think it will work.

BTW, having only com.ctc.wstx.* is sufficent

  <DynamicImport-Package>
                            com.ctc.wstx.*,
  </DynamicImport-Package>

> 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.


[jira] Commented: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Guillaume Sauthier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603921#action_12603921 ] 

Guillaume Sauthier commented on CXF-1642:
-----------------------------------------

Great to know.

I've just seen that import statement in the pom.xml:

com.ctc.wstx*;resolution:=optional

I'm checking the 2.0.x-fixes MANIFEST to be sure that the import is really there....
No luck, the import package is not there !!!

I've noticed that the import described with pattern (com.ctc.wstx* for example) are not always turned into real import packages by Bnd.
In fact, this is understandable: Bnd looks for really used packages, and try to match them using the patterns.

If no used packages match the import directive (the pattern), there will be no real Import-Package in the MANIFEST.

This is what happen for CXF (or at least I suspect that), so, CXF should avoid using a pattern for woodstox:
Import-Package com.ctc.wstx.sax;resolution:=optional, *
is probably better


BTW, here is what I see during bundlization:

[INFO] [bundle:bundle]
[WARNING] Warning building bundle org.apache.cxf:cxf-bundle:bundle:2.0.7-SNAPSHOT : Instructions for Export-Package that are never used: org\.w3\._2006\._05\.addressing\.wsdl\..*|org\.w3\._2006\._05\.addressing\.wsdl, org\.xmlsoap\.schemas\.wsdl\.http\..*|org\.xmlsoap\.schemas\.wsdl\.http, =META-INF\.cxf
[WARNING] Warning building bundle org.apache.cxf:cxf-bundle:bundle:2.0.7-SNAPSHOT : Superfluous export-package instructions: [org.w3._2006._05.addressing.wsdl.*, org.xmlsoap.schemas.wsdl.http.*]
[WARNING] Warning building bundle org.apache.cxf:cxf-bundle:bundle:2.0.7-SNAPSHOT : Did not find matching referal for com.ctc.wstx*
[WARNING] Warning building bundle org.apache.cxf:cxf-bundle:bundle:2.0.7-SNAPSHOT : Did not find matching referal for org.jaxen*
[ERROR] Error building bundle org.apache.cxf:cxf-bundle:bundle:2.0.7-SNAPSHOT : Exporting packages that are not on the Bundle-Classpath[Jar:dot]: [META-INF.cxf]

See Did not find matching referal for com.ctc.wstx*, same for org.jaxen*

> 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.


[jira] Commented: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Stepan Koltsov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851625#action_12851625 ] 

Stepan Koltsov commented on CXF-1642:
-------------------------------------

I'm using CXF 2.2.7, I forgot to add woodstox to the classpath, and I got same problem (NAMESPACE_ERR).

> 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
>            Assignee: Daniel Kulp
>             Fix For: 2.1.1, 2.0.7
>
>         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.


[jira] Commented: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603883#action_12603883 ] 

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


Just a note: I think both issues are fixed in the latest snapshots.

First: we added wstx as "optional" to the bundle imports.  Thus, it will pick up wstx if there.

Second: I believe things are now fixed so if woodstox isn't found, it still will work.   We had to change some exception handling and stuff in there.







> 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.


[jira] Resolved: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-1642.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.7
                   2.1.1
         Assignee: Daniel Kulp

> 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
>            Assignee: Daniel Kulp
>             Fix For: 2.1.1, 2.0.7
>
>         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.


[jira] Updated: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Guillaume Sauthier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Sauthier updated CXF-1642:
------------------------------------

    Attachment: cxf-stacktrace.txt

For your eyes only: the explicit stack trace :)

> 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.


[jira] Commented: (CXF-1642) CXF Bundle is missing an Import-Package for woodstox

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ 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.