3 Replies Latest reply on Sep 28, 2010 8:16 PM by ffang

    jax-ws-catalog.xml ignored, cxf se starts very slow when no internet access

    jupiterrster

      I would appreciate an answer with a possible solution on issue below.

       

      I'm using Fuse-esb-3.4.0.5 with two web services deployed on it.

      Both service assemblies has CxfBC and CxfSE components.

       

      The jax-ws-catalog.xml file with following content included into lib/cxf-api-2.2.6-fuse-01-00.jar file of servicemix-cxf-se-2009.01.0.5-fuse-installer.zip file.

      <?xml version="1.0" encoding="UTF-8" ?>

      <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">

          <rewriteSystem systemIdStartString="http://www.w3.org/2006/03/addressing" rewritePrefix="classpath:/schemas/wsdl"/>

      </catalog>

       

      If machine has internet access, SAs need about 30 seconds to became in "Started" state.

      When internet access for this machine blocked by network firewall, SAs need from 3 to 15 minutes to became in "Started" state.

      servicemix.log file contains messages below in this case:

      09/20 18:24:13,863 | WARN  | Timer-3 | WSDL1Processor           | org.apache.servicemix.jbi.framework.support.WSDL1Processor  115 | Error retrieving interfaces from service description: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema[3]): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'http://www.w3.org/2006/03/addressing/ws-addr.xsd'.: java.net.UnknownHostException: www.w3.org

      09/20 18:24:13,864 | DEBUG | Timer-3 | WSDL1Processor           | org.apache.servicemix.jbi.framework.support.WSDL1Processor  117 | Error retrieving interfaces from service description

      javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema[3]): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'http://www.w3.org/2006/03/addressing/ws-addr.xsd'.: java.net.UnknownHostException: www.w3.org

          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 org.apache.servicemix.jbi.framework.support.WSDL1Processor.process(WSDL1Processor.java:75)

          at org.apache.servicemix.jbi.framework.EndpointRegistry.registerInternalEndpoint(EndpointRegistry.java:212)

          at org.apache.servicemix.jbi.framework.Registry.activateEndpoint(Registry.java:195)

          at org.apache.servicemix.jbi.framework.ComponentContextImpl.activateEndpoint(ComponentContextImpl.java:126)

          at org.apache.servicemix.common.endpoints.ProviderEndpoint.activate(ProviderEndpoint.java:59)

          at org.apache.servicemix.common.DefaultServiceUnit.init(DefaultServiceUnit.java:54)

          at org.apache.servicemix.common.BaseServiceUnitManager.init(BaseServiceUnitManager.java:122)

          at org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle.init(ServiceUnitLifeCycle.java:85)

          at org.apache.servicemix.jbi.framework.ServiceAssemblyLifeCycle.start(ServiceAssemblyLifeCycle.java:145)

          at org.apache.servicemix.jbi.framework.DeploymentService.start(DeploymentService.java:390)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:351)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:255)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:658)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:63)

          at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:622)

          at java.util.TimerThread.mainLoop(Timer.java:512)

          at java.util.TimerThread.run(Timer.java:462)

      Caused by: java.net.UnknownHostException: www.w3.org

          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)

          at java.net.Socket.connect(Socket.java:520)

          at java.net.Socket.connect(Socket.java:470)

          at sun.net.NetworkClient.doConnect(NetworkClient.java:157)

          at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)

          at sun.net.www.http.HttpClient.openServer(HttpClient.java:523)

          at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)

          at sun.net.www.http.HttpClient.New(HttpClient.java:304)

          at sun.net.www.http.HttpClient.New(HttpClient.java:321)

          at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:813)

          at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:765)

          at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:690)

          at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:934)

          at java.net.URL.openStream(URL.java:1007)

          at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)

          ... 24 more

       

      Is there other place where the jax-ws-catalog.xml file need to be added to configure OASIS Catalog? Other solution?

       

      This issue is not occurs when running under Fuse-esb-3.4.0.1.

       

      This happens on Solaris10.

       

      Thanks.

        • 1. Re: jax-ws-catalog.xml ignored, cxf se starts very slow when no internet access
          ffang

          Hi,

           

          So you add jax-ws-catalog.xml for pointing w3c schemas to local copies, but this jax-ws-catelog.xml not get picked up, right?

           

          Could you tell me the exact path where you put jax-ws-catalog.xml? It's supposed to be as META-INF/jax-ws-catalog.xml by default.

           

          Or you can use system property xml.catalog.files to point to anywhere you want, you can add this property in your smx start script yourself.

           

          Btw, the reason why it connect w3c to load xsd is that your code has a field javax.xml.ws.wsaddressing.W3CEndpointReference, when build servicemix model from the  SEI, it will try to build schema from the javax.xml.ws.wsaddressing.W3CEndpointReference, which as you see get exception when your machine has no network access.

          To avoid this, you can use the org.apache.cxf.ws.addressing.EndpointReferenceType shipped with cxf, using

          ./wsdl2java -noAddressBinding your_wsdl.wsdl

          can generate org.apache.cxf.ws.addressing.EndpointReferenceType instead of javax.xml.ws.wsaddressing.W3CEndpointReference for your auto-generated stuff.

          You also need replace org.apache.cxf.ws.addressing.EndpointReferenceType with javax.xml.ws.wsaddressing.W3CEndpointReference in your impl class of cxfse su.

           

          Using cxf side EndpointReferenceType, you can get rid of jax-ws-catalog.xml overriding stuff, this would be another option.

           

          Freeman

          • 2. Re: jax-ws-catalog.xml ignored, cxf se starts very slow when no internet access
            jupiterrster

            Hi Freeman,

             

            Yes, it looks like jax-ws-catalog.xml file is not get picked up.

             

            The exact path is META-INF/jax-ws-catalog.xml inside cxf-api-2.2.6-fuse-01-00.jar file of servicemix-cxf-se-2009.01.0.5-fuse-installer.zip file.

             

            I've tried to set xml.catalog.files property as -Dxml.catalog.files="$SERVICEMIX_HOME/conf/jax-ws-catalog.xml" argument for JVM and put mentioned jax-ws-catalog.xml file to $SERVICEMIX_HOME/conf directory and then run servicemix. Result: the same symptoms.

             

            I've tried to use -noAddressBinding option for my auto-generated stuff and checked my classes. The code doesn't have reference to javax.xml.ws.wsaddressing.W3CEndpointReference. Result: the same symptoms.

             

            Am i done something wrong?

            Do you have any other ideas how to fix or find the cause of this issue?

             

            Thanks for your help and time.

            • 3. Re: jax-ws-catalog.xml ignored, cxf se starts very slow when no internet access
              ffang

              Hi,

               

              Could please you send me your testcase with -noAddressBinding, I'll take a look when I get chance.

               

              Freeman