6 Replies Latest reply on Apr 6, 2010 4:21 AM by h.wolffenbuttel

    inXsd/outXsd using xs:include

    hauch

      Hi

       

      I'm exposing an esb service as webservice using the inXsd/outXsd approach.

       

      I have two services which returns the same xml snippet as part of the response. In my actions I would like to use jaxb to generate the responses.

       

      The natural way to do this would be to extract the snippet in a separate xsd, letting the response-xsd's include it (using xs:include). All xsd's are located in the root of the esb archive.

      But this gives me a wsdl exception (see below) saying that the referred xsd cannot be found.

       

      If I repeat the xsd snippet in my responses, I get a jaxb error during build, saying that the element already is defined - that said, I really don't like this way of doing it.

      It is easy enough to work around this be copying the snippet around with different names, but this is not exactly elegant....

       

      Do anybody have an example with in/out-Xsd referring to another xsd?

       

      Any help appreciated.

       

      Exception:

      13:10:44,256 ERROR [MainDeployer] Could not start deployment: file:/Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyyWS.war org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Cannot extract schema definition: java.io.FileNotFoundException: /Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyybWS-exp.war/WEB-INF/wsdl/yyy/projectDetails.xsd         at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:154)         at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)         at org.jboss.ws.metadata.builder.MetaDataBuilder.replaceAddressLocation(MetaDataBuilder.java:284)         at org.jboss.ws.metadata.builder.jaxws.JAXWSProviderMetaDataBuilder.buildProviderMetaData(JAXWSProviderMetaDataBuilder.java:147)         at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:55)         at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:63)         at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.create(UnifiedMetaDataDeploymentAspect.java:66)         at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(Unknown Source)         at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)         at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)         at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)         at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)         at $Proxy46.start(Unknown Source)         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)         at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)         at java.lang.reflect.Method.invoke(Method.java:592)         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)         at $Proxy9.deploy(Unknown Source)         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: Cannot extract schema definition: java.io.FileNotFoundException: /Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyyWS-exp.war/WEB-INF/wsdl/yyy/projectDetails.xsd         at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:384)         at org.jboss.ws.tools.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:172)         at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:128)         ... 38 more Caused by: java.io.FileNotFoundException: /Users/aaa/jboss/xxx_integration/server/default/tmp/deploy/esbwarfiles/yyyWS.esb/yyyWS-exp.war/WEB-INF/wsdl/yyy/projectDetails.xsd         at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:94)         at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:103)         at java.net.URL.openStream(URL.java:1007)         at org.jboss.ws.core.utils.ResourceURL.openStream(ResourceURL.java:57)         at org.jboss.ws.tools.wsdl.WSDL11Reader.processSchemaInclude(WSDL11Reader.java:518)         at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:375)         ... 40 more
        • 1. Re: inXsd/outXsd using xs:include
          massios

          Hello Morten,

           

          Yes we are using the inXsd, outXsd approach with xs:include and we had the same problem...

           

          In the end what we ended up doing is:

          a) having the in, out XSDs in the esbcontent folder

          b) having the includes also in the esbcontent folder

           

          This makes our esbcontent folder look terrible (I would prefer subdirectories for the xsds) but it works.

           

          I think more people have commented on this.

           

          Nikos.

          • 2. Re: inXsd/outXsd using xs:include
            kconner

            Can you create a simple test case and send me it?

             

            It may be that we have already addressed this in the CP branch, soon to be merged with trunk, but I would like to check.

            • 3. Re: inXsd/outXsd using xs:include
              hauch

              Thanks Kevin

               

              I have attached a simple esb archive which reproduces the error when deployed (let me know if this was not what you meant with a testcase).

              The service GetNewProjects returns some dummy data if working.

              Forgot to mention that I am running on JBESB_4_4_GA_CP2_CR4 on JBPAPP_4_3_0_GA_CP02.

               

              /Morten

              • 4. Re: inXsd/outXsd using xs:include
                h.wolffenbuttel

                Hi Kevin,

                 

                Any word on the subject? I have the same problem, putting all my xsd's into the esb contentdirectory to make it work. Not to mension changing the xsd's include line everytime there is a new version of the xsd. (we built government apps so we have to use the xsd's which are handed to us)

                 

                If there is a Jira, I would like to know where it is (please link )!

                 

                Regards,

                 

                Hans

                • 5. Re: inXsd/outXsd using xs:include

                  I am having the similar issue. Any word on this? I am using JBossESB 4.5

                   

                  Also it look like few people here got it working by puttin the files under esbcontent folder. Can anyone tell where this folder will be in esb archive? I am storing all of XSDs at root of the esb archive. Do I need to create a new folder esbcontent and put it there?

                   

                  Update::::: It looks like it works fine with JBoss ESB4.7

                  • 6. Re: inXsd/outXsd using xs:include
                    h.wolffenbuttel

                    Hi,

                     

                    Could this JIRA (which is solved in 4.8 but not yet released) be the answer of our problem?

                     

                    https://jira.jboss.org/jira/browse/JBESB-3027

                     

                    Regards,

                     

                    Hans