Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 419 invoked from network); 6 Dec 2005 15:41:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Dec 2005 15:41:39 -0000 Received: (qmail 65747 invoked by uid 500); 6 Dec 2005 15:41:22 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 65733 invoked by uid 500); 6 Dec 2005 15:41:21 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 65722 invoked by uid 99); 6 Dec 2005 15:41:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2005 07:41:21 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [207.236.215.150] (HELO mail.doculink.com) (207.236.215.150) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2005 07:41:20 -0800 Received: from rocka5486 (rocka-5486.regilmore.com [172.16.18.86]) by mail.doculink.com (8.11.6/8.9.2) with SMTP id jB6FetL10726 for ; Tue, 6 Dec 2005 10:40:55 -0500 Posted-Date: Tue, 6 Dec 2005 10:40:55 -0500 From: "Armand Rock" To: "Tomcat Users List" Subject: RE: Question concerning java.lang.NoClassDefFoundError: javax/servlet/ServletContext Date: Tue, 6 Dec 2005 10:40:56 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: <43957647.60704@joedog.org> Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I'm getting the same error. I searched my entire computer for any jar/zip files containing javax.servlet.ServletContext and renamed all of them to ".original" so that they wouldn't be read by the JVM. I did this to all the files except for the file common/lib/servlet-api.jar I'm still getting the problem. I'm using java version 1.4.2_10 The code i'm using used to work under Orion version 1.4.5 (I'm now using Tomcat 5.5) The code that eventually throws the exception is basically: ClassFinder classFinder = new ClassFinder(); classFinder.addFile("/opt/classes/com/canlink/commands/"); Class usrClass = classFinder.findClass("com.canlink.commands.TestClass"); This line is what throws the exception: Method setCmdLog = usrClass.getMethod("setCmdLog", new Class[] {Boolean.class}); The stack trace is: SEVERE: Servlet.service() for servlet RunCmd threw exception java.lang.NoClassDefFoundError: javax/servlet/ServletContext at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at com.canlink.commands.RunCmd.service(RunCmd.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis patcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch er.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:301) at org.apache.jsp.web.Login_jsp._jspService(Login_jsp.java:67) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 22) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Unknown Source) -----Original Message----- From: Tim Funk [mailto:funkman@joedog.org] Sent: December 6, 2005 6:30 AM To: Tomcat Users List Subject: Re: Question concerning java.lang.NoClassDefFoundError: javax/servlet/ServletContext See - http://tomcat.apache.org/faq/classnotfound.html Odds are you have your own servlet-api.jar somewhere in the webapp or system classpath and that is conflicting with the one in common/lib (installed by tomcat) -Tim John Poley wrote: > Please forgive my intrusion if this is not the proper place to post a questoon of this sort. I am new to servlets, and am working on my first deployment- but I am running in to a problem that I can't find a solution to. I have installed Tomcat 5.5 and am using Eclipse (as well as a tomcat plugin) to manage my project. A colleague of mine sent me a war file of out working projected, which I imported to my IDE. I start tomcat, which seems to load properly, and attempt to run the project on the server- where I am faced with the following: > > > javax.servlet.ServletException: Servlet.init() for servlet RequestTranslator threw exception > > root cause > > java.lang.NoClassDefFoundError: javax/servlet/ServletContext > java.lang.Class.getDeclaredConstructors0(Native Method) > java.lang.Class.privateGetDeclaredConstructors(Unknown Source) > java.lang.Class.getConstructor0(Unknown Source) > java.lang.Class.getConstructor(Unknown Source) > freemarker.template.Configuration.setServletContextForTemplateLoading(Config uration.java:331) > verkoopen.boundary.UserInterfaceOutput.(UserInterfaceOutput.java:31) > verkoopen.boundary.RequestTranslator.init(RequestTranslator.java:25) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:663) > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) > java.lang.Thread.run(Unknown Source) > I am using the most recent J2RE 5 and I am certain that Tomcat's servlet-api.jar is within my application's class path. I am not sure why the source cannot be found. Any helpin locating my problem would be greatly appreciated, and I would be happy to prove more information if needed (I'm not entirely sure what would be helpful). And again, I am sorry if this is not the place for this kind of question!Happy coding!John > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org