Announcement Announcement Module
No announcement yet.
Acegi Authentication under Weblogic 8.1 Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi Authentication under Weblogic 8.1

    I'm trying to use Acegi with Weblogic 8.1. In order to configure Spring's ApplicationContext, I have to use the ContextLoaderServlet servlet instead of ContextLoaderListener because unlike Tomcat, Weblogic 8.1 invokes the ServletContext startup listeners after “load-on-startup” servlets. (The initialization order was unclear in Servlet 2.3 and the Servlet 2.4 specification clarifies that startup listeners must be invoked before any other web components.).

    However when using the ContextLoaderServlet along with Acegi, I get the following exception.

    004-09-21 14:28:07 StandardContext[/myApp]: Exception starting filter Acegi Authentication Processing Filter
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
    at tionContextUtils.getRequiredWebApplicationContext(
    at net.sf.acegisecurity.util.FilterToBeanProxy.getCon text(
    at net.sf.acegisecurity.util.FilterToBeanProxy.init(F

    The same Acegi configuration works fine when I use ContextLoaderListener and run under Tomcat. We need to support running on Weblogic so switching to Tomcat is not an option. Is there a way to work around this issue?


  • #2
    If using ContextLoaderServlet, edit web.xml to ensure each Acegi Security filter has a filter initialization param of "init" with a value of "lazy". This will cause the filter to delay looking for the application context until the first request is received, by which time the application context should be available. See the FilterToBeanProxy JavaDocs for more details (this is a post 0.6 change, so you'll need to use CVS).


    • #3
      Thanks. Works great with 0.6.1