Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-677

CloseSessionFilter not always called for login.jsp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.1
    • 1.1
    • None
    • Resin 3.0.9 and 3.0.11 pro, but probably any Servlet API 2.4 container

    Description

      CloseSessionFilter apparently isn't getting called on FORWARDs for login.jsp.

      The following e-mail thread captures the symptom and diagnosis on Resin 3.0.9. The same is probably happening but going unnoticed on Tomcat 5+ (and any Servlet API 2.4 container).

      Following current policy, I propose to add commented dispatcher
      lines for CloseSessionFilter to the filter mappings used in the web.xml.

      --------------------------------

      ----- Original Message -----
      From: "Matthew P. Schmidt" <matt@javalobby.org>
      To: <roller-development@lists.sourceforge.net>
      Sent: Tuesday, February 22, 2005 7:24 PM
      Subject: Re: [Roller-development] Re: [Fwd: Re: Connection issue in Resin]

      > Ok guys, way to go! I was able to successfully login without any
      > exceptions being thrown. I'll keep an eye on this to make sure it stays
      > stable. Thanks for the help!
      >
      > Matthew P. Schmidt
      > Vice President of Technology
      > Javalobby.org
      > Email: matt@javalobby.org
      > Phone: 919.678.0300
      >
      >
      >
      > Matthew P. Schmidt wrote:
      >
      >> Doing so now. Here's hoping
      >>
      >> Matthew P. Schmidt
      >> Vice President of Technology
      >> Javalobby.org
      >> Email: matt@javalobby.org
      >> Phone: 919.678.0300
      >>
      >>
      >>
      >> Anil Gangolli wrote:
      >>
      >>>
      >>> This sounds like a winner, since the login request is typically via
      >>> FORWARD.
      >>> I believe Resin 3.0 uses Servlet API 2.4.
      >>>
      >>> We have to map loginFilter similarly for both REQUEST and FORWARD on
      >>> Servlet API 2.4 containers.
      >>> I think the same should be done for CloseSessionFilter.
      >>>
      >>> Can we try that?
      >>>
      >>> --a.
      >>>
      >>> ----- Original Message ----- From: "Matthew P. Schmidt"
      >>> <matt@javalobby.org>
      >>> To: "Dave Johnson" <dave.johnson@rollerweblogger.org>
      >>> Cc: "Lance Lavandowska" <lavandowska@gmail.com>;
      >>> <roller-development@lists.sourceforge.net>
      >>> Sent: Tuesday, February 22, 2005 5:17 PM
      >>> Subject: Re: [Roller-development] Re: [Fwd: Re: Connection issue in
      >>> Resin]
      >>>
      >>>
      >>>> Hmm, if its mapped to /* then it should get called on all requests,
      >>>> at least that's the way it works at JL. Maybe it needs to be mapped
      >>>> for REQUEST and FORWARD?
      >>>>
      >>>> -Matt
      >>>>
      >>>> Dave Johnson wrote:
      >>>>
      >>>>>
      >>>>> Perhaps Resin (and Tomcat for that matter) do not call filters
      >>>>> during the login process?
      >>>>>
      >>>>> - Dave
      >>>>>
      >>>>>
      >>>>> On Feb 22, 2005, at 6:11 PM, Lance Lavandowska wrote:
      >>>>>
      >>>>>> The key is at the bottom of the stacktrace:
      >>>>>> [13:14:42.810] at
      >>>>>> org.roller.presentation.LanguageUtil.getViewLocale(LanguageUtil.java:
      >>>>>> 130)
      >>>>>> [13:14:42.810] at jsp._loginjsp._jspService(_login_jsp.java:50)
      >>>>>>
      >>>>>> But I can't find where login.jsp (or its included files) call
      >>>>>> LanguageUtil. That call results in UserManager.getWebsite() which
      >>>>>> hits the database. But login.jsp should be in the CloseSessionFilter
      >>>>>> (mapped to /*) so that shouldn't be the problem.
      >>>>>>
      >>>>>> Lance
      >>>>>>
      >>>>>>
      >>>>>> On Tue, 22 Feb 2005 13:23:32 -0500, Matthew P. Schmidt
      >>>>>> <matt@javalobby.org> wrote:
      >>>>>>
      >>>>>>> Ok, so even with LoginFilter set with enable = false, the exceptions
      >>>>>>> still occur. In the current setup, enable = false, so we're just
      >>>>>>> passing right along to the next filter. All logging in is actually
      >>>>>>> handled by the LoginServlet. The line that appears to be the
      >>>>>>> cause of
      >>>>>>> all this is:
      >>>>>>>
      >>>>>>> // fmt:setLocale doesn't accept an expression, hence this hack^M
      >>>>>>> Config.set(pageContext, Config.FMT_LOCALE,
      >>>>>>> LanguageUtil.getViewLocale(request), pageContext.PAGE_SCOPE); ^M
      >>>>>>>
      >>>>>>> Anything funky going on there?
      >>>>>>>
      >>>>>>> -Matt
      >>>>>>>
      >>>>>>> [13:14:42.810] java.lang.IllegalStateException: unclosed connection:
      >>>>>>> UserPoolItem[jdbc/rollerdb,406] was allocated at
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.UserPoolItem.<init>(UserPoolItem.java:112)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.UserPoolItem.<init>(UserPoolItem.java:118)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.PoolItem.toActive(PoolItem.java:253)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.ConnectionPool.allocateIdle(ConnectionPool.java:735)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.ConnectionPool.allocatePool(ConnectionPool.java:654)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.ConnectionPool.allocate(ConnectionPool.java:619)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.jca.ConnectionPool.allocateConnection(ConnectionPool.java:
      >>>>>>> 516)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.sql.DataSourceImpl.getConnection(DataSourceImpl.java:69)
      >>>>>>> [13:14:42.810] at
      >>>>>>> com.caucho.sql.DBPool.getConnection(DBPool.java:582)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection
      >>>>>>> (DatasourceConnectionProvider.java:59)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:292)
      >>>>>>>
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3373)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3333)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.ja
      >>>>>>> va:67)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:784)
      >>>>>>>
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(
      >>>>>>> Loader.java:138)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.loader.Loader.list(Loader.java:1054)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.loader.CriteriaLoader.list(CriteriaLoader.java:118)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3660)
      >>>>>>> [13:14:42.810] at
      >>>>>>> net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.business.hibernate.HibernateUserManagerImpl.getWebsite(Hibe
      >>>>>>> rnateUserManagerImpl.java:116)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.business.UserManagerImpl.getWebsite(UserManagerImpl.java:
      >>>>>>> 79)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.RollerRequest.parseRequestParams(RollerRequest
      >>>>>>> .java:280)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.RollerRequest.init(RollerRequest.java:153)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.RollerRequest.<init>(RollerRequest.java:110)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.RollerRequest.getRollerRequest(RollerRequest.j
      >>>>>>> ava:349)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.RollerRequest.getRollerRequest(RollerRequest.j
      >>>>>>> ava:364)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.LanguageUtil.isWebsiteOfPrincipal(LanguageUtil
      >>>>>>> .java:211)
      >>>>>>> [13:14:42.810] at
      >>>>>>> org.roller.presentation.LanguageUtil.getViewLocale(LanguageUtil.java:
      >>>>>>> 130)
      >>>>>>> [13:14:42.810] at jsp._loginjsp._jspService(_login_jsp.java:50)
      >>>>>>

      Attachments

        Activity

          People

            agangolli Anil Gangolli
            agangolli Anil Gangolli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: