11 Replies Latest reply on Aug 4, 2013 11:44 PM by sfcoy

    Problem loading .WSDL file on /WEB-INF/ folder

    bsl.lacerda

      Hi all,

       

      I'm trying to publish a service but I'm getting some issues probably related with JBoss Modules.

      The problem is FileInputStream class from rt.jar is trying to load my .wsdl file from JBoss bin folder.

       

      Here is the stacktrace:

       

      Caused by: java.io.FileNotFoundException: C:\REDHAT\APPS\jboss-as-7.1.1.Final\bin\WEB-INF\wsdl\EntradaNotaFiscalService.wsdl (O sistema não pode encontrar o caminho especificado)

                at java.io.FileInputStream.open(Native Method) [rt.jar:1.6.0_24]

                at java.io.FileInputStream.<init>(Unknown Source) [rt.jar:1.6.0_24]

                at java.io.FileInputStream.<init>(Unknown Source) [rt.jar:1.6.0_24]

                at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source) [rt.jar:1.6.0_24]

                at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source) [rt.jar:1.6.0_24]

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

                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)

                ... 28 more

       

       

      Does anyone know how to configure deployment structure or sun.jdk module to verify the /WEB-INF/ folder from my .war?

       

      Thanks in advance.

        • 1. Re: Problem loading .WSDL file on /WEB-INF/ folder
          sfcoy

          You have not provided us much to go on here.

           

          What is the entire stacktrace? ("... 28 more" suggests that there is more somewhere)

           

          Where is the "/WEB-INF/wsdl/EntradaNotaFiscalService.wsdl" reference coming from? Is it prefixed with a "file://" scheme?

          • 2. Re: Problem loading .WSDL file on /WEB-INF/ folder
            bsl.lacerda

            Hi Stephen,

             

            first of all thanks for the reply.

             

            The "/WEB-INF/wsdl/EntradaNotaFiscalService.wsdl" is the value of wsdlLocation attribute of the @javax.jws.WebService annotation.

             

            @javax.jws.WebService(

                                  serviceName = "EntradaServiceService",

                                  portName = "EntradaServicePort",

                                  targetNamespace = "http://entrada.service.app/",

                                  wsdlLocation = "WEB-INF/wsdl/EntradaNotaFiscalService.wsdl",

                                  endpointInterface = "app.service.entrada.EntradaService")                     

            public class EntradaServiceImpl implements EntradaService {...}

             

            The entire Stacktrace:

             

            10:31:11,822 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {http://entrada.service.app/}EntradaServiceService from WSDL: WEB-INF/wsdl/EntradaNotaFiscalService.wsdl

            10:31:11,922 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."stok-adapter-stok.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."stok-adapter-stok.war".INSTALL: Failed to process phase INSTALL of deployment "stok-adapter-stok.war"

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

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

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

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_24]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_24]

                      at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_24]

            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:113)

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

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

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                      ... 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:205)

                      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:203)

                      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: faultCode=PARSER_ERROR: Problem parsing 'WEB-INF/wsdl/EntradaNotaFiscalService.wsdl'.: java.io.FileNotFoundException: C:\REDHAT\APPS\jboss-as-7.1.1.Final\bin\WEB-INF\wsdl\EntradaNotaFiscalService.wsdl (O sistema não pode encontrar o caminho especificado)

                      at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(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:244)

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

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

                      ... 22 more

            Caused by: java.io.FileNotFoundException: C:\REDHAT\APPS\jboss-as-7.1.1.Final\bin\WEB-INF\wsdl\EntradaNotaFiscalService.wsdl (O sistema não pode encontrar o caminho especificado)

                      at java.io.FileInputStream.open(Native Method) [rt.jar:1.6.0_24]

                      at java.io.FileInputStream.<init>(Unknown Source) [rt.jar:1.6.0_24]

                      at java.io.FileInputStream.<init>(Unknown Source) [rt.jar:1.6.0_24]

                      at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source) [rt.jar:1.6.0_24]

                      at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source) [rt.jar:1.6.0_24]

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

                      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)

                      ... 28 more

             

            Thanks in advance.

            • 3. Re: Problem loading .WSDL file on /WEB-INF/ folder
              sfcoy

              Is this a WAR only deployment?

               

              Please list all the jars in your WEB-INF/lib directory.

              • 4. Re: Problem loading .WSDL file on /WEB-INF/ folder
                bsl.lacerda

                Yes, is only a WAR deployment.

                 

                The libs are on an module but the problem happen even if the jars are embedded on the WAR.

                 

                The module degfinition:

                 

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

                <module xmlns="urn:jboss:module:1.1" name="stok-adapter-stok.lib" slot="main">

                    <properties>

                        <property name="jboss.api" value="private"/>

                    </properties>

                    <resources>

                  <resource-root path="_commons-digester-1.0.jar"/>

                  <resource-root path="activation-1.1.1-redhat-2.jar"/>

                  <resource-root path="antlr-2.7.6.jar"/>

                  <resource-root path="aopalliance-1.0.jar"/>

                  <resource-root path="camel-core-2.11.0.jar"/>

                  <resource-root path="camel-jackson-2.11.0.jar"/>

                  <resource-root path="camel-jaxb-2.11.0.jar"/>

                  <resource-root path="camel-restlet-2.11.0.jar"/>

                  <resource-root path="camel-spring-2.11.0.jar"/>

                  <resource-root path="camel-stream-2.11.0.jar"/>

                  <resource-root path="commons-beanutils-1.7.0.jar"/>

                  <resource-root path="commons-collections-3.2.1.jar"/>

                  <resource-root path="commons-fileupload-1.2.jar"/>

                  <resource-root path="commons-io-1.3.2.jar"/>

                  <resource-root path="commons-lang-2.6.jar"/>

                  <resource-root path="commons-logging-1.0.3.jar"/>

                  <resource-root path="cxf-api-2.2.3.jar"/>

                  <resource-root path="cxf-common-schemas-2.2.3.jar"/>

                  <resource-root path="cxf-common-utilities-2.2.3.jar"/>

                  <resource-root path="cxf-rt-core-2.2.3.jar"/>

                  <resource-root path="cxf-rt-transports-http-2.2.3.jar"/>

                  <resource-root path="cxf-rt-transports-http-jetty-2.2.3.jar"/>

                  <resource-root path="ejb3-persistence-1.0.1.GA.jar"/>

                  <resource-root path="FastInfoset-1.2.7.jar"/>

                  <resource-root path="geronimo-activation_1.1_spec-1.0.2.jar"/>

                  <resource-root path="geronimo-annotation_1.0_spec-1.1.1.jar"/>

                  <resource-root path="geronimo-javamail_1.4_spec-1.6.jar"/>

                  <resource-root path="geronimo-servlet_2.5_spec-1.2.jar"/>

                  <resource-root path="geronimo-stax-api_1.0_spec-1.0.1.jar"/>

                  <resource-root path="gmbal-api-only-3.0.0-b023.jar"/>

                  <resource-root path="hibernate-annotations-3.3.1.GA.jar"/>

                  <resource-root path="hibernate-commons-annotations-3.0.0.ga.jar"/>

                  <resource-root path="hibernate-core-3.3.2.GA.jar"/>

                  <resource-root path="istack-commons-runtime-2.2.jar"/>

                  <resource-root path="jackson-annotations-2.1.4.jar"/>

                  <resource-root path="jackson-core-2.1.4.jar"/>

                  <resource-root path="jackson-core-asl-1.9.11.jar"/>

                  <resource-root path="jackson-databind-2.1.4.jar"/>

                  <resource-root path="jackson-mapper-asl-1.9.11.jar"/>

                  <resource-root path="jaxb-api-2.1.jar"/>

                  <resource-root path="jaxb-impl-2.1.13.jar"/>

                  <resource-root path="jaxb-xjc-2.2.1.1.jar"/>

                  <resource-root path="jaxws-api-2.2.1.jar"/>

                  <resource-root path="jaxws-rt-2.2.1.jar"/>

                  <resource-root path="jaxws-tools-2.2.1.jar"/>

                  <resource-root path="jetty-6.1.19.jar"/>

                  <resource-root path="jetty-util-6.1.19.jar"/>

                  <resource-root path="joda-time-2.1.jar"/>

                  <resource-root path="json-simple-1.1.jar"/>

                  <resource-root path="jsr181-api-1.0-MR1-redhat-3.jar"/>

                  <resource-root path="jsr250-api-1.0.jar"/>

                  <resource-root path="jta-1.1.jar"/>

                  <resource-root path="jtds-1.2.4.jar"/>

                  <resource-root path="log4j-1.2.17.jar"/>

                  <resource-root path="management-api-3.0.0-b012.jar"/>

                  <resource-root path="mimepull-1.4.jar"/>

                  <resource-root path="neethi-2.0.4.jar"/>

                  <resource-root path="org.restlet-2.0.15.jar"/>

                  <resource-root path="policy-2.2.1.jar"/>

                  <resource-root path="resolver-20050927.jar"/>

                  <resource-root path="saaj-api-1.3.1.jar"/>

                  <resource-root path="saaj-impl-1.3.4.jar"/>

                  <resource-root path="slf4j-api-1.6.6.jar"/>

                  <resource-root path="slf4j-log4j12-1.6.6.jar"/>

                  <resource-root path="spring-aop-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-asm-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-beans-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-context-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-core-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-expression-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-jdbc-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-test-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-tx-3.1.4.RELEASE.jar"/>

                  <resource-root path="spring-web-3.1.4.RELEASE.jar"/>

                  <resource-root path="stax-api-1.0.1.jar"/>

                  <resource-root path="stax-api-1.0.jar"/>

                  <resource-root path="stax-ex-1.2.jar"/>

                  <resource-root path="streambuffer-1.1.jar"/>

                  <resource-root path="txw2-20090102.jar"/>

                  <resource-root path="wsdl4j-1.6.2.jar"/>

                  <resource-root path="wstx-asl-3.2.1.jar"/>

                  <resource-root path="XmlSchema-1.4.5.jar"/>

                    </resources>

                    <dependencies>

                  <module name="javaee.api" slot="main"/>

                  <module name="org.jboss.vfs" slot="main"/>

                  <module name="org.apache.log4j" slot="main"/>

                  <module name="org.slf4j" slot="main"/>

                    </dependencies>

                </module>

                 

                and the Deployment Structure:

                 

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

                <jboss-deployment-structure>

                  <deployment>      

                  <dependencies>

                  <module name="stok-adapter-stok.conf" slot="main"/>

                  <module name="stok-adapter-stok.lib" slot="main">

                    <imports>

                      <include path="META-INF**"/>

                      <include path="org**"/>

                    </imports>

                  </module>

                  </dependencies>  

                  </deployment>

                </jboss-deployment-structure>

                • 5. Re: Problem loading .WSDL file on /WEB-INF/ folder
                  sfcoy

                  I think you need to get rid of the following jars from your module:

                   

                    <resource-root path="activation-1.1.1-redhat-2.jar"/>

                    <resource-root path="cxf-api-2.2.3.jar"/>

                    <resource-root path="cxf-common-schemas-2.2.3.jar"/>

                    <resource-root path="cxf-common-utilities-2.2.3.jar"/>

                    <resource-root path="cxf-rt-core-2.2.3.jar"/>

                    <resource-root path="cxf-rt-transports-http-2.2.3.jar"/>

                    <resource-root path="cxf-rt-transports-http-jetty-2.2.3.jar"/>

                    <resource-root path="ejb3-persistence-1.0.1.GA.jar"/>

                   

                    <resource-root path="geronimo-activation_1.1_spec-1.0.2.jar"/>

                    <resource-root path="geronimo-annotation_1.0_spec-1.1.1.jar"/>

                    <resource-root path="geronimo-javamail_1.4_spec-1.6.jar"/>

                    <resource-root path="geronimo-servlet_2.5_spec-1.2.jar"/>

                    <resource-root path="geronimo-stax-api_1.0_spec-1.0.1.jar"/>

                    <resource-root path="hibernate-annotations-3.3.1.GA.jar"/>

                    <resource-root path="hibernate-commons-annotations-3.0.0.ga.jar"/>

                    <resource-root path="hibernate-core-3.3.2.GA.jar"/>

                    <resource-root path="jaxb-api-2.1.jar"/>

                    <resource-root path="jaxb-impl-2.1.13.jar"/>

                    <resource-root path="jaxb-xjc-2.2.1.1.jar"/>

                    <resource-root path="jaxws-api-2.2.1.jar"/>

                    <resource-root path="jaxws-rt-2.2.1.jar"/>

                    <resource-root path="jaxws-tools-2.2.1.jar"/>

                    <resource-root path="jetty-6.1.19.jar"/>

                    <resource-root path="jetty-util-6.1.19.jar"/>

                    <resource-root path="jsr181-api-1.0-MR1-redhat-3.jar"/>

                    <resource-root path="jsr250-api-1.0.jar"/>

                    <resource-root path="jta-1.1.jar"/>

                    <resource-root path="management-api-3.0.0-b012.jar"/>

                    <resource-root path="resolver-20050927.jar"/>

                    <resource-root path="saaj-api-1.3.1.jar"/>

                    <resource-root path="saaj-impl-1.3.4.jar"/>

                    <resource-root path="stax-api-1.0.1.jar"/>

                    <resource-root path="stax-api-1.0.jar"/>

                    <resource-root path="stax-ex-1.2.jar"/>

                    <resource-root path="streambuffer-1.1.jar"/>

                    <resource-root path="wsdl4j-1.6.2.jar"/>

                    <resource-root path="wstx-asl-3.2.1.jar"/>

                   

                  These all contain classes that JBossAS/WildFly provides for you and they will cause all sorts of issues, such as the one you're having. I think AS7+ only supports Hibernate 3.5 and newer too.

                   

                  Every Java EE implementation since 1.4 has contained a full web service stack. Adding your own is a recipe for classloading problems.

                  • 6. Re: Problem loading .WSDL file on /WEB-INF/ folder
                    bsl.lacerda

                    Hi,

                     

                    I did what you told but it didn't took any effect, the error remains.

                    I will keep the jars excluded from my module. ;-)

                     

                    I would like to understand why the rt.jar in JBoss module is trying to load the file on JBoss bin folder.
                    I'm not seeing any way to solve the problem except creating a floder structutre on JBoss bin folder and place the .wsdl there.

                    Ex: C:\REDHAT\APPS\jboss-as-7.1.1.Final\bin\myappresourcefolder\wsdl\EntradaNotaFiscalService.wsdl

                     

                    What do you think about this approach?
                    I suspect this is not a best pratice but will solve my problem and also will be protable to run the App on WildFly and EAP 6.

                    • 7. Re: Problem loading .WSDL file on /WEB-INF/ folder
                      sfcoy

                      Hi Bruno,

                       

                      I tried this myself and found that it is a bug in JBossAS 7.1.1.

                       

                      It works fine in 7.2.0 or EAP 6.1.0

                      • 8. Re: Problem loading .WSDL file on /WEB-INF/ folder
                        bsl.lacerda

                        Hi Stephen,

                         

                        thank you very much for tried yourself and confirm that it is a bug on AS 7.1.1 (our current version).
                        I'll check on EAP 6.1.0 that is the EAP version we are using here.

                         

                        Stephen, On JBoss Download page the latest available version is 7.1.1 Final.

                        Is JBoss/WildFly 7.2.0 Final available or it is still in Beta?

                        If it is already available, could you point me to the download page?

                         

                        Thanks in advance.

                        • 9. Re: Problem loading .WSDL file on /WEB-INF/ folder
                          sfcoy

                          http://www.jboss.org/jbossas/downloads has the EAP download. I do recommend you get a subscription if your project can handle it.

                           

                          If you want any other version you can just grab the tag from github and build it yourself. It's pretty easy.

                          • 10. Re: Problem loading .WSDL file on /WEB-INF/ folder
                            bsl.lacerda

                            The client has EAP subscription and we are already using it on version 6.1.0.
                            Is AS 7.2.0 final from github?

                            If so, please give the link.

                             

                            Thanks in advance.

                            • 11. Re: Problem loading .WSDL file on /WEB-INF/ folder
                              sfcoy

                              Bruno,

                               

                              I believe that you are free to develop on the EAP 6.1 release that can be downloaded. That is the appropriate thing to do if your client has an EAP subscription. In my experience RedHat has never been after subscription income for development purposes.

                               

                              The github tags are available from https://github.com/wildfly/wildfly. You may want to read Hacking on WildFly as well.