我们可以使用错误序列来处理WSO2ESb中的错误,只有在企业服务总线级别上才能处理DSS级错误,还可以像主键违规、输入参数错误一样处理错误。
我们对WSO2DSS级别有任何单独的故障处理程序,否则我们只能在WSO2ESB级别处理。
我正在ESB端尝试,但我无法通过故障序列来处理它。
这是DSS级别的错误,我如何处理它:
ERROR {org.wso2.carbon.dataservices.core.description.query.SQLQuery} - ERROR: duplicate key value violates unique constraint "emp_pkey"
Detail: Key (eno)=(9) already exists.
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "emp_pkey"
Detail: Key (eno)=(9) already exists.
[2013-03-12 10:45:44,914] ERROR {org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver} - Error in in-only message receiver
DS Fault Message: Error in DS non result invoke.
DS Code: DATABASE_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: dept_DataService
Location: /dept_DataService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: insert_dept_operation
Current Params: {deptid=7, deptno=, deptname=hr}
Nested Exception:-
java.lang.NumberFormatException: For input string: ""ESb直接向客户端发送消息。
传达的信息是:
{"Exception":"DS Fault Message: Error in DS non result invoke.\nDS Code: DATABASE_ERROR\nNested Exception:-\njavax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'\nDS Code: DATABASE_ERROR\nSource Data Service:-\nName: dept_DataService\nLocation: \/dept_DataService.dbs\nDescription: N\/A\nDefault Namespace: http:\/\/ws.wso2.org\/dataservice\nCurrent Request Name: insert_dept_operation\nCurrent Params: {deptid=7, deptno=, deptname=hr}\nNested Exception:-\njava.lang.NumberFormatException: For input string: \"\"\n\n"}发布于 2013-03-13 12:40:08
因此,在这里,当DSS中发生错误时,它将向用户返回一个SOAP错误,在本例中是ESB。对于ESB来说,这仍然是另一个消息响应,它不会转到故障序列,除非您显式检查消息并执行必要的操作。但是从ESB 4.5.0开始,现在您可以选择说,如果响应是SOAP错误,则执行应该切换到错误序列。这在这里有详细的解释1。
1
干杯,安佳娜。
https://stackoverflow.com/questions/15354041
复制相似问题