Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6F2BBE8D for ; Fri, 20 Jan 2012 11:55:23 +0000 (UTC) Received: (qmail 4106 invoked by uid 500); 20 Jan 2012 11:55:20 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 3929 invoked by uid 500); 20 Jan 2012 11:55:19 -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 3920 invoked by uid 99); 20 Jan 2012 11:55:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2012 11:55:19 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [207.5.74.28] (HELO exhub003-1.exch003intermedia.net) (207.5.74.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jan 2012 11:55:11 +0000 Received: from EXVMBX003-1.exch003intermedia.net ([207.5.74.41]) by exhub003-1.exch003intermedia.net ([207.5.74.28]) with mapi; Fri, 20 Jan 2012 03:54:51 -0800 From: Guillermo GARCIA OCHOA To: "users@tomcat.apache.org" Date: Fri, 20 Jan 2012 03:54:49 -0800 Subject: Tomcat 7 - java.lang.NoClassDefFoundError: Could not initialize class javax.servlet.http.Cookie Thread-Topic: Tomcat 7 - java.lang.NoClassDefFoundError: Could not initialize class javax.servlet.http.Cookie Thread-Index: AczXagVfG58CnJEbSJmP4WJEyaztFw== Message-ID: <21865753B0DD6341AAC5FBCBCF7EDD540180A8C3A18C@EXVMBX003-1.exch003intermedia.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_21865753B0DD6341AAC5FBCBCF7EDD540180A8C3A18CEXVMBX0031e_" MIME-Version: 1.0 --_000_21865753B0DD6341AAC5FBCBCF7EDD540180A8C3A18CEXVMBX0031e_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have an application that use j_security for a form-based authentication. = When the application is deployed for the first time (or the tomcat is resta= rted) user gets this exception when trying access a protected content direc= tly (without login). GRAVE: Servlet.service() for servlet [default] in context with path [/mycon= text] threw exception [Could not initialize class javax.servlet.http.Cooki= e] with root cause java.lang.NoClassDefFoundError: Could not initialize class javax.servle= t.http.Cookie at org.apache.catalina.core.ApplicationSessionCookieConfig.createSessio= nCookie(ApplicationSessionCookieConfig.java:127) at org.apache.catalina.connector.Request.doGetSession(Request.java:2875= ) at org.apache.catalina.connector.Request.getSession(Request.java:2307) at org.apache.catalina.connector.RequestFacade$GetSessionPrivilegedActi= on.run(RequestFacade.java:216) at org.apache.catalina.connector.RequestFacade$GetSessionPrivilegedActi= on.run(RequestFacade.java:205) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade= .java:894) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade= .java:909) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletR= equestWrapper.java:238) at com.mycompany.myfilter.SaasComponentImpl.getTenantId(SaasComponentIm= pl.java:284) The excepted behaviour is to redirect the user to the login form and when t= he user logs in redirect him to the requested protected resource. But the weird thing is this works correctly if the first request send to th= e rebooted server ask for the login form!!! It seems that after this tomcat= find and load correctly the cookie class and then all the request are hand= led as expected. Why tomcat cannot find the Cookie class that is for sure in the lib/servlet= -api.jar? IMHO, no mmetter when this class is asked to be load for the firs= t time ... it should be there for any valve, servlet, filter, etc ... I'm r= ight? PS: This was working fine before the app was migrated from tomcat 6. --_000_21865753B0DD6341AAC5FBCBCF7EDD540180A8C3A18CEXVMBX0031e_--