简体   繁体   English

类型为ElementNSImpl的对象作为com.sun.org.apache.xerces.internal.dom.ElementNSImpl

[英]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.

相关问题 java.lang.ClassCastException: class com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class - java.lang.ClassCastException: class com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to class 使用Apache ODF Toolkit获取java.lang.NoClassDefFoundError:org / apache / xerces / dom / ElementNSImpl - Getting java.lang.NoClassDefFoundError: org/apache/xerces/dom/ElementNSImpl with Apache ODF Toolkit com.sun.org.apache.xerces.internal.dom.ElementImpl的替代方案 - Alternative to com.sun.org.apache.xerces.internal.dom.ElementImpl com.sun.org.apache.xerces.internal.dom.DocumentImpl无法转换为org.codehaus.plexus.util.xml.Xpp3Dom - com.sun.org.apache.xerces.internal.dom.DocumentImpl cannot be cast to org.codehaus.plexus.util.xml.Xpp3Dom 如何删除此警告:com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl是Sun专有API,可能会在将来的版本中删除 - how to remove this warning: com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl is Sun proprietary API and may be removed in a future release 如何获取com.sun.org.apache.xerces.internal.impl的来源 - How to get sources of com.sun.org.apache.xerces.internal.impl WildFly中的ClassNotFoundException / NoClassDefError com / sun / org / apache / xerces / internal / impl / dv / util / Base64 - ClassNotFoundException / NoClassDefError com/sun/org/apache/xerces/internal/impl/dv/util/Base64 in WildFly 无法访问 class com.sun.org.apache.xerces.internal.impl.dv.util.Z1ZEB445FA6BD5FA7778CAC - cannot access class com.sun.org.apache.xerces.internal.impl.dv.util.Base64 无法访问 class com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl - Cannot access class com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl 类Cast异常:com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl - Class Cast exception: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM