解决java.lang.NoClassDefFoundError错误的方法

 
  
好端端辛苦做的项目  突然jsp页面打不开。报错如下
 
  

 
  

Apache Tomcat/8.0.29 - Error report 

HTTP Status 500 - javax.servlet.ServletException: java.lang.NoClassDefFoundError: performance/WMac

type Exception report

message javax.servlet.ServletException: java.lang.NoClassDefFoundError: performance/WMac

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: performance/WMac
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:555)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:461)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: performance/WMac
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:909)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:838)
	org.apache.jsp.net_005finfo_jsp._jspService(net_005finfo_jsp.java:486)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.NoClassDefFoundError: performance/WMac
	org.apache.jsp.net_005finfo_jsp._jspService(net_005finfo_jsp.java:365)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

root cause

java.lang.ClassNotFoundException: performance.WMac
	org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
	org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:125)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:62)
	org.apache.jsp.net_005finfo_jsp._jspService(net_005finfo_jsp.java:365)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.29 logs.


Apache Tomcat/8.0.29



报错信息是java.lang.NoClassDefFoundError这是因为“引用自定义标签库出现异常”,根治此疑难杂症的方法

1、解决java.lang.NoClassDefFoundError错误的方法_第1张图片在lib目录下导入servlet-api.jar和jsp-api.jar这两个包,基本药到病除。这两个包在tomcat的lib目录下找到

2·、

        (1)项目根目录下新建一个libs文件夹

         (2)把要加的包放到这个目录下

         (3)右键 Build Path-> Use as source folder

         (4)在jar包上右键->add to build path

         (注意,上面的是libs,不是lib

3.

你可能感兴趣的:(Java,EE)