Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B6F0179BB for ; Thu, 16 Apr 2015 08:28:42 +0000 (UTC) Received: (qmail 37918 invoked by uid 500); 16 Apr 2015 08:28:41 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 37843 invoked by uid 500); 16 Apr 2015 08:28:41 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 37831 invoked by uid 99); 16 Apr 2015 08:28:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2015 08:28:41 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of otinanism@gmail.com designates 209.85.212.173 as permitted sender) Received: from [209.85.212.173] (HELO mail-wi0-f173.google.com) (209.85.212.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2015 08:28:36 +0000 Received: by wiax7 with SMTP id x7so6004710wia.0 for ; Thu, 16 Apr 2015 01:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=V4/M/S/C5YDSmbtDSbKJjiR/Cr6sX5t20+/c6CBHAUg=; b=cBq7v1PMkjoLqUMrzY6zaJAPDEyfmsBltLmKUQCSmDMJzt3OMvEjCReUGhbwSf1D6v uw+bIM5dBa7xhZsvm+pTam2fh605H4WXKPJugDXJosSks8YcBUGnnB/rtqfoZRVy4J5d BTw43fz95VKY7QUUo+lZ9fD9LtGQTVBDMECanHWHaslZc5ySxWHTjR1LcKy5roZ66oTK NesPymStp2aL40wXacoP/+Pf/SgwMjf8y6GX2NfPOxJTm1hwSgMjBj+KV1wmA0Pt/nG1 mM4ChNCSurT2dsMEdxoLyFa7zQxANbl+Y4UJbc3eH3NBuXEf0iYmUXTtd1bMmKGjghEm lFLA== MIME-Version: 1.0 X-Received: by 10.194.90.15 with SMTP id bs15mr58916381wjb.22.1429172759734; Thu, 16 Apr 2015 01:25:59 -0700 (PDT) Received: by 10.28.216.203 with HTTP; Thu, 16 Apr 2015 01:25:59 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Apr 2015 11:25:59 +0300 Message-ID: Subject: Re: Failed to parse WSDL when there is no internet connection (java.net.UnknownHostException: www.w3.org) From: Alx To: users@cxf.apache.org Content-Type: multipart/alternative; boundary=047d7bfd0270aaafce0513d3364d X-Virus-Checked: Checked by ClamAV on apache.org --047d7bfd0270aaafce0513d3364d Content-Type: text/plain; charset=UTF-8 UPDATE: Debugging cxf code, I can see that my catalog files are picked (and actually in every of the above locations...). I could not debug any "deeper" because of some issues with my eclipse debugger, so I still do not know why CXF (actually the xerces library, according to the stacktrace) tries to contact the external host. Alex On Thu, Apr 16, 2015 at 9:32 AM, Alx wrote: > I also tried the catalog file specified here: > > > http://stackoverflow.com/questions/29148822/how-to-avoid-calling-w3-org-when-creating-an-xsd-schema-validator-in-grails > > Which mentions exactly my issue. > > I see nothing different and my main issue is that I do not know how to > check if the file is picked up or ignored. > > Alex > > On Thu, Apr 16, 2015 at 9:03 AM, Alx wrote: > >> I should mention that I tried adding the catalog file: >> 1) inside the META-INF of the jar project, >> 2) inside the WEB-INF folder of the war project and >> 3) inside the META-INF folder of the web project (which probably doesn't >> make sense). >> >> >> On Thu, Apr 16, 2015 at 8:55 AM, Alx wrote: >> >>> Thank you Dan. >>> >>> I tried the jax-ws-catalog.xml solution you mentioned but I could not >>> make it work. >>> >>> I have a web application which imports a jar (maven projects). In the >>> jar's META-INF folder I have a wsdl folder and inside the wsdl and required >>> xsd's. I added inside the META-INF folder the jax-ws-catalog.xml file: >>> >>> >>> >> prefer="system"> >>> >>> >> rewritePrefix="classpath:META-INF/wsdl/" /> >>> >>> >>> >>> I don't know if the location of the file is correct and also if the >>> rewriteSystem element is correct >>> (the import that fails is: >> schemaLocation="xmldsig-core-schema.xsd" />) >>> >>> Do you know if there is any way to verify if the catalog file is picked >>> up by CXF (i.e. debugging)? >>> >>> Alex >>> >>> On Wed, Apr 15, 2015 at 8:27 PM, Daniel Kulp wrote: >>> >>>> You will like need to download the various schemas that your wsdl uses >>>> including all the included schemas, package them in your war/jar, and >>>> either modify the imports of the schemas to point to your packaged versions >>>> or use a META-INF/jax-ws-catalog.xml file to rewrite the prefixes to point >>>> at your location. For example: >>>> >>>> >>> prefer="system"> >>>> >>> rewritePrefix="classpath:/schemas/wsdl"/> >>>> >>> rewritePrefix="classpath:/schemas/wsdl"/> >>>> >>>> >>>> >>>> Dan >>>> >>>> >>>> > On Apr 15, 2015, at 5:50 AM, Alx wrote: >>>> > >>>> > My web service works fine on my local machine. >>>> > >>>> > When I try to deploy to our TEST server (Wildfly) I get the following >>>> > exception: >>>> > >>>> > 12:38:07,090 WARNING >>>> > [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC >>>> service >>>> > thread 1-2) Failed to parse WSDL: javax.wsdl.WSDLException: >>>> WSDLException >>>> > (at >>>> /definitions/import/wsdl:definitions/wsdl:types/xs:schema/xs:schema): >>>> > faultCode=PARSER_ERROR: Problem parsing >>>> > >>>> 'vfs:/C:/dev/wildfly-8.2.0.Final/standalone/deployments/mybank-rs-web.war/WEB-INF/lib/mybank-rs-model-0.0.1-SNAPSHOT.jar/META-INF/wsdl/xmldsig-core-schema.xsd'.: >>>> > java.net.UnknownHostException: www.w3.org >>>> > at >>>> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:830) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:864) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:654) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:610) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> > >>>> com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:320) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(WSDLReaderImpl.java:470) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> > >>>> com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:312) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2352) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2338) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > at >>>> > >>>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:261) >>>> > [cxf-rt-core-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:206) >>>> > [cxf-rt-core-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.isEmptywsdl(ReflectionServiceFactoryBean.java:2607) >>>> > [cxf-rt-core-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.isFromWsdl(ReflectionServiceFactoryBean.java:543) >>>> > [cxf-rt-core-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:547) >>>> > [cxf-rt-core-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265) >>>> > [cxf-rt-core-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215) >>>> > [cxf-rt-frontend-jaxws-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102) >>>> > [cxf-rt-frontend-simple-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159) >>>> > [cxf-rt-frontend-simple-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211) >>>> > [cxf-rt-frontend-jaxws-2.7.13.jar:2.7.13] >>>> > at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456) >>>> > [cxf-rt-frontend-jaxws-2.7.13.jar:2.7.13] >>>> > at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334) >>>> > [cxf-rt-frontend-jaxws-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:66) >>>> > [jbossws-cxf-server-4.3.2.Final.jar:4.3.2.Final] >>>> > at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251) >>>> > [cxf-rt-frontend-jaxws-2.7.13.jar:2.7.13] >>>> > at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539) >>>> > [cxf-rt-frontend-jaxws-2.7.13.jar:2.7.13] >>>> > at >>>> > >>>> org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:118) >>>> > [jbossws-cxf-server-4.3.2.Final.jar:4.3.2.Final] >>>> > at >>>> > >>>> org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:136) >>>> > [jbossws-cxf-server-4.3.2.Final.jar:4.3.2.Final] >>>> > at >>>> > >>>> org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:68) >>>> > [jbossws-cxf-server-4.3.2.Final.jar:4.3.2.Final] >>>> > at >>>> > >>>> org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:75) >>>> > [wildfly-webservices-server-integration-8.2.0.Final.jar:8.2.0.Final] >>>> > at >>>> > >>>> org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) >>>> > at >>>> > >>>> org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) >>>> > at >>>> > >>>> org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) >>>> > at >>>> > >>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) >>>> > [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) >>>> > [rt.jar:1.8.0_31] >>>> > at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_31] >>>> > Caused by: java.net.UnknownHostException: www.w3.org >>>> > at >>>> > >>>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) >>>> > [rt.jar:1.8.0_31] >>>> > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) >>>> > [rt.jar:1.8.0_31] >>>> > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) >>>> > [rt.jar:1.8.0_31] >>>> > at java.net.Socket.connect(Socket.java:589) [rt.jar:1.8.0_31] >>>> > at java.net.Socket.connect(Socket.java:538) [rt.jar:1.8.0_31] >>>> > at sun.net.NetworkClient.doConnect(NetworkClient.java:180) >>>> [rt.jar:1.8.0_31] >>>> > at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) >>>> > [rt.jar:1.8.0_31] >>>> > at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) >>>> > [rt.jar:1.8.0_31] >>>> > at sun.net.www.http.HttpClient.(HttpClient.java:211) >>>> [rt.jar:1.8.0_31] >>>> > at sun.net.www.http.HttpClient.New(HttpClient.java:308) >>>> [rt.jar:1.8.0_31] >>>> > at sun.net.www.http.HttpClient.New(HttpClient.java:326) >>>> [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1168) >>>> > [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104) >>>> > [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998) >>>> > [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932) >>>> > [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512) >>>> > [rt.jar:1.8.0_31] >>>> > at >>>> > >>>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440) >>>> > [rt.jar:1.8.0_31] >>>> > at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown >>>> > Source) [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown >>>> Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown >>>> Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at >>>> > >>>> org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown >>>> > Source) [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at >>>> > >>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown >>>> > Source) [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) >>>> > [xercesImpl-2.9.1-jbossas-2.jar:] >>>> > at >>>> com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188) >>>> > [wsdl4j-1.6.3.jar:1.6.3] >>>> > ... 35 more >>>> > >>>> > >>>> > The web service is then generated without using my WSDL but instead >>>> from >>>> > the Interface: >>>> > >>>> > 12:38:07,101 INFO >>>> > [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC >>>> service >>>> > thread 1-2) Creating Service [...] from class [...] >>>> RoutingServiceInterface >>>> > >>>> > Which results in a generated WSDL that is not the original (does not >>>> > contain ws-policy elements). >>>> > >>>> > Any idea how to fix this without internet connection? >>>> > >>>> > Alex >>>> >>>> -- >>>> Daniel Kulp >>>> dkulp@apache.org - http://dankulp.com/blog >>>> Talend Community Coder - http://coders.talend.com >>>> >>>> >>> >> > --047d7bfd0270aaafce0513d3364d--