java JAX WS类转换错误
这是我们的服务请求。爪哇
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ServiceRequest",
namespace = "http://ejb.service.blue2.bcbsa.com",
propOrder = {"any"})
public class ServiceRequest implements Serializable {
@XmlAnyElement(lax = true)
protected Object any;
public Object getAny() {
return any;
}
public void setAny(Object value) {
this.any = value;
}
}
在我的实现文件中,我这样提到过
IBMSOAPElement requestElement = (IBMSOAPElement)serviceRequest.getAny();
在这一行中,它显示
java.lang.ClassCastException: org.apache.xerces.dom.ElementNSImpl incompatible with com.ibm.websphere.webservices.soap.IBMSOAPElement
# 1 楼答案
如果不看代码(依赖项)、WebSphere和您安装的功能包,就很难回答这个问题。我将查看您对JaxB(Jax-WS)的编译时依赖关系,并确保它们由您正在使用的WebSphere版本提供
# 2 楼答案
现在它的作品很好