4 Replies Latest reply on Mar 1, 2012 10:03 AM by balind7

    parsing of external dtd

    balind7

      Hi,

       

      we are trying to port a larger application from JBoss 5.1 to JBoss 7.1.

       

      I have some problems porting a web service from the metro stack to the cxf stack.

      The web service is packaged in an ear, I have added jboss-deployment-structure.xml and module manifest entries

      to the web service endpoint.

       

      External dtds are referenced in our wsdl files. To avoid external loading of these dtds I have added jax-ws-catalog.xml to the Endpoint project (in WEB_INF folder)

       

      I am using jboss-as-7.1.0.Beta1. I have read in this forum that there have been problems with reading jax-ws-catalog.xml. Therefore I also tested with jboss-as-7.1.0.CR1-SNAPSHOT from 14.12.2011 (which has added xml-resolver in org.apache.cxf).

       

      When deploying the ear file I got exceptions (in both versions):

       

      Failed to start service jboss.deployment.subunit."STS.ear"."sts-endpoint.war".INSTALL: org.j

      boss.msc.service.StartException in service jboss.deployment.subunit."STS.ear"."my-endpoint.war".INSTALL: Failed to process phase INSTALL of subdeployment "my-endpoint.war" of

      deployment "MyEar.ear"

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.CR1-SNAPSHOT.jar:]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]

      Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

              at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:350)

              at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:88)

              at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:239)

              at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:509)

              at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:117)

              at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:109)

              at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:132)

              at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1-SNAPSHOT.jar:]

              ... 5 more

      Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

              at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)

              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:369)

              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:505)

              at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:241)

              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)

              at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)

              at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:157)

              at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:202)

              at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:433)

              at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:322)

              ... 13 more

      Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'http://docs.oasis-open.org/ws-sx/ws-tr

      ust/200512/ws-trust-1.3.xsd'.: java.net.ConnectException: Connection refused: 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.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 org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:237)

              at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)

              at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)

              ... 22 more

      Caused by: java.net.ConnectException: Connection refused: connect

              at java.net.PlainSocketImpl.socketConnect(Native Method) [:1.6.0_29]

              at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) [:1.6.0_29]

              at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) [:1.6.0_29]

              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) [:1.6.0_29]

              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) [:1.6.0_29]

              at java.net.Socket.connect(Socket.java:529) [:1.6.0_29]

              at java.net.Socket.connect(Socket.java:478) [:1.6.0_29]

              at sun.net.NetworkClient.doConnect(NetworkClient.java:163) [:1.6.0_29]

              at sun.net.www.http.HttpClient.openServer(HttpClient.java:395) [:1.6.0_29]

              at sun.net.www.http.HttpClient.openServer(HttpClient.java:530) [:1.6.0_29]

              at sun.net.www.http.HttpClient.<init>(HttpClient.java:234) [:1.6.0_29]

              at sun.net.www.http.HttpClient.New(HttpClient.java:307) [:1.6.0_29]

              at sun.net.www.http.HttpClient.New(HttpClient.java:324) [:1.6.0_29]

              at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970) [:1.6.0_29]

              at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911) [:1.6.0_29]

              at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836) [:1.6.0_29]

              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172) [:1.6.0_29]

              at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:986)

              at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:143)

              at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:802)

              at org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:768)

              at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)

              at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)

              at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:285)

              ... 32 more

       

       

      Anybody have suggestions?

      Thanks

      Baerbel

        • 1. Re: parsing of external dtd
          jim.ma

          The jax-ws-catalog.xml should be under META-INF. Can you move to META-INF/jax-ws-catalog.xml and have a try ?

          1 of 1 people found this helpful
          • 2. Re: parsing of external dtd
            balind7

            I have tried to deploy my application with JBoss 7.1.0 Final and I got the same exceptions.

             

            My application is packaged in an .ear file. This ear files contains several jar files and a war file with the web service endpoint.

             

            I placed my jax-ws-catalog.xml file for test into several locations:

            META-INF from the .ear file

            WEB-INF from the web service endpoint war file.

             

            My web service endpoint uses @WebService annotation with wsdlLocation parameter.

            The error occurs reading the wsdl. The wsdl is located in WEB-INF/wsdl of the web service endpoint.

             

            It seems that the jax-ws-catalog.xml file is never read. Are there any additional trace opportunities?

            I have already added an extra logger to standalone.xml:

            <logger category="org.jboss.as.jpa">

                            <level name="TRACE"/>

            </logger>

            • 3. Re: parsing of external dtd
              sfcoy

              I suspect that Jim meant the WEB-INF/classes/META-INF directory.

               

              Resources in an EAR file are not normally directly accessible from applications.

              • 4. Re: parsing of external dtd
                balind7

                Thanks, that was the right tip.

                 

                I added my jax-ws-catalog.xml to the WEB-INF/classes/META-INF directory. I also added my donwloaded xsd file directory pubxsd to this directory and used the notation:

                 

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

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

                ....

                <system systemId="http://docs.oasis-open.org/ws-sx/ws-trust/200512/ws-trust-1.3.xsd"

                            uri="classpath:/pubxsd/docs.oasis-open.org/ws-sx/ws-trust/200512/ws-trust-1.3.xsd"/>

                ...

                </catalog>

                 

                The web service is now deployable.