[英]Object of type ElementNSImpl coming as com.sun.org.apache.xerces.internal.dom.ElementNSImpl
So my WS-Trust server deployed on JDK1.8.0_161 environment is expecting a request which will contain xml nodes of type org.apache.xerces.dom.ElementNSImpl
, but when the request comes, the nodes are of type com.sun.org.apache.xerces.internal.dom.ElementNSImpl
, which is not making me not read the data from request. 因此,我在JDK1.8.0_161环境中部署的WS-Trust服务器期望的请求将包含
org.apache.xerces.dom.ElementNSImpl
类型的xml节点,但是当请求到达时,这些节点的类型为com.sun.org.apache.xerces.internal.dom.ElementNSImpl
,这不是让我不从请求读取数据。 I am using xerces:xercesImpl:2.11.0
library, but wondering if JDK is messing up with the request parsing on server end. 我正在使用
xerces:xercesImpl:2.11.0
库,但想知道JDK是否搞乱了服务器端的请求解析。 Currently I only see rt.jar
that contains com.sun.org.apache.xerces.internal.dom.ElementNSImpl
. 当前,我仅看到包含
com.sun.org.apache.xerces.internal.dom.ElementNSImpl
rt.jar
。 What am I missing? 我想念什么? Have anyone seen this error?
有没有人看到这个错误?
I solved this problem by using Element
as interface rather than using implementation ElementNSImpl
. 我通过使用
Element
作为接口而不是使用实现ElementNSImpl
解决了这个问题。 This will make the implementation environment independent. 这将使实现环境独立。
So the code looks like this 所以代码看起来像这样
if(object instanceof org.w3c.dom.Element)
instead of 代替
if(object instanceof ElementNSImpl)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.