cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KnutIvar <knut.ivar.skogl...@gmail.com>
Subject CXF with XMLBeans and Spring. Nested XSDs and XmlBeansSchemainitializer
Date Tue, 03 Mar 2009 13:50:28 GMT

Hi!
When porting a rather large Xfire project to CXF, I get a problem with
"nested" xsd's.
We use a structure on our XSDs that looks a bit like this:
------------------------------------------------
MainFacade.xsd 
         | ---- DomainFacade.xsd 
         |                    | ---- DomainTypes.xsd
         |
         | ---- Domain2Facade.xsd 
                              | ---- Domain2Types.xsd
------------------------------------------------

The MainFacade imports the other DomainFacade that contains all request and
response types. The DomainFacade imports the DomainTypes that contains all
complexTypes and Simpletypes used in the DomainFacade. This is done to keep
it more maintainable (etc etc).

It seems that XMLBeansSchemaInitializer doesn't like this too much... ref:
--------------------------------------------------------
Caused by: java.lang.RuntimeException: Failed to find schema for:
types/types.xsd
  at
org.apache.cxf.xmlbeans.XmlBeansSchemaInitializer.getSchema(XmlBeansSchemaInitializer.java:148)
  at
org.apache.cxf.xmlbeans.XmlBeansSchemaInitializer.getSchema(XmlBeansSchemaInitializer.java:135)
  ... 49 more
Caused by: java.lang.IllegalArgumentException: InputStream cannot be null
  at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:94)
  at org.apache.cxf.helpers.XMLUtils.parse(XMLUtils.java:136)
  at
org.apache.cxf.xmlbeans.XmlBeansSchemaInitializer.getSchema(XmlBeansSchemaInitializer.java:129)
--------------------------------------------------------

This rararchive contains a complete Spring/CXF project with pom.xml that
builds and throw an exception when deploying. 
http://www.nabble.com/file/p22308967/CXFTestXmlBeansXSD.rar
CXFTestXmlBeansXSD.rar 

The structure in this project is like this:
------------------------------------------------------------------------------------------
PublishedFacade.xsd                 -- imports sum.xsd
         | ---- sum.xsd                -- contains request and responses.
Imports types.xsd.
                     | ---- types.xsd  -- contains complextypes and
simpletypes for XMLObject validation
------------------------------------------------------------------------------------------

If I doesn't include the types.xsd into sum.xsd, but move the types in
types.xsd into sum.xsd; the project runs ok.

There are more information posted  http://www.knutivars.net/cxf/index.html
on my page. 

https://issues.apache.org/jira/browse/CXF-1700 This issue  might be similar
to this problem... (include vs. import)

Any help would be appreciated.



-----
http://www.knutivars.net www.knutivars.net 
"http://www.knutivars.net/cxf/index.html Document first Apache CXF and
XMLBeans with Spring. 
-- 
View this message in context: http://www.nabble.com/CXF-with-XMLBeans-and-Spring.-Nested-XSDs-and-XmlBeansSchemainitializer-tp22308967p22308967.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message