-->

How can i handle this in Wso2ESB which is not pass

2019-08-28 03:00发布

问题:

i am inserting in multiple table some of those is directly insertion and some more is we need split it means use iterate mediator i have done using two proxy and add fault sequence also insertion is ok if my DSS is down it is passing proper fault to client .the problem is when error occuers in dss like ..primarykey voilation like this i added this property <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/> in every sequence even though its throwing like this error

 ERROR - NativeWorkerPool Uncaught exception
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.
 at [row,col {unknown-source}]: [1,167]

and its giving ESB side error like above i am attaching my fault sequence ..

<sequence xmlns="http://ws.apache.org/ns/synapse" name="fault">
   <property xmlns:ns="http://org.apache.synapse/xsd" name="actionid" expression="get-property('actionid')"/>
   <property xmlns:ns="http://org.apache.synapse/xsd" name="actiondetailid" expression="get-property('actiondetailid')"/>
   <dbreport>
      <connection>
         <pool>
            <password>Youtility11</password>
            <user>youtilitydba</user>
            <url>jdbc:postgresql://localhost:5432/USCProduction</url>
            <driver>org.postgresql.Driver</driver>
         </pool>
      </connection>
      <statement>
         <sql>
            <![CDATA[                                                                                    delete from tactiondetail where actiondetailid=?]]></sql>
            <parameter xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('actiondetailid')" type="BIGINT"/>
         </statement>
      </dbreport>
      <log level="full"/>
      <dbreport>
         <connection>
            <pool>
               <password>Youtility11</password>
               <user>youtilitydba</user>
               <url>jdbc:postgresql://localhost:5432/USCProduction</url>
               <driver>org.postgresql.Driver</driver>
            </pool>
         </connection>
         <statement>
            <sql>
               <![CDATA[                                                                                                         delete from tactiondetail where actionid=?]]></sql>
               <parameter xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('actionid')" type="BIGINT"/>
            </statement>
         </dbreport>
         <log>
            <property name="MESSAGE" value="Executing default 'fault' sequence"/>
            <property xmlns:ns="http://org.apache.synapse/xsd" name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
            <property xmlns:ns="http://org.apache.synapse/xsd" name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
         </log>
         <switch xmlns:ns="http://org.apache.synapse/xsd" source="get-property('ERROR_CODE')">
            <case regex="500000">
               <property name="ERROR_MESSAGE" value="duplicate key value violates or The system is attempting to access an inactive service " scope="default" type="STRING"/>
            </case>
            <case regex="101503">
               <property name="ERROR_MESSAGE" value="Error connecting to the back end" scope="default" type="STRING"/>
            </case>
         </switch>
         <payloadFactory>
            <format>
               <ResponseJSON xmlns="">
                  <Exception>$1</Exception>
                  <Status>$2</Status>
                  <Total>0</Total>
               </ResponseJSON>
            </format>
            <args>
               <arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ERROR_MESSAGE')"/>
               <arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('ERROR_CODE')"/>
            </args>
         </payloadFactory>
         <header name="To" action="remove"/>
         <property name="RESPONSE" value="true" scope="default" type="STRING"/>
         <property name="NO_ENTITY_BODY" action="remove" scope="axis2"/>
         <log level="full"/>
         <send/>
      </sequence>

its passing fault message whenever dss is off but not passing when dss is running mode giving error like this

Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.
 at [row,col {unknown-source}]: [1,167]

回答1:

As the error says: "Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs." it seems that you are using a reserved word "xml" in the response that you return from DSS. Please double check the XML response from DSS, and run the response trough an XML validator (may be use Eclipse XML validator) to see if the response is all OK.