RE: Class Not Found on Occasion but Class Exists and is Usually Found
Hi, Does your CNFE (by the way, is it actually a CNFE or a NoClassDefFoundError -- I think it's the latter, looking at the stack trace, and the distinction is significant) occur when you've reloaded your app? In other words, if instead of reloading you restart Tomcat each time to deploy a new version of your app, does this error go away? I'm asking the above because it might be related to http://issues.apache.org/bugzilla/show_bug.cgi?id=28949, which has been elusive. What Tomcat version are you using? Yoav Shapira Millennium Research Informatics -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 3:51 PM To: Tomcat Users List Subject: Class Not Found on Occasion but Class Exists and is Usually Found I have a taglib and the resultant relevant code in _blah_blah_jsp.java is given below. For some reason I frequently get an ClassNotFoundException on com.crackwillow.tag.ImgTag from this code. After the code, I give the error message. Any idea why this is happening? private boolean _jspx_meth_crackwillow_img_0(javax.servlet.jsp.PageContext pageContext) throws Throwable { JspWriter out = pageContext.getOut(); /* crackwillow:img */ com.crackwillow.tag.ImgTag _jspx_th_crackwillow_img_0 = (com.crackwillow.tag.ImgTag) _jspx_tagPool_crackwillow_img_txtClrCode_size_mapBean_italic_font_butto n_bo ld_bgClrCode.get(com.crackwillow.tag.ImgTag.class); _jspx_th_crackwillow_img_0.setPageContext(pageContext); _jspx_th_crackwillow_img_0.setParent(null); _jspx_th_crackwillow_img_0.setButton(browse.gif); _jspx_th_crackwillow_img_0.setMapBean(hkc); _jspx_th_crackwillow_img_0.setBgClrCode(banRtBgClr); _jspx_th_crackwillow_img_0.setTxtClrCode(banRtTxtClr); _jspx_th_crackwillow_img_0.setFont(Bookman Old Style); _jspx_th_crackwillow_img_0.setItalic(false); _jspx_th_crackwillow_img_0.setBold(true); _jspx_th_crackwillow_img_0.setSize(15); int _jspx_eval_crackwillow_img_0 = _jspx_th_crackwillow_img_0.doStartTag(); if (_jspx_th_crackwillow_img_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_crackwillow_img_txtClrCode_size_mapBean_italic_font_butto n_bo ld_bgClrCode.reuse(_jspx_th_crackwillow_img_0); return false; } ApplicationDispatcher[] Servlet.service() for servlet jsp threw exception java.lang.NoClassDefFoundError: com.crackwillow.tag.ImgTag at org.apache.jsp.eclipse_uploader_content_jsp.class$(eclipse_uploader_con tent _jsp.java:194) at org.apache.jsp.eclipse_uploader_content_jsp._jspx_meth_crackwillow_img_ 0(ec lipse_uploader_content_jsp.java:313) at org.apache.jsp.eclipse_uploader_content_jsp._jspService(eclipse_uploade r_co ntent_jsp.java:127) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j ava: 204) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295 ) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic atio nFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil terC hain.java:204) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat cher .java:750) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicati onDi spatcher.java:510) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis patc her.java:445) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa tche r.java:359) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.ja va:1 056) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestPro cess or.java:261) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Ti lesR equestProcessor.java:237) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tile sReq uestProcessor.java:300) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java :231 ) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic atio nFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil terC hain.java:204) at com.crackwillow.filter.GZIPFilter.doFilter(GZIPFilter.java:19) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic atio nFilterChain.java:233)
Re: Class Not Found on Occasion but Class Exists and is Usually Found
Sorry, you are right. NCDFE rather than CNFE. I should be more careful. Usually I am. If I refresh the page, the class is found. I am going to try the reloading. I restarted Tomcat and got the same error. I am using a frameset, by the way. Sometimes one frame of the frameset fails due to this and sometimes the other does. Rarely, never I think, do both fail. I am using Tomcat 5.0. Apache Tomcat Version @VERSION@ Release Notes $Id: RELEASE-NOTES,v 1.12 2004/01/14 13:30:02 remm Exp $ KNOWN ISSUES IN THIS RELEASE: * Tomcat 5.0 and JNI Based Applications * Tomcat 5.0 Standard APIs Available * Tomcat 5.0 and XML Parsers * Web application reloading and static fields in shared libraries * JAVAC leaking memory * Tomcat on Linux * Enabling SSI and CGI Support * Security manager URLs * Symlinking static resources * Enabling invoker servlet * When all else fails - Tomcat 5.0 and JNI Based Applications: - What do you think? Michael McGrady Shapira, Yoav wrote: Hi, Does your CNFE (by the way, is it actually a CNFE or a NoClassDefFoundError -- I think it's the latter, looking at the stack trace, and the distinction is significant) occur when you've reloaded your app? In other words, if instead of reloading you restart Tomcat each time to deploy a new version of your app, does this error go away? I'm asking the above because it might be related to http://issues.apache.org/bugzilla/show_bug.cgi?id=28949, which has been elusive. What Tomcat version are you using? Yoav Shapira Millennium Research Informatics -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 3:51 PM To: Tomcat Users List Subject: Class Not Found on Occasion but Class Exists and is Usually Found I have a taglib and the resultant relevant code in _blah_blah_jsp.java is given below. For some reason I frequently get an ClassNotFoundException on com.crackwillow.tag.ImgTag from this code. After the code, I give the error message. Any idea why this is happening? private boolean _jspx_meth_crackwillow_img_0(javax.servlet.jsp.PageContext pageContext) throws Throwable { JspWriter out = pageContext.getOut(); /* crackwillow:img */ com.crackwillow.tag.ImgTag _jspx_th_crackwillow_img_0 = (com.crackwillow.tag.ImgTag) _jspx_tagPool_crackwillow_img_txtClrCode_size_mapBean_italic_font_butto n_bo ld_bgClrCode.get(com.crackwillow.tag.ImgTag.class); _jspx_th_crackwillow_img_0.setPageContext(pageContext); _jspx_th_crackwillow_img_0.setParent(null); _jspx_th_crackwillow_img_0.setButton(browse.gif); _jspx_th_crackwillow_img_0.setMapBean(hkc); _jspx_th_crackwillow_img_0.setBgClrCode(banRtBgClr); _jspx_th_crackwillow_img_0.setTxtClrCode(banRtTxtClr); _jspx_th_crackwillow_img_0.setFont(Bookman Old Style); _jspx_th_crackwillow_img_0.setItalic(false); _jspx_th_crackwillow_img_0.setBold(true); _jspx_th_crackwillow_img_0.setSize(15); int _jspx_eval_crackwillow_img_0 = _jspx_th_crackwillow_img_0.doStartTag(); if (_jspx_th_crackwillow_img_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_crackwillow_img_txtClrCode_size_mapBean_italic_font_butto n_bo ld_bgClrCode.reuse(_jspx_th_crackwillow_img_0); return false; } ApplicationDispatcher[] Servlet.service() for servlet jsp threw exception java.lang.NoClassDefFoundError: com.crackwillow.tag.ImgTag at org.apache.jsp.eclipse_uploader_content_jsp.class$(eclipse_uploader_con tent _jsp.java:194) at org.apache.jsp.eclipse_uploader_content_jsp._jspx_meth_crackwillow_img_ 0(ec lipse_uploader_content_jsp.java:313) at org.apache.jsp.eclipse_uploader_content_jsp._jspService(eclipse_uploade r_co ntent_jsp.java:127) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j ava: 204) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295 ) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic atio nFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil terC hain.java:204) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat cher .java:750) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicati onDi spatcher.java:510) at
Re: Class Not Found on Occasion but Class Exists and is Usually Found
Shapira, Yoav wrote: Hi, Does your CNFE (by the way, is it actually a CNFE or a NoClassDefFoundError -- I think it's the latter, looking at the stack trace, and the distinction is significant) occur when you've reloaded your app? In other words, if instead of reloading you restart Tomcat each time to deploy a new version of your app, does this error go away? I'm asking the above because it might be related to http://issues.apache.org/bugzilla/show_bug.cgi?id=28949, which has been elusive. What Tomcat version are you using? Yoav Shapira Millennium Research Informatics This is very interesting. My experience is almost the same as the bug. I also use frames. It is NOT always the same frame with me. And, I do not use the ImgTag from Struts but have rolled my own. I think that this is very interesting. Something in ImgTag and frames is the problem, apparently. Michael McGrady - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Class Not Found on Occasion but Class Exists and is Usually Found
On Tue, 05 Oct 2004 13:10:59 -0700, Michael McGrady [EMAIL PROTECTED] wrote: This is very interesting. My experience is almost the same as the bug. I also use frames. It is NOT always the same frame with me. And, I do not use the ImgTag from Struts but have rolled my own. I think that this is very interesting. Something in ImgTag and frames is the problem, apparently. I did hear about similar reports, maybe two or three times, but: - always with a tag; never ever with a utility class or anything else - the admin webapp uses tons of tags, with frames, and I never got the issue (I don't really use it, but I browse it quite often for testing purposes); I think this ought to be a good enough test case So this is extremely odd. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Class Not Found on Occasion but Class Exists and is Usually Found
Remy Maucherat wrote: On Tue, 05 Oct 2004 13:10:59 -0700, Michael McGrady [EMAIL PROTECTED] wrote: This is very interesting. My experience is almost the same as the bug. I also use frames. It is NOT always the same frame with me. And, I do not use the ImgTag from Struts but have rolled my own. I think that this is very interesting. Something in ImgTag and frames is the problem, apparently. I did hear about similar reports, maybe two or three times, but: - always with a tag; never ever with a utility class or anything else - the admin webapp uses tons of tags, with frames, and I never got the issue (I don't really use it, but I browse it quite often for testing purposes); I think this ought to be a good enough test case So this is extremely odd. Yes. I agree. There is no question it can be replicated. It is damnedishly replicable. LOL Were you implying you would like the code as a test case? Has anyone checked to see if the people reporting the problem were all using tags and maybe all using ImgTag or a variant on ImgTag? Michael McGrady
Re: Class Not Found on Occasion but Class Exists and is Usually Found
I also have, by the way, another page which uses the same taglib in a frameset and never has this problem. I really have no idea why this would be. The pages are very, very similar. One always has a problem. The other never does. Michael Michael McGrady wrote: Remy Maucherat wrote: On Tue, 05 Oct 2004 13:10:59 -0700, Michael McGrady [EMAIL PROTECTED] wrote: This is very interesting. My experience is almost the same as the bug. I also use frames. It is NOT always the same frame with me. And, I do not use the ImgTag from Struts but have rolled my own. I think that this is very interesting. Something in ImgTag and frames is the problem, apparently. I did hear about similar reports, maybe two or three times, but: - always with a tag; never ever with a utility class or anything else - the admin webapp uses tons of tags, with frames, and I never got the issue (I don't really use it, but I browse it quite often for testing purposes); I think this ought to be a good enough test case So this is extremely odd. Yes. I agree. There is no question it can be replicated. It is damnedishly replicable. LOL Were you implying you would like the code as a test case? Has anyone checked to see if the people reporting the problem were all using tags and maybe all using ImgTag or a variant on ImgTag? Michael McGrady - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]