6 Replies Latest reply on Oct 12, 2009 5:47 AM by rashem

    A tutorial to deploy a Netbeans created BPEL process under J

    zazzaz

      Hi,
      this is a tutorial to deploy a Netbeans created bpel to
      jboss 4.0.5 + jbpm-bpel 1.1.3 beta.
      So no reply as bug report is necessary.

      Suppose the name of the .bpel is processo.bpel and
      you have all the wsdl the bpel requires in the same dir.

      You've to replace processo with your process name

      Follow these steps


      1)Go to examples dir of your jbpm-bpel installation and
      create a folder with the same name of the .bpel file.

      In this tutorial processo.

      1.1 Copy from hello example the build file and replace
      "hello" with your process dir name (processo)

      1.2 Create dir src. Inside src, bpel. Inside bpel META-INF.


      1.3 In bpel dir copy all the files .bpel and .wsdl.


      1.4 In META-INF copy bpel-application from hello/src/bpel/META-INF
      and open it replacing hello with processo.

      1.5 If jboss server isn't up, make it running (run.sh or rub.bat)

      1.6 From example/process run ant deploy-definition

      1.7 You've done a successfull deploy if you got a 200 code response
      from the server.

      2) From example/process run ant generate-service

      This operation will create under the target dir under example/processo
      some files...

      3) The hottest part. Making artifacts...

      3.1 From hello/src/main/resources copy all files and dir to processo/src/main/resources

      3.2 Open wscompile.xml and replace hello with processo

      E.g.

      <?xml version="1.0"?>




      3.3 Same operation for wstools.xml

      Esempio

      <?xml version="1.0"?>


      <package-namespace package="org.jbpm.bpel.tutorial.processo"
      namespace="http://jbpm.org/examples/processo" />

      <wsdl-java file="wsdl/processo-service.wsdl">

      </wsdl-java>



      3.4 Go to target/resources/web and open processo-service.wsdl
      and processo-binding.wsdl. You can now read important info to
      correctly fill the fields of files for artifacts.

      3.5 Go to src/main/resources/web and open webservice.xml and web.xml

      3.6 In web.xml modify the word Greeter with the one you prefer.

      3.7 Modify webservice.xml as follows:

      3.4.1 web service description name: whatever you want
      3.4.2 wsdl-file: the one tool-generated and that you can find under target/resources/web
      It is the -service.wsdl terminating file (processo-service.wsdl).
      3.4.3 port-component-name : The one you find in the (processo)-service.wsdl as attribute name of port.
      3.4.4 service-endpoint-interface: whatever you want. This name will be used to generate a class.
      3.4.5 servlet-link: the one you type in web.xml for tag servlet-name
      3.4.6 handler-name: whatever you want


      3.5 Go to examples/processo and console type ant generate-artifacts


      4) The last step: deploy and interface writing

      In web.xml you specified a servlet class

      <servlet-class>org.jbpm.bpel.tutorial.processo.Client_Impl</servlet-class>


      In src/main/java you have to recreate the same dir structure
      (/src/main/java/org/jbpm/bpel/tutorial/processo) and the file
      (Client_Impl.java).
      This class has to implement the interface Client that has been create in
      example/target/java/.....
      Implement the interface.


      4.1 Go to processo-binding you find in target/resources/web/wsdl and add
      import for client. I.e. the webservice providing the info for the receive
      and reply operation underthe bpel file



      Don't type ant deploy or you'll see org.jboss.ws.WSException in server log
      saying it isn't able to find the port type in the specified namespace


      4.2 Modificy jaxrpc-mapping.xml and processo-service.wsdl. To find the proper values
      you have to find the wsdl of the Client. Es Client.wsdl

      4.2.1 --> jaxrpc-mapping.xml
      <port-name>ClientPortType</port-name>
      <java-port-name>ClientPortType</java-port-name>

      You can read this values from Client.wsdl in field

      <wsdl:portType name="ClientPortType">

      Do the same with

      <wsdl-port-type xmlns:portTypeNS="http://j2ee.netbeans.org/wsdl/Client">portTypeNS:ClientPortType</wsdl-port-type>
      <wsdl-binding xmlns:bindingNS="http://j2ee.netbeans.org/wsdl/Client">bindingNS:ClientBinding</wsdl-binding>

      and type for binding the value you find for Client.wsdl for binding

      <wsdl:binding name="ClientBinding" type="tns:ClientPortType">


      4.3 In examples/processo type ant deploy and if you read in server log something like

      INFO [TomcatDeployer] deploy, ctxPath=/processo, warUrl=.../tmp/deploy/tmp28869processo-exp.war/
      WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.bpel.graph.def.CompositeActivity - this operation breaks ==
      INFO [IntegrationConfigurator] Message reception enabled for process: HelloWorld
      INFO [WSDLFilePublisher] WSDL published to: file:/home/zazzaz/Tesi_Workflow/jboss-4.0.5.GA/server/default/data/wsdl/processo.war/processo-service.wsdl
      INFO [ServiceEndpointManager] WebService started: http://zazzaz-desktop:8080/processo/client


      you won!

        • 1. Re: A tutorial to deploy a Netbeans created BPEL process und
          burrsutter

          Please consider taking this and putting together a wiki page along with the appropriate screenshots. It would make an awesome contribution to the project.

          Burr

          • 2. Re: A tutorial to deploy a Netbeans created BPEL process und
            zazzaz

            Hi,
            I'll do as soon as possible.

            ZazzaZ

            • 3. Re: A tutorial to deploy a Netbeans created BPEL process und
              depstei2

              I have been trying to deploy a simple service created with the eclipse bpel designer on 4.0.4.GA and jbpm-bpel 1.1.3 beta, but I keep getting this message:

              16:27:28,250 INFO [[/jbpm-bpel]] processDeployServlet: deploying process definition: file=file:/C:/projects/jbpm-bpel-1.1.Beta3/examples/EchoService2/target/EchoService2-process.zip
              16:27:28,250 INFO [BpelReader] read wsdl definitions: EchoService2.wsdl
              16:27:28,250 ERROR [ProblemHandler] EchoService2.bpel activity not found [/bpws:process]
              16:27:28,250 INFO [BpelReader] read bpel process: EchoService2.bpel
              16:27:28,250 ERROR [[processDeployServlet]] Servlet.service() for servlet processDeployServlet threw exception
              org.jbpm.jpdl.JpdlException: [[ERROR] EchoService2.bpel activity not found [/bpws:process]]
               at org.jbpm.jpdl.par.ProcessArchive.parseProcessDefinition(ProcessArchive.java:84)
               at org.jbpm.bpel.web.ProcessDeployServlet.doGet(ProcessDeployServlet.java:50)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)


              The bpel and wsdl work fine in netbeans,
              here is the wsdl:
              <?xml version="1.0"?>
              <definitions name="EchoService2"
               targetNamespace="http://student.kuali.org/bpel/EchoService2"
               xmlns:tns="http://student.kuali.org/bpel/EchoService2"
               xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
               xmlns="http://schemas.xmlsoap.org/wsdl/"
               >
               <types>
               <schema attributeFormDefault="unqualified" elementFormDefault="qualified"
               targetNamespace="http://student.kuali.org/bpel/EchoService2"
               xmlns="http://www.w3.org/2001/XMLSchema">
              
               <element name="EchoService2Request">
               <complexType>
               <sequence>
               <element name="request" type="string"/>
               </sequence>
               </complexType>
               </element>
              
               <element name="EchoService2Response">
               <complexType>
               <sequence>
               <element name="response" type="string"/>
               </sequence>
               </complexType>
               </element>
               </schema>
               </types>
               <message name="EchoService2RequestMessage">
               <part name="payload" element="tns:EchoService2Request"/>
               </message>
               <message name="EchoService2ResponseMessage">
               <part name="payload" element="tns:EchoService2Response"/>
               </message>
              
               <!-- portType implemented by the EchoService2 BPEL process -->
               <portType name="EchoService2">
               <operation name="process">
               <input message="tns:EchoService2RequestMessage" />
               <output message="tns:EchoService2ResponseMessage"/>
               </operation>
               </portType>
              
               <plnk:partnerLinkType name="EchoService2PLT">
               <plnk:role name="EchoService2Provider" portType="tns:EchoService2"/>
               </plnk:partnerLinkType>
              
              </definitions>
              
              

              and here is the bpel:
              <?xml version="1.0" encoding="UTF-8"?>
              <bpws:process exitOnStandardFault="yes" name="EchoService2"
               suppressJoinFailure="yes"
               targetNamespace="http://student.kuali.org/bpel/EchoService2"
               xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:tns="http://student.kuali.org/bpel/EchoService2">
               <bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
               location="EchoService2.wsdl" namespace="http://student.kuali.org/bpel/EchoService2"/>
               <bpws:partnerLinks>
               <bpws:partnerLink myRole="EchoService2Provider" name="client" partnerLinkType="tns:EchoService2PLT"/>
               </bpws:partnerLinks>
               <bpws:variables>
               <bpws:variable messageType="tns:EchoService2RequestMessage" name="input"/>
               <bpws:variable messageType="tns:EchoService2ResponseMessage" name="output"/>
               </bpws:variables>
               <bpws:sequence name="main">
               <bpws:receive createInstance="yes" name="receiveInput"
               operation="process" partnerLink="client"
               portType="tns:EchoService2" variable="input"/>
               <bpws:assign name="Assign" validate="yes">
               <bpws:copy>
               <bpws:from part="payload" variable="input">
               <bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[/tns:request]]></bpws:query>
               </bpws:from>
               <bpws:to part="payload" variable="output">
               <bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[/tns:response]]></bpws:query>
               </bpws:to>
               </bpws:copy>
               </bpws:assign>
               <bpws:reply name="replyOutput" operation="process"
               partnerLink="client" portType="tns:EchoService2" variable="output"/>
               </bpws:sequence>
              </bpws:process>

              Here is the definition:
              <bpelDefinition location="EchoService2.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="EchoService2.wsdl" />
               </imports>
              
              </bpelDefinition>

              Am I missing something obvious? I can deploy the examples without any errors.

              • 4. Re: A tutorial to deploy a Netbeans created BPEL process und
                aguizar

                jBPM BPEL supports a significant subset of WS-BPEL 2.0. However, you have to use the following namespace instead of the one used in the OASIS standard:

                http://schemas.xmlsoap.org/ws/2004/03/business-process/

                The discrepancy is due to compatibility with the Eclipse BPEL designer.


                • 5. Re: A tutorial to deploy a Netbeans created BPEL process und
                  zazzaz

                  I forgot one important thing.
                  In webservices.xml substitute the param-value with the name of the partner-link on which you perform the receive

                  <init-param>

                  name of the partner link served by this port

                  <param-name>partnerLinkHandle</param-name>
                  <param-value>partnerlinkname</param-value>
                  </init-param>

                  • 6. Re: A tutorial to deploy a Netbeans created BPEL process und

                    Hi depstei2,

                    As you are saying 'I can deploy the examples without any errors.', can you please let me know whether you deployed the jbpm-bpel1.1.1 examples in jBoss using NetBeans BPEL designer?

                    If yes, can you please share the steps?

                    I am struggling with it and need a solution urgently.

                    If anyone can help in this, it`ll be very helpful.

                    Thanks.