Results 1 to 3 of 3

Thread: No WebApplicationContext found using Acegi with HttpInvoker

  1. #1
    Join Date
    Feb 2006
    Posts
    115

    Default No WebApplicationContext found using Acegi with HttpInvoker

    I am trying to use Acegi with the Spring HttpInvoker deployed to JBoss as a WAR. But, when its deployed with Acegi filters added to the web.xml I get:
    09:46:25,641 ERROR [Engine] StandardContext[/-bpass]Exception starting filter Acegi HTTP Session Integration
    java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
    In my web.xml I have:
    Code:
    <?xml version="1.0"?>
    
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_4.dtd">
    
    <web-app>
    
    	<display-name>BPASS Controller</display-name>
    	<context-param>
    		<param-name>contextConfiguration</param-name>
    		<param-value>WEB-INF/applicationContext.xml</param-value>
    	</context-param>
    	
    	<servlet>
    		<servlet-name>context</servlet-name>
    		<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	
    	<servlet>
    		<servlet-name>bpass</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<load-on-startup>2</load-on-startup>
    	</servlet>
    	
    	<servlet-mapping>
    		<servlet-name>bpass</servlet-name>
    		<url-pattern>/bpass/*</url-pattern>
    	</servlet-mapping>
    	
    	<servlet-mapping>
    		<servlet-name>context</servlet-name>
    		<url-pattern>/context/*</url-pattern>
    	</servlet-mapping>
    	
    	<!-- Security configuration -->
    	<filter>
    		<filter-name>Acegi HTTP Session Integration</filter-name>
    		<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
    		<init-param>
    			<param-name>targetClass</param-name>
    			<param-name>org.acegisecurity.context.HttpSessionContextIntegrationFilter</param-name>
    		</init-param>
    	</filter>
    	
    	<filter-mapping>
    		<filter-name>Acegi HTTP Session Integration</filter-name>
    		<url-pattern>/bpass/*</url-pattern>
    	</filter-mapping>
    	
    	<filter>
    		<filter-name>Acegi HTTP BASIC Authorization Filter</filter-name>
    		<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
    		<init-param>
    			<param-name>targetClass</param-name>
    			<param-name>org.acegisecurity.ui.basicauth.BasicProcessingFilter</param-name>
    		</init-param>
    	</filter>
    	
    	<filter-mapping>
    		<filter-name>Acegi HTTP BASIC Authorization Filter</filter-name>
    		<url-pattern>/bpass/*</url-pattern>
    	</filter-mapping>
    </web-app>
    I have tried several variations on the url-pattern, include the full path to the Dispatch servlet (/-bpass/bpass/bpass_controller), /context/*, /-bpass/context/*, and anything else I could mustar up.

    Does anyone have a clue as to what I am doing wrong?

  2. #2

    Default

    Maybe the solution is similar to the one here?

    http://forum.springframework.org/showthread.php?t=10790

  3. #3
    Join Date
    Feb 2006
    Posts
    115

    Default Thanks, on to the next error...

    Thanks, you put me on the right path. The problem was, for some reason, the ContextLoaderServlet was not starting the Spring contexts early enough. I swapped it out for a ContextLoaderListener instead, and whalla! It works.

    I now get the HttpSessionInvokerFilter stuff scroll by on a request, but it doesn't seem to run my custom UserDetailsService. This in a different problem, however, destined for a separate thread...

Posting Permissions

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