【发布时间】:2017-03-29 03:24:29
【问题描述】:
import javax.xml.namespace.NamespaceContext;
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.setNamespaceContext(some code goes here)
我在我的网络应用程序中使用javax.xml.namespace.NamespaceContext,当部署在 jboss 服务器上时,它给出了以下错误:
javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.xml.xpath.XPath.setNamespaceContext(Ljavax/xml/namespace/NamespaceContext;)V" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, com/accenture/mdh/sso/util/Util, and the class loader (instance of <bootloader>) for resolved class, javax/xml/xpath/XPath, have different Class objects for the type )V used in the signature
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.jsp.LoginConsumer_jsp._jspService(LoginConsumer_jsp.java:187)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
我通过互联网搜索,似乎在 WEB-INF/lib 中存在与 javax.xml.namespace.NamespaceContext 冲突的 jar。但是,我仍然无法找到原因。非常感谢您的想法。
【问题讨论】:
-
你有这些罐子里的一两个吗?
-
有一个未使用的 jar “javax.xml.stream_1.0.1.v201004272200.jar”,它具有相同的命名空间。即使删除它,我仍然得到同样的错误