1 Reply Latest reply: Nov 12, 2008 8:23 AM by 843830 RSS

    Error while polling a db

    843830
      Hi,

      In my project I am polling a table and writing the contents to a File. I am recieving the following assign failure error.

      Executing sql . select * from Test
      normalized message
      Accepted the message in JDBC Binding. 121696963109189-36475-134457920143720246
      BPCOR-6151:The process instance has been terminated because a fault was not handled; Fault Name is {http://docs.oasis-open.org/wsbpel/2.0/process/executable}selectionFailure; Fault Data is null
      com.sun.jbi.engine.bpel.core.bpel.exception.StandardException: I18N: BPCOR-3023: Selection Failure occurred in BPEL({http://enterprise.netbeans.org/bpel/MyTestBPEL/NewBPELProcess}NewBPELProcess) at line 22!
      BPCOR-6129:Line Number is 20
      BPCOR-6130:Activity Name is Assign1
      at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELInterpreter.createVirtualFaultUnit(BPELInterpreter.java:235)
      at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELInterpreter.execute(BPELInterpreter.java:203)
      at com.sun.jbi.engine.bpel.core.bpel.engine.BusinessProcessInstanceThread.execute(BusinessProcessInstanceThread.java:98)
      at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELProcessManagerImpl.process(BPELProcessManagerImpl.java:998)
      at com.sun.jbi.engine.bpel.core.bpel.engine.impl.EngineImpl.process(EngineImpl.java:351)
      at com.sun.jbi.engine.bpel.core.bpel.engine.impl.EngineImpl.process(EngineImpl.java:1314)
      at com.sun.jbi.engine.bpel.BPELSEInOutThread.processRequest(BPELSEInOutThread.java:632)
      at com.sun.jbi.engine.bpel.BPELSEInOutThread.processMsgEx(BPELSEInOutThread.java:305)
      at com.sun.jbi.engine.bpel.BPELSEInOutThread.run(BPELSEInOutThread.java:191)
      Accepted message with exchange ID 121696963109189-36475-134457920143720246 in JDBC outbound message processor.
      Accepted message with exchange ID 121696963109189-36475-134457920143720246 in JDBC outbound message processor.
      Response for message with exchange ID 121696963109189-36475-134457920143720246 received after 30ms.
      Pattern for exchange Id 121696963109189-36475-134457920143720246 is http://www.w3.org/2004/08/wsdl/in-only.
      Received in-only message 121696963109189-36475-134457920143720246.
      Processing one-way inbound messages...
      Executing sql . delete from Test where Test.ID=12
      Records deleted are:1
      Finished processing message with exchange id of [121696963109189-36475-134457920143720246]. Removing the exchange id...

      Can u please help me out in resolving this issue.

      Thanks and Regards,
      Jay
        • 1. Re: Error while polling a db
          843830
          Below is my CASA code ----

          <?xml version="1.0" encoding="UTF-8" standalone="no"?>
          <casa xmlns="http://java.sun.com/xml/ns/casa" xmlns:ns1="http://j2ee.netbeans.org/wsdl/FileWSDL" xmlns:ns2="http://j2ee.netbeans.org/wsdl/TestDBWSDL" xmlns:ns3="TestCA" xmlns:ns4="http://enterprise.netbeans.org/bpel/MyTestBPEL/NewBPELProcess" xmlns:xlink="http://www.w3.org/2000/xlink">
          <endpoints>
          <endpoint endpoint-name="FileWSDLPort" interface-name="ns1:FileWSDLPortType" name="endpoint1" service-name="ns1:FileWSDLService"/>
          <endpoint endpoint-name="port" interface-name="ns2:jdbcPortType" name="endpoint2" service-name="ns2:service"/>
          <endpoint endpoint-name="casaPort1" interface-name="ns1:FileWSDLPortType" name="endpoint3" service-name="ns3:casaService1"/>
          <endpoint endpoint-name="casaPort2" interface-name="ns1:FileWSDLPortType" name="endpoint4" service-name="ns3:casaService2"/>
          <endpoint display-name="PartnerLink1" endpoint-name="jdbcPortTypeRole_myRole" file-path="NewBPELProcess.bpel" interface-name="ns2:jdbcPortType" name="endpoint5" process-name="NewBPELProcess" service-name="ns4:PartnerLink1"/>
          <endpoint display-name="PartnerLink2" endpoint-name="FileWSDLPortTypeRole_partnerRole" file-path="NewBPELProcess.bpel" interface-name="ns1:FileWSDLPortType" name="endpoint6" process-name="NewBPELProcess" service-name="ns4:PartnerLink2"/>
          </endpoints>
          <service-units>
          <service-engine-service-unit artifacts-zip="MyTestBPEL.jar" component-name="sun-bpel-engine" defined="true" description="Represents this Service Unit" internal="true" name="TestCA-MyTestBPEL" unit-name="MyTestBPEL" unknown="false" x="153" y="99">
          <provides endpoint="endpoint5"/>
          <consumes endpoint="endpoint6"/>
          </service-engine-service-unit>
          <binding-component-service-unit artifacts-zip="sun-file-binding.jar" component-name="sun-file-binding" description="Represents this Service Unit" name="TestCA-sun-file-binding" unit-name="sun-file-binding">
          <ports>
          <port bindingType="file" x="67" y="243">
          <link xlink:href="../jbiasa/TestCA.wsdl#xpointer(/definitions/service[@name='casaService2']/port[@name='casaPort2'])" xlink:type="simple"/>
          <consumes endpoint="endpoint4"/>
          <provides endpoint="endpoint4"/>
          </port>
          </ports>
          </binding-component-service-unit>
          <binding-component-service-unit artifacts-zip="sun-jdbc-binding.jar" component-name="sun-jdbc-binding" description="Represents this Service Unit" name="TestCA-sun-jdbc-binding" unit-name="sun-jdbc-binding">
          <ports>
          <port x="67" y="39">
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/TestDBWSDL.wsdl#xpointer(/definitions/service[@name='service']/port[@name='port'])" xlink:type="simple"/>
          <consumes endpoint="endpoint2"/>
          <provides endpoint="endpoint2"/>
          </port>
          </ports>
          </binding-component-service-unit>
          <binding-component-service-unit artifacts-zip="sun-http-binding.jar" component-name="sun-http-binding" description="Represents this Service Unit" name="TestCA-sun-http-binding" unit-name="sun-http-binding">
          <ports>
          <port state="deleted" x="67" y="118">
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/FileWSDL.wsdl#xpointer(/definitions/service[@name='FileWSDLService']/port[@name='FileWSDLPort'])" xlink:type="simple"/>
          <consumes endpoint="endpoint1"/>
          <provides endpoint="endpoint1"/>
          </port>
          </ports>
          </binding-component-service-unit>
          </service-units>
          <connections>
          <connection consumer="endpoint2" provider="endpoint5" state="unchanged"/>
          <connection consumer="endpoint6" provider="endpoint4" state="new"/>
          <connection consumer="endpoint6" provider="endpoint1" state="deleted"/>
          </connections>
          <porttypes>
          <link xlink:href="../jbiasa/TestCA.wsdl#xpointer(/definitions/portType[@name='dummyCasaPortType'])" xlink:type="simple"/>
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/FileWSDL.wsdl#xpointer(/definitions/portType[@name='FileWSDLPortType'])" xlink:type="simple"/>
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/TestDBWSDL.wsdl#xpointer(/definitions/portType[@name='jdbcPortType'])" xlink:type="simple"/>
          </porttypes>
          <bindings>
          <link xlink:href="../jbiasa/TestCA.wsdl#xpointer(/definitions/binding[@name='casaBinding1'])" xlink:type="simple"/>
          <link xlink:href="../jbiasa/TestCA.wsdl#xpointer(/definitions/binding[@name='casaBinding2'])" xlink:type="simple"/>
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/FileWSDL.wsdl#xpointer(/definitions/binding[@name='FileWSDLBinding'])" xlink:type="simple"/>
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/TestDBWSDL.wsdl#xpointer(/definitions/binding[@name='binding'])" xlink:type="simple"/>
          </bindings>
          <services>
          <link xlink:href="../jbiasa/TestCA.wsdl#xpointer(/definitions/service[@name='casaService1'])" xlink:type="simple"/>
          <link xlink:href="../jbiasa/TestCA.wsdl#xpointer(/definitions/service[@name='casaService2'])" xlink:type="simple"/>
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/FileWSDL.wsdl#xpointer(/definitions/service[@name='FileWSDLService'])" xlink:type="simple"/>
          <link xlink:href="../jbiServiceUnits/MyTestBPEL/TestDBWSDL.wsdl#xpointer(/definitions/service[@name='service'])" xlink:type="simple"/>
          </services>
          <regions>
          <region name="WSDL Endpoints" width="150"/>
          <region name="JBI Modules" width="500"/>
          <region name="External Modules" width="200"/>
          </regions>
          </casa>

          Below is my BPEL Code _--

          <?xml version="1.0" encoding="UTF-8"?>
          <process
          name="NewBPELProcess"
          targetNamespace="http://enterprise.netbeans.org/bpel/MyTestBPEL/NewBPELProcess"
          xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://enterprise.netbeans.org/bpel/MyTestBPEL/NewBPELProcess" xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace" xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor" xmlns:ns0="http://j2ee.netbeans.org/xsd/tableSchema">
          <import namespace="http://j2ee.netbeans.org/wsdl/TestDBWSDL" location="TestDBWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
          <import namespace="http://j2ee.netbeans.org/wsdl/FileWSDL" location="FileWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
          <partnerLinks>
          <partnerLink name="PartnerLink2" xmlns:tns="http://j2ee.netbeans.org/wsdl/FileWSDL" partnerLinkType="tns:FileWSDL" partnerRole="FileWSDLPortTypeRole"/>
          <partnerLink name="PartnerLink1" xmlns:tns="http://j2ee.netbeans.org/wsdl/TestDBWSDL" partnerLinkType="tns:jdbcpartner" myRole="jdbcPortTypeRole"/>
          </partnerLinks>
          <variables>
          <variable name="FileWSDLOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/FileWSDL" messageType="tns:FileWSDLOperationRequest"/>
          <variable name="PollrecordsIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/TestDBWSDL" messageType="tns:inputMsg"/>
          </variables>
          <sequence>
          <receive name="ReceiveFromDB" createInstance="yes" partnerLink="PartnerLink1" operation="pollrecords" xmlns:tns="http://j2ee.netbeans.org/wsdl/TestDBWSDL" portType="tns:jdbcPortType" variable="PollrecordsIn"/>
          <assign name="Assign1">
          <copy>
          <from>$PollrecordsIn.part/ns0:record/ns0:Name</from>
          <to>$FileWSDLOperationIn.Message/ns0:record/ns0:Name</to>
          </copy>
          <copy>
          <from>$PollrecordsIn.part/ns0:record/ns0:Flag</from>
          <to>$FileWSDLOperationIn.Message/ns0:record/ns0:Flag</to>
          </copy>
          <copy>
          <from>$PollrecordsIn.part/ns0:record/ns0:ID</from>
          <to>$FileWSDLOperationIn.Message/ns0:record/ns0:ID</to>
          </copy>
          </assign>
          <invoke name="InvoketoFile" partnerLink="PartnerLink2" operation="FileWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/FileWSDL" portType="tns:FileWSDLPortType" inputVariable="FileWSDLOperationIn"/>
          </sequence>
          </process>

          FileWSDL :-

          <?xml version="1.0" encoding="UTF-8"?>
          <definitions name="FileWSDL" targetNamespace="http://j2ee.netbeans.org/wsdl/FileWSDL"
          xmlns="http://schemas.xmlsoap.org/wsdl/"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://j2ee.netbeans.org/wsdl/FileWSDL" xmlns:ns="http://j2ee.netbeans.org/xsd/tableSchema" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
          <types>
          <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/FileWSDL">
          <xsd:import namespace="http://j2ee.netbeans.org/xsd/tableSchema" schemaLocation="Test.xsd"/>
          </xsd:schema>
          </types>
          <message name="FileWSDLOperationRequest">
          <part name="Message" element="ns:Test"/>
          </message>
          <portType name="FileWSDLPortType">
          <operation name="FileWSDLOperation">
          <input name="input1" message="tns:FileWSDLOperationRequest"/>
          </operation>
          </portType>
          <binding name="FileWSDLBinding" type="tns:FileWSDLPortType">
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
          <operation name="FileWSDLOperation">
          <soap:operation/>
          <input name="input1">
          <soap:body use="literal"/>
          </input>
          </operation>
          </binding>
          <service name="FileWSDLService">
          <port name="FileWSDLPort" binding="tns:FileWSDLBinding">
          <soap:address location="http://localhost:${HttpDefaultPort}/FileWSDLService/FileWSDLPort"/>
          </port>
          </service>
          <plnk:partnerLinkType name="FileWSDL">
          <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.
          In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
          A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
          <plnk:role name="FileWSDLPortTypeRole" portType="tns:FileWSDLPortType"/>
          </plnk:partnerLinkType>
          </definitions>

          TestDB WSDL

          <?xml version="1.0" encoding="UTF-8"?>
          <definitions name="TestDBWSDL" targetNamespace="http://j2ee.netbeans.org/wsdl/TestDBWSDL" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://j2ee.netbeans.org/xsd/tableSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://j2ee.netbeans.org/wsdl/TestDBWSDL" xmlns:plink="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/">
          <types>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/">
          <xsd:import namespace="http://j2ee.netbeans.org/xsd/tableSchema" schemaLocation="Test.xsd"/>
               </xsd:schema>
          </types>
          <message name="insertRetMsg">
          <part name="part" type="xsd:int"/>
          </message>
          <message name="inputMsg">
          <part name="part" element="ns:Test"/>
          </message>
          <message name="outputMsg">
          <part name="part" element="ns:Test"/>
          </message>
          <portType name="jdbcPortType">
          <operation name="insert">
          <input name="inputInsert" message="tns:inputMsg"/>
          <output name="outputInsert" message="tns:insertRetMsg"/>
          </operation>
          <operation name="update">
          <input name="inputUpdate" message="tns:inputMsg"/>
          </operation>
          <operation name="delete">
          <input name="inputDelete" message="tns:inputMsg"/>
          </operation>
          <operation name="find">
          <input name="inputFind" message="tns:inputMsg"/>
          <output name="outputFind" message="tns:outputMsg"/>
          </operation>
          <operation name="pollrecords">
          <input name="inputPoll" message="tns:inputMsg"/>
          </operation>
          </portType>
          <binding name="binding" type="tns:jdbcPortType">
          <jdbc:binding xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/"/>
          <operation name="insert">
          <jdbc:operation xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/"/>
          <input name="inputInsert">
          <jdbc:input xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" MarkColumnName="" MarkColumnValue="" MoveRowToTableName="" PKName="ID" PollMilliSeconds="5000" PollingPostProcessing="MoveRow" TableName="Test" Transaction="NOTransaction" numberOfRecords="" operationType="insert" paramOrder="Name,Flag,ID" sql="insert into "dbo"."Test" ("Name","Flag","ID") values (?,?,?)"/>
          </input>
          <output name="outputInsert">
          <jdbc:output xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" returnPartName="part"/>
          </output>
          </operation>
          <operation name="update">
          <jdbc:operation xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/"/>
          <input name="inputUpdate">
          <jdbc:input xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" MarkColumnName="" MarkColumnValue="" MoveRowToTableName="" PKName="ID" PollMilliSeconds="5000" PollingPostProcessing="MoveRow" TableName="Test" Transaction="NOTransaction" numberOfRecords="" operationType="update" paramOrder="Name,Flag,ID" sql="update "dbo"."Test" set "dbo"."Test"."Name" = ?,"dbo"."Test"."Flag" = ?,"dbo"."Test"."ID" = ?"/>
          </input>
          </operation>
          <operation name="delete">
          <jdbc:operation xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/"/>
          <input name="inputDelete">
          <jdbc:input xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" MarkColumnName="" MarkColumnValue="" MoveRowToTableName="" PKName="ID" PollMilliSeconds="5000" PollingPostProcessing="MoveRow" TableName="Test" Transaction="NOTransaction" numberOfRecords="" operationType="delete" paramOrder="" sql="delete from "dbo"."Test""/>
          </input>
          </operation>
          <operation name="find">
          <jdbc:operation xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/"/>
          <input name="inputFind">
          <jdbc:input xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" MarkColumnName="" MarkColumnValue="" MoveRowToTableName="" PKName="ID" PollMilliSeconds="5000" PollingPostProcessing="MoveRow" TableName="Test" Transaction="NOTransaction" numberOfRecords="" operationType="find" paramOrder="" sql="select "Name","Flag","ID" from "dbo"."Test""/>
          </input>
          <output name="outputFind">
          <jdbc:output xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" returnPartName="part"/>
          </output>
          </operation>
          <operation name="pollrecords">
          <jdbc:operation xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/"/>
          <input name="inputPoll">
          <jdbc:input xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" MarkColumnName="" MarkColumnValue="" MoveRowToTableName="" PKName="ID" PollMilliSeconds="5000" PollingPostProcessing="Delete" TableName="Test" Transaction="NOTransaction" numberOfRecords="" operationType="poll" paramOrder="" sql="select "Name","Flag","ID" from "dbo"."Test""/>
          </input>
          </operation>
          </binding>
          <service name="service">
          <port name="port" binding="tns:binding">
          <jdbc:address xmlns:jdbc="http://schemas.sun.com/jbi/wsdl-extensions/jdbc/" jndiName="jdbc/__ebonding"/>
          </port>
          </service>
          <plink:partnerLinkType xmlns:plink="http://docs.oasis-open.org/wsbpel/2.0/plnktype" name="jdbcpartner">
          <plink:role name="jdbcPortTypeRole" portType="tns:jdbcPortType"/>
          </plink:partnerLinkType>
          </definitions>