在我的 Java 动态 Web 项目中,我正在使用构建路径导入另一个 Java 项目,这样我就可以查询类并使用 Java 反射。在编写我的课程时,我最初通过将其作为 Java 应用程序运行来对其进行测试,并且它可以工作。但是,我现在使用同一个类作为动态 Web 项目的一部分,它似乎无法访问导入的 Java 项目。我尝试将它导入到我在 Eclipse 中的项目引用中,但它仍然无法正常工作并输出以下错误:
HTTP Status 500 - javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/q1labs/qa/selenium/widgets/WidgetHandler
--------------------------------------------------------------------------------
type Exception report
message javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/q1labs/qa/selenium/widgets/WidgetHandler
description The server encountered an internal error (javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/q1labs/qa/selenium/widgets/WidgetHandler) that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/q1labs/qa/selenium/widgets/WidgetHandler
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/q1labs/qa/selenium/widgets/WidgetHandler
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840)
org.apache.jsp.UpdatingDb_jsp._jspService(UpdatingDb_jsp.java:98)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NoClassDefFoundError: com/q1labs/qa/selenium/widgets/WidgetHandler
com.q1labs.qa.xmlgenerator.controller.updatedb.DbUpdateScript.updateObjectTypes(DbUpdateScript.java:40)
com.q1labs.qa.xmlgenerator.controller.updatedb.DbUpdateScript.updateDb(DbUpdateScript.java:31)
org.apache.jsp.UpdatingDb_jsp._jspService(UpdatingDb_jsp.java:88)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)