cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aruge <Andreas.R...@kba.de>
Subject StackOverflowError when resolving schemas with CXF 2.0.3
Date Mon, 14 Jan 2008 12:44:24 GMT

Hello,

we are developing a webservice application with CXF, but with version 2.0.3
we get an endless loop creating the schema for our WSDL. 

The scenario is the following: Our web.wsdl ist importing a schema
definition a.xsd and a.xsd is including b.xsd, so both definitions share the
namespace. 

The new internal LSResourceResolver in
org.apache.cxf.wsdl.EndpointReferenceUtils has this implementation code:

460                factory.setResourceResolver(new LSResourceResolver() {  
461                      public LSInput resolveResource(String type, String
namespaceURI, String publicId,  
462                                                     String systemId,
String baseURI) {  
463                          for (XmlSchema sch : sc.getXmlSchemas()) {  
464                              if
(namespaceURI.equals(sch.getTargetNamespace())) {  
465                                  LSInputImpl impl = new LSInputImpl();  
466                                  InputStream ins = null;  
467                                  try {  
468                                      URL url = new
URL(sch.getSourceURI());  
469                                      ins = url.openStream();  
470                                  } catch (Exception e) {  
471                                      //ignore, we'll just use what we
have.  (though  
472                                      //bugs in XmlSchema could make this
less useful)  
473                                  }  
474                                    
475                                  if (ins == null) {  
476                                      LoadingByteArrayOutputStream out =
new LoadingByteArrayOutputStream();  
477                                      sch.write(out);  
478                                      ins = out.createInputStream();  
479                                      System.out.println(out.toString());  
480                                  }  
481                                  impl.setByteStream(ins);  
482                                  return impl;  
483                              }  
484                          }  
485                          return null;  
486                      }  
487                        
488                  });  

The resolving order is: web.wsdl -> a.xsd -> b.xsd
When resolving the definition of b.xsd the if statement in line 464 is
already true if the analyzed schema is a.xsd because of the same namespace.
And if the iterator provides a.xsd before b.xsd we are resolving in an
endless loop (a.xsd->b.xsd->a.xsd...)

My question is: Do we have to alter our schemas or is this a bug? The
previous versions didn't show this behaviour.

Regards,
           Andreas.
-- 
View this message in context: http://www.nabble.com/StackOverflowError-when-resolving-schemas-with-CXF-2.0.3-tp14800936p14800936.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message