- This topic has 3 replies, 2 voices, and was last updated 18 years, 7 months ago by Riyad Kalla.
-
AuthorPosts
-
DarthLuchMemberHello,
I’m trying to learn web dev with myeclipse. I’m using the JSFLoginDemo sample. OUt of the box the sample runs fine. What I wanted to do was add to the UserBean and try to use my own classes.I added a jar file to the build path of the project. I then add a field from that jar right next to the userName and password fields already in UserBean.java. Without doing anything else, I deploy the project. It “crashes” saying it couldn’t find the classes I put into the UserBean.java. I look at the \webapps\JSFLoginDemo\WEB-INF\lib and I can see the jar file I added did get deployed there. What is wrong?
Riyad KallaMemberStrange, sounds like things are getting deployed alright. When you added the JAR did you put it in WEB-INF/lib dir in your project? Also, what is the exactly exception?
DarthLuchMemberYes, I tried placing it directly in the project’s web-inf/lib folder as well. It gets deployed fine. The exception message is pasted below. Is there any other procedure one must do in order to use a class as a field if the class is contained within a jar file?
HTTP Status 500 –
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.jsp.JspException: java.lang.NoClassDefFoundError: aero/trax/castor/main/trax_discrep/Trax_Log_Incoming_Element
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.NoClassDefFoundError: aero/trax/castor/main/trax_discrep/Trax_Log_Incoming_Element
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.userLogin_jsp._jspService(org.apache.jsp.userLogin_jsp:97)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)root cause
javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: aero/trax/castor/main/trax_discrep/Trax_Log_Incoming_Element
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
javax.faces.component.UIOutput.getValue(UIOutput.java:147)
com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:82)
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:191)
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:169)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:712)
javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:616)
javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:539)
com.sun.faces.taglib.html_basic.InputTextTag.doEndTag(InputTextTag.java:524)
org.apache.jsp.userLogin_jsp._jspx_meth_h_inputText_0(org.apache.jsp.userLogin_jsp:270)
org.apache.jsp.userLogin_jsp._jspx_meth_h_form_0(org.apache.jsp.userLogin_jsp:187)
org.apache.jsp.userLogin_jsp._jspx_meth_f_view_0(org.apache.jsp.userLogin_jsp:127)
org.apache.jsp.userLogin_jsp._jspService(org.apache.jsp.userLogin_jsp:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)note The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.
Apache Tomcat/5.5.15
Riyad KallaMemberjavax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: aero/trax/castor/main/trax_discrep/Trax_Log_Incoming_Element
Are the class and package *really* names like that, with underscores or did you accidentally type those? Dropping the JAR into the /lib folder and making sure it’s deployed is really the only thing you should do. Try restarting the app server, maybe the classloader didn’t pick up the new JAR.
-
AuthorPosts