Results 1 to 3 of 3

Thread: Acegi Authentication under Weblogic 8.1

  1. #1
    Join Date
    Sep 2004
    Location
    Boston, US
    Posts
    130

    Default 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 org.springframework.web.context.support.WebApplica tionContextUtils.getRequiredWebApplicationContext( WebApplicationContextUtils.java:69)
    at net.sf.acegisecurity.util.FilterToBeanProxy.getCon text(FilterToBeanProxy.java:158)
    at net.sf.acegisecurity.util.FilterToBeanProxy.init(F ilterToBeanProxy.java:98)


    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?

    Thanks,
    Sanjiv

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    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. #3
    Join Date
    Sep 2004
    Location
    Boston, US
    Posts
    130

    Default

    Thanks. Works great with 0.6.1

Similar Threads

  1. Replies: 8
    Last Post: Mar 19th, 2008, 11:13 AM
  2. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  3. Replies: 3
    Last Post: Jul 29th, 2005, 03:06 PM
  4. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  5. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •