首页 > 解决方案 > 将 org.apache.cxf 从 3.0.7 更新到 3.3.10 后自定义异常返回 MashallingError

问题描述

映射的异常

@WebFault(name = "InvalidInputException", faultBean = "InvalidInputException")
public class InvalidInputException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    public InvalidInputException(String msg) {
        super(msg);
    }

}

正在返回 Marshall 错误。

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>Marshalling Error: class app.exception.InvalidInputException nor any of its super class is known to this context.</faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

InvalidInputException 类中是否需要进行任何更改?

标签: cxfjax-ws

解决方案


推荐阅读