java.lang.NoClassDefFoundError:javax / faces / model / SelectItem

时间:2012-05-21 17:50:36

标签: jetty opennms

当我运行部署到Jety Web服务器的Web应用程序时,我收到以下异常跟踪。看起来我错过了一些jar文件。谁能告诉我什么是错的?

HTTP ERROR 500

访问/PMCounters/default.jsp时出现问题。原因是:

javax/faces/model/SelectItem

引起:

java.lang.NoClassDefFoundError:javax / faces / model / SelectItem     在com.ericsson.dae.pm.dao.VirtualConfigTableDAO。(VirtualDaeConfigTableDAO.java:41)     在org.apache.jsp.default_jsp._jspService(org.apache.jsp.default_jsp:162)     在org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)     在javax.servlet.http.HttpServlet.service(HttpServlet.java:717)     在org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)     在org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)     在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)     在javax.servlet.http.HttpServlet.service(HttpServlet.java:717)     在org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)     在org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:481)     在org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)     在org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)     在org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)     在org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)     在org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)     在org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)     在org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)     在org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)     在org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)     在org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)     在org.eclipse.jetty.server.Server.handle(Server.java:349)     在org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)     at org.eclipse.jetty.server.HttpConnection $ RequestHandler.headerComplete(HttpConnection.java:904)     在org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)     在org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)     at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)     在org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)     在org.eclipse.jetty.io.nio.SelectChannelEndPoint $ 1.run(SelectChannelEndPoint.java:43)     在org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)     在org.eclipse.jetty.util.thread.QueuedThreadPool $ 3.run(QueuedThreadPool.java:533)     在java.lang.Thread.run(Thread.java:662)

这是我的WEB.XML:

   <?xml version="1.0" encoding="UTF-8"?>
   <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
      <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>


<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>default.jsp</welcome-file>
</welcome-file-list>

1 个答案:

答案 0 :(得分:1)

通常,该错误是指该类的多个版本可用时,请确保您的应用程序中没有该类的多个版本的jar,或者应用程序服务器没有为您提供一个版本和您的webapp正在打包另一个版本。