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

Thomas Maslen commented on CXF-1505:
------------------------------------

The problem is that CXF uses wsdl4j, which has this bug:

        https://sourceforge.net/p/wsdl4j/bugs/34/

Essentially, when com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema() parses a schema 
it uses the com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(InputSource,String) 
method which is, er, pretty rudimentary -- it creates a new DocumentBuilder 
instance and doesn't even try to give it an EntityResolver.  So you can 
configure XML catalog(ue)s till you're blue in the face but they won't have any 
effect here.

For most schema files this doesn't matter, but xmldsig-core-schema.xsd exposes 
the problem because it uses a DTD with an external part (XMLSchema.dtd, which 
in turn pulls in datatypes.dtd).

For me the net effect of this was that at run time, whenever my JAX-WS client 
created a Service instance (with WSDL that ended up using 
xmldsig-core-schema.xsd), the WSDLReaderImpl code would always make 4 HTTP 
requests to www.w3.org.  Why 4?  Well, one for XMLSchema.dtd, one for 
datatypes.dtd, and then a duplicate one for each of them, since 
xmldsig-core-schema.xsd was imported via two paths through my WSDL / XSD, and 
apparently WSDLReaderImpl just re-fetches and re-parses an imported schema each 
time rather than doing any caching.

(If I were still using CXF then this might be a showstopper for me, but it 
turns out that the JAX-WS RI is sufficient for my vile purposes, and for 
roundabout reasons it doesn't have this issue).

Given the structure of the wsdl4j code, this probably isn't easy for CXF to fix 
from outside.  One (very half-baked) possibility:  clearly the schema imports 
are important at wsdl2java time, but are they still needed at run time -- or 
not?  If not, could the CXF WSDLManagerImpl perhaps configure the WSDLReader's 
"com.ibm.wsdl.parseXMLSchemas"  feature to false?


> Problem parsing /schemas/xmldsig-core-schema.xsd (Issue CXF-1200)
> -----------------------------------------------------------------
>
>                 Key: CXF-1505
>                 URL: https://issues.apache.org/jira/browse/CXF-1505
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.0.4
>         Environment: JBoss 4..0.5
>            Reporter: Diego Jarillo
>         Attachments: Catalog.xml, Hello.wsdl
>
>
> Hi,
> My server (JBoss 4.0.5) don“t has internet conection. I am using CXF 2.0.4. 
> In the wsdl i have
> <xsd:schema>
>   <xsd:import 
> namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
>              
> schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
>  </xsd:schema>
> when the server start, i have the next error
> Caused by: javax.wsdl.WSDLException: WSDLException (at 
> /wsdl:definitions/wsdl:types/xsd:schema[2]/xsd:schema): 
> faultCode=PARSER_ERROR: Problem parsing 
> 'jar:file:/D:/jboss-4.0.5.GA/server/default/./tmp/deploy/tmp4853siria-exp.war/WEB-INF/lib/cxf-2.0.4-incubator.jar!/schemas/xmldsig-core-schema.xsd'.:
>  java.net.ConnectException: Connection timed out: connect
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at 
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:199)
>         at 
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
>         at 
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:81)
>         ... 163 more
> aused by: java.net.ConnectException: Connection timed out: connect
>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>         at java.net.PlainSocketImpl.doConnect(Unknown Source)
>         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
>         at java.net.PlainSocketImpl.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at sun.net.NetworkClient.doConnect(Unknown Source)
>         at sun.net.www.http.HttpClient.openServer(Unknown Source)
>         at sun.net.www.http.HttpClient.openServer(Unknown Source)
>         at sun.net.www.http.HttpClient.<init>(Unknown Source)
>         at sun.net.www.http.HttpClient.New(Unknown Source)
>         at sun.net.www.http.HttpClient.New(Unknown Source)
>         at 
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
>         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown 
> Source)
>         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
>         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown 
> Source)
>         at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown 
> Source)
>         at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
>         at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown 
> Source)
>         at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown 
> Source)
>         at 
> org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown 
> Source)
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>         ... 177 more
> The issue (https://issues.apache.org/jira/browse/CXF-1200)  don't resolve 
> this problem.
> The same error is produced when is used wsdl2java 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to