我遇到了一个问题,无法找到解决方法(或者我正在错误的解决方法)。当我的服务生成某些异常时,似乎序列化会失败。这导致获得一个包装的异常,这很痛苦,因为调用客户端接收到的错误信息很差,我想我从原始异常中丢失了有用的信息。
在下面的示例中,是S3存储桶访问问题,但我也遇到了一些SQL异常类似的问题。
如果我能够使我的服务直接介入,那将非常有用。理想情况下,应添加一些自定义异常序列化代码。
在下面的示例中,是S3存储桶访问问题,但我也遇到了一些SQL异常类似的问题。
如果我能够使我的服务直接介入,那将非常有用。理想情况下,应添加一些自定义异常序列化代码。
> com.amazonaws.services.simpleworkflow.flow.DataConverterException:
> Failure serializing
> "com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client
> received SOAP Fault from server: Access Denied (Service: Amazon S3;
> Status Code: 403; Error Code: AccessDenied; Request ID: AAAAAAAAAAAA)
> Please see the server log to find more detail regarding exact cause of
> the failure." of type "class
> com.sun.xml.internal.ws.fault.ServerSOAPFaultException" when mapping
> key "null" at
> com.amazonaws.services.simpleworkflow.flow.JsonDataConverter.throwDataConverterException(JsonDataConverter.java:90)
> at
> com.amazonaws.services.simpleworkflow.flow.JsonDataConverter.toData(JsonDataConverter.java:78)
> at
> com.amazonaws.services.simpleworkflow.flow.pojo.POJOActivityImplementation.throwActivityFailureException(POJOActivityImplementation.java:102)
> at
> com.amazonaws.services.simpleworkflow.flow.pojo.POJOActivityImplementation.execute(POJOActivityImplementation.java:67)
> at
> com.amazonaws.services.simpleworkflow.flow.generic.ActivityImplementationBase.execute(ActivityImplementationBase.java:46)
> at
> com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller.execute(SynchronousActivityTaskPoller.java:196)
> at
> com.amazonaws.services.simpleworkflow.flow.worker.ActivityTaskPoller$2.run(ActivityTaskPoller.java:92)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:748) Caused by:
> com.fasterxml.jackson.databind.JsonMappingException: Type id handling
> not implemented for type org.w3c.dom.Node (by serializer of type
> com.fasterxml.jackson.databind.ext.DOMSerializer) (through reference
> chain:
> com.sun.xml.internal.ws.fault.ServerSOAPFaultException["fault"]) at
> com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1084)
> at
> com.fasterxml.jackson.databind.JsonSerializer.serializeWithType(JsonSerializer.java:159)
> at
> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:695)
> at
> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:675)
> at
> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeWithType(BeanSerializerBase.java:566)
> at
> com.fasterxml.jackson.databind.ser.impl.TypeWrappedSerializer.serialize(TypeWrappedSerializer.java:32)
> at
> com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:130)
> at
> com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3559)
> at
> com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2927)
> at
> com.amazonaws.services.simpleworkflow.flow.JsonDataConverter.toData(JsonDataConverter.java:72)
> ... 8 more
感谢任何建议