部署时org.apache.taglibs.standard.util.XmlUtil的NoClassDefFoundError

问题描述

我创建了一个包含jsp的动态Web项目。我想在其中使用jstl。因此,我将standard.jar和jstl.jar复制到WEB-INF / lib。然后将以下代码添加到jsp中。

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

我没有将这两个jar添加到Java Build Path中,也没有将它们包含在部署程序集中,但是当我在Eclipse中运行它时,它可以正常工作。然后,将其导出为war并部署到我的wildfly 11服务器之后。出现以下错误

Exception handling request to /SAP_SD_QUERY/: javax.servlet.servletexception: 
java.lang.NoClassDefFoundError: Could not initialize class org.apache.taglibs.standard.util.XmlUtil
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:356)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
    at ... 
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.taglibs.standard.util.XmlUtil
    at org.apache.taglibs.standard.tlv.JstlBaseTLV.validate(JstlBaseTLV.java:154)
    at org.apache.taglibs.standard.tlv.JstlCoreTLV.validate(JstlCoreTLV.java:97)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.validate(TagLibraryInfoImpl.java:565)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    ... 40 more 

我还尝试将jars包含在部署程序集中,并使用以下内容修改web.xml

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

它有错误

ERROR [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0074: 
Could not find TLD 
 /WEB-INF/c.tld

如何解决?有人帮忙吗?谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)