5 Replies Latest reply on Mar 1, 2007 3:58 PM by Alejandro Guizar

    BPEL generate-artifacts error

    Philip Frost Newbie

      Hi,

      I am trying to simply make an external web service invocation from a BPEL script. I am basing the project on the HelloWorld example.

      JbossAS-4.0.4.GA
      JBPM-bpel-1.1.Beta3
      jdk1.5.0_11

      OK so i can successfully run:

      ant deploy-definition
      ant generate-service

      But when it comes to
      ant generate-artifacts
      I get the following output:
      D:\development\jbpm-bpel-1.1.Beta3\examples\listadmin>ant generate-artifacts
      Buildfile: build.xml
      
      detect-wsgenerator:
      
      generate-artifacts:
      
      setup-wstools:
      
      call-wstools:
       [wstools] 17:15:39,957 ERROR JBossXSErrorHandler : JBossWS_com_ericsson_listadmindbservice_webservices25724.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve.4.2]::Message=src-resolve.4.2: Error resolving component 'java:ServiceListRef'. It was detected that'java:ServiceListRef' is in namespace 'java:com.ericsson.listManagement.models', but components from this namespace are not referenceable from schema document 'file:/C:/DOCUME~1/frostp/LOCALS~1/Temp/JBossWS_com_ericsson_listadmindbservice_webservices25724.xsd'. If this is the incorrect namespace, perhaps the prefix of 'java:ServiceListRef' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/C:/DOCUME~1/frostp/LOCALS~1/Temp/JBossWS_com_ericsson_listadmindbservice_webservices25724.xsd'.
       [move] Moving 1 file to D:\development\jbpm-bpel-1.1.Beta3\examples\listadmin\target\resources\web
      
      setup-wscompile:
      
      BUILD SUCCESSFUL
      Total time: 2 seconds
      D:\development\jbpm-bpel-1.1.Beta3\examples\listadmin>



      I'm pretty sure the namespace for the complex "ServiceListRef"type is correct (well, I did create that webs ervice so it could be wrong)
      How can I place an import into a temporary file?

      I know that Ant says it has completed the task but when I run

      ant deploy
      the javac compiler can not see the auto generated Greeter.class and moans, so it can not have worked.


      My config looks thus:

      bpel-applications.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <bpelApplication name="ListAdmin" xmlns="http://jbpm.org/bpel"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jbpm.org/bpel
       http://jbpm.org/bpel/bpel_application_1_0.xsd" >
      
       <!-- START frostp; added for external web service -->
       <serviceCatalogs>
       <!-- listing of locally published WSDL documents -->
       <urlCatalog contextUrl="http://localhost:8080/">
      
       <!-- published WSDL document of ticket issuer -->
       <wsdl location="ListAdminDBService/ListAdminDBServiceService?wsdl" />
       </urlCatalog>
       </serviceCatalogs>
       <!-- END frostp; added for external web service -->
      
      </bpelApplication>



      bpel-definition.xml looks like:
      <?xml version="1.0" encoding="UTF-8"?>
      <bpelDefinition location="listadmin.bpel" xmlns="http://jbpm.org/bpel"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jbpm.org/bpel
       http://jbpm.org/bpel/bpel_definition_1_0.xsd">
      
       <!-- makes WSDL interface elements available to the process -->
       <imports>
       <wsdl location="listadmin.wsdl" />
       <wsdl location="interfaces/ListAdminDBServiceService.wsdl" />
       </imports>
      
      </bpelDefinition>


      listadmin.wsdl looks like:
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions targetNamespace="urn:samples:listadmin"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:tns="urn:samples:listadmin"
       xmlns:s0="http://com/ericsson/listadmindbservice/webservices"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
      
      
       <!-- Need to import the external file in order that we can see the definition of the external service -->
       <import namespace="http://com/ericsson/listadmindbservice/webservices" location="interfaces/ListAdminDBServiceService.wsdl" />
      
       <!-- START frostp describes the rel. between us and the DB access service -->
       <plt:partnerLinkType name="dbAccessPLT">
       <plt:role name="ListAdminDBService">
       <plt:portType name="s0:ListAdminDBService" />
       </plt:role>
       </plt:partnerLinkType>
       <!-- END frostp -->
      
       <!-- characterizes the relationship between the greeter and its caller -->
       <plt:partnerLinkType name="Greeter-Caller">
       <plt:role name="Greeter">
       <plt:portType name="tns:Greeter" />
       </plt:role>
       <!-- the Caller does not provide services to the Greeter,
       this is why we omit the "Caller" role -->
       </plt:partnerLinkType>
      
      
      
       <!-- carries the name of a person -->
       <message name="nameMessage">
       <part name="name" type="xsd:string" />
       </message>
      
       <!-- carries the greeting -->
       <message name="greetingMessage">
       <part name="greeting" type="xsd:string" />
       </message>
      
       <!-- describes the interface presented to callers -->
       <portType name="Greeter">
       <operation name="sayHello">
       <input message="tns:nameMessage" />
       <output message="tns:greetingMessage" />
       </operation>
       </portType>
      
      </definitions>




      and finally, listadmin.bpel looks like:
      <?xml version="1.0" encoding="UTF-8"?>
      <process name="ListAdmin" targetNamespace="urn:samples:listadmin"
       xmlns:s0="http://com/ericsson/listadmindbservice/webservices"
       xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
       xmlns:tns="urn:samples:listadmin"
       xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2003/03/business-process/
       http://schemas.xmlsoap.org/ws/2003/03/business-process/">
       <!-- xmlns:tns="http://jbpm.org/examples/listadmin" -->
      
       <partnerLinks>
       <!-- START frostp -->
       <partnerLink name="dbAccessPL" partnerLinkType="tns:dbAccessPLT" partnerRole="ListAdminDBService" />
       <!-- END frostp -->
      
       <!-- establishes the relationship with the caller agent -->
       <partnerLink name="caller" partnerLinkType="tns:Greeter-Caller"
       myRole="Greeter" />
       </partnerLinks>
      
       <variables>
       <!-- holds the incoming message -->
       <variable name="request" messageType="tns:nameMessage" />
       <!-- holds the outgoing message -->
       <variable name="response" messageType="tns:greetingMessage" />
      
       <!-- START frostp; Variables for DB access routines -->
       <variable name="dbRequest" messageType="s0:getServiceList" />
       <variable name="dbResponse" messageType="s0:getServiceListResponse" />
       <!-- START frostp; Variables for DB access routines -->
       </variables>
      
       <sequence>
      
       <!-- receive the name of a person -->
       <receive operation="sayHello" partnerLink="caller" portType="tns:Greeter"
       variable="request" createInstance="yes" />
      
       <!-- compose a greeting phrase -->
       <assign>
       <copy>
       <from expression="concat('Hello, ',
       bpel:getVariableData('request', 'name'), '!')" />
       <to variable="response" part="greeting" />
       </copy>
       </assign>
      
       <!-- START frostp; Call DB service -->
       <invoke operation="getServiceList" partnerLink="dbAccessPL"
       portType="s0:ListAdminDBService" inputVariable="dbRequest"
       outputVariable="dbResponse">
       </invoke>
       <!-- END frostp -->
      
      
      
       <!-- reply with the greeting -->
       <reply operation="sayHello" partnerLink="caller" portType="tns:Greeter"
       variable="response" />
      
       </sequence>
       </process>
      




      Oh yes, it might help to see the external WSDL file I've imported:

      <?xml version='1.0' encoding='UTF-8'?>
      <definitions name="ListAdminDBServiceServiceDefinitions" targetNamespace="http://com/ericsson/listadmindbservice/webservices" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s0="http://com/ericsson/listadmindbservice/webservices" xmlns:s1="http://schemas.xmlsoap.org/wsdl/soap/">
       <types>
       <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://com/ericsson/listadmindbservice/webservices" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="updateListEntry">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="slr" type="java:ServiceListRef" xmlns:java="java:com.ericsson.listManagement.models"/>
       <xs:element name="contact" type="java:Contact" xmlns:java="java:com.ericsson.listManagement.models"/>
       <xs:element name="newContact" type="java:Contact" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="updateListEntryResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="return" type="xs:boolean"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="deleteServiceList">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="slr" type="java:ServiceListRef" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="deleteServiceListResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="return" type="xs:boolean"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="addListEntry">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="slr" type="java:ServiceListRef" xmlns:java="java:com.ericsson.listManagement.models"/>
       <xs:element name="contact" type="java:Contact" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="addListEntryResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="return" type="xs:boolean"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="getListEntry">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="slr" type="java:ServiceListRef" xmlns:java="java:com.ericsson.listManagement.models"/>
       <xs:element name="userURI" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="getListEntryResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="return" type="java:Contact" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="deleteListEntry">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="slr" type="java:ServiceListRef" xmlns:java="java:com.ericsson.listManagement.models"/>
       <xs:element name="userURI" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="deleteListEntryResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="return" type="xs:boolean"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="getServiceList">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="slr" type="java:ServiceListRef" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="getServiceListResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="return" type="java:ArrayOfContact_literal" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       </xs:schema>
       <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:com.ericsson.listManagement.models" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:complexType name="Contact">
       <xs:sequence>
       <xs:element minOccurs="1" name="Priority" nillable="false" type="xs:int"/>
       <xs:element minOccurs="1" name="User" nillable="true" type="xs:string"/>
       <xs:element minOccurs="1" name="UserURI" nillable="true" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="ServiceListRef">
       <xs:sequence>
       <xs:element minOccurs="1" name="Service" nillable="true" type="xs:string"/>
       <xs:element minOccurs="1" name="Subscriber" nillable="true" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       <xs:complexType name="ArrayOfContact_literal">
       <xs:sequence>
       <xs:element maxOccurs="unbounded" minOccurs="0" name="Contact" nillable="true" type="java:Contact" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:sequence>
       </xs:complexType>
       <xs:element name="ArrayOfContact_literal" type="java:ArrayOfContact_literal" xmlns:java="java:com.ericsson.listManagement.models"/>
       </xs:schema>
       </types>
       <message name="updateListEntry">
       <part element="s0:updateListEntry" name="parameters"/>
       </message>
       <message name="updateListEntryResponse">
       <part element="s0:updateListEntryResponse" name="parameters"/>
       </message>
       <message name="deleteServiceList">
       <part element="s0:deleteServiceList" name="parameters"/>
       </message>
       <message name="deleteServiceListResponse">
       <part element="s0:deleteServiceListResponse" name="parameters"/>
       </message>
       <message name="addListEntry">
       <part element="s0:addListEntry" name="parameters"/>
       </message>
       <message name="addListEntryResponse">
       <part element="s0:addListEntryResponse" name="parameters"/>
       </message>
       <message name="getListEntry">
       <part element="s0:getListEntry" name="parameters"/>
       </message>
       <message name="getListEntryResponse">
       <part element="s0:getListEntryResponse" name="parameters"/>
       </message>
       <message name="deleteListEntry">
       <part element="s0:deleteListEntry" name="parameters"/>
       </message>
       <message name="deleteListEntryResponse">
       <part element="s0:deleteListEntryResponse" name="parameters"/>
       </message>
       <message name="getServiceList">
       <part element="s0:getServiceList" name="parameters"/>
       </message>
       <message name="getServiceListResponse">
       <part element="s0:getServiceListResponse" name="parameters"/>
       </message>
       <portType name="ListAdminDBService">
       <operation name="updateListEntry" parameterOrder="parameters">
       <input message="s0:updateListEntry"/>
       <output message="s0:updateListEntryResponse"/>
       </operation>
       <operation name="deleteServiceList" parameterOrder="parameters">
       <input message="s0:deleteServiceList"/>
       <output message="s0:deleteServiceListResponse"/>
       </operation>
       <operation name="addListEntry" parameterOrder="parameters">
       <input message="s0:addListEntry"/>
       <output message="s0:addListEntryResponse"/>
       </operation>
       <operation name="getListEntry" parameterOrder="parameters">
       <input message="s0:getListEntry"/>
       <output message="s0:getListEntryResponse"/>
       </operation>
       <operation name="deleteListEntry" parameterOrder="parameters">
       <input message="s0:deleteListEntry"/>
       <output message="s0:deleteListEntryResponse"/>
       </operation>
       <operation name="getServiceList" parameterOrder="parameters">
       <input message="s0:getServiceList"/>
       <output message="s0:getServiceListResponse"/>
       </operation>
       </portType>
       <binding name="ListAdminDBServiceServiceSoapBinding" type="s0:ListAdminDBService">
       <s1:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="updateListEntry">
       <s1:operation soapAction="" style="document"/>
       <input>
       <s1:body parts="parameters" use="literal"/>
       </input>
       <output>
       <s1:body parts="parameters" use="literal"/>
       </output>
       </operation>
       <operation name="deleteServiceList">
       <s1:operation soapAction="" style="document"/>
       <input>
       <s1:body parts="parameters" use="literal"/>
       </input>
       <output>
       <s1:body parts="parameters" use="literal"/>
       </output>
       </operation>
       <operation name="addListEntry">
       <s1:operation soapAction="" style="document"/>
       <input>
       <s1:body parts="parameters" use="literal"/>
       </input>
       <output>
       <s1:body parts="parameters" use="literal"/>
       </output>
       </operation>
       <operation name="getListEntry">
       <s1:operation soapAction="" style="document"/>
       <input>
       <s1:body parts="parameters" use="literal"/>
       </input>
       <output>
       <s1:body parts="parameters" use="literal"/>
       </output>
       </operation>
       <operation name="deleteListEntry">
       <s1:operation soapAction="" style="document"/>
       <input>
       <s1:body parts="parameters" use="literal"/>
       </input>
       <output>
       <s1:body parts="parameters" use="literal"/>
       </output>
       </operation>
       <operation name="getServiceList">
       <s1:operation soapAction="" style="document"/>
       <input>
       <s1:body parts="parameters" use="literal"/>
       </input>
       <output>
       <s1:body parts="parameters" use="literal"/>
       </output>
       </operation>
       </binding>
       <service name="ListAdminDBServiceService">
       <port binding="s0:ListAdminDBServiceServiceSoapBinding" name="ListAdminDBServiceSoapPort">
       <s1:address location="http://localhost:7001/ListAdminDBService/ListAdminDBService"/>
       </port>
       </service>
      </definitions>


      Any clues anybody?



        • 1. Re: BPEL generate-artifacts error
          Alejandro Guizar Master

          Apparently inline XML Schemas are handled by copying them to temporary files. While the error message may be misleading, it does indicate that definitions in your second schema cannot be located.

          Some items in the first schema reference items that are defined later in the second schema. Try moving the second schema above the first.

          Apart from that, consider that wstools currently does not support multiple namespaces and all generated artifacts will end up in the same java package. You might want to use wscompile instead.

          • 2. Re: BPEL generate-artifacts error
            Philip Frost Newbie

            HI,

            Thanks for the suggestions.


            Swapped the order of the in-line schema but had no effect.

            Also installed jwsdp2.0 and set up wscompile. Running this allowed me to generate-artifacts and deploy but the error message I got from wstools on my client side from before now appears on the server side and exceptions are thrown.

            Is this problem related to http://www.jboss.com/index.html?module=bb&op=viewtopic&t=101479 ?

            • 3. Re: BPEL generate-artifacts error
              Alejandro Guizar Master

              Do you get the exact same exception? It'd be useful to see the stack trace, just to verify.

              • 4. Re: BPEL generate-artifacts error
                Philip Frost Newbie

                Hmmm,

                Nope, it's a different exception it just prevents the WAR file from being built.

                The stack trace is:

                15:20:19,554 ERROR [MainDeployer] Could not create deployment: file:/D:/developm
                ent/jboss-4.0.4.GA/server/default/deploy/listadmin.war
                org.jboss.ws.WSException: Cannot find port in wsdl: {http://jbpm.org/examples/li
                stadmin}GreeterPort
                 at org.jboss.ws.metadata.JSR109ServerMetaDataBuilder.buildMetaData(JSR10
                9ServerMetaDataBuilder.java:141)
                 at org.jboss.ws.server.WebServiceDeployerJSE.createWebServicesMetaData(W
                ebServiceDeployerJSE.java:189)
                 at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java
                :103)
                 at org.jboss.ws.server.WebServiceDeployerJSE.create(WebServiceDeployerJS
                E.java:66)
                 at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.
                create(SubDeployerInterceptorSupport.java:180)
                 at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterce
                ptor.java:91)
                 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 $Proxy42.create(Unknown Source)
                 at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
                 at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
                 at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
                er.java:155)
                 at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                 at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
                or.java:133)
                 at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                 at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
                BeanOperationInterceptor.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 $Proxy6.deploy(Unknown Source)
                 at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
                tScanner.java:421)
                 at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
                canner.java:634)
                 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)


                Also I have quickly generated a "simpler" web service to invoke from my BPEL script. It has just two strings as input parameters, and I basically get to the same error state (above).



                • 5. Re: BPEL generate-artifacts error
                  Alejandro Guizar Master

                  The target generate-service creates binding and service definitions for your process. Look at the WSDL files it produces. The WSDL file that contains the service definition should have a targetNamespace that matches your BPEL file's:

                  <definitions targetNamespace="urn:samples:listadmin">
                   <import .../>
                   <service name="ListAdminService">
                   <port name="GreeterPort" ...>
                   <soap:address .../>
                   </port>
                   </service>
                  </definitions>

                  Therefore the wsdl-port in your webservices.xml should be something like:
                  <wsdl-port xmlns:portNS="urn:samples:listadmin">
                   portNS:GreeterPort
                  </wsdl-port>

                  I am guessing it looks like this instead:
                  <wsdl-port xmlns:portNS="http://jbpm.org/examples/listadmin">
                   portNS:GreeterPort
                  </wsdl-port>

                  Remember that the deployment model for BPEL processes is essentially equal to normal web services. When you are unsure about a setting, refer to Web Services for J2EE documentation or this forum for help. Literal text replacements might not always be enough.