You need to put all the shiro beans into the application context, not web context.
*read*: http://shiro.apache.org/spring.html *specifically*: In your *applicationContext.xml *file, define the web-enabled SecurityManager and the 'shiroFilter' bean that will be referenced from web.xml. On 3 December 2013 18:16, stenrap <[email protected]> wrote: > I'm attempting to integrate Shiro into an existing Spring web application > that uses DispatcherServlet instead of ContextLoaderListener. I've followed > the instructions here <http://shiro.apache.org/spring.html> , but I'm > getting this error when I try to run/debug my application: > > <pre>java.lang.IllegalStateException: No WebApplicationContext found: no > ContextLoaderListener registered?</pre> > > Here's my DispatcherServlet servlet XML... > > <pre> <servlet> > <servlet-name>dispatcher</servlet-name> > > > <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> > <init-param> > <param-name>contextConfigLocation</param-name> > <param-value>/WEB-INF/dispatcher-config.xml > /META-INF/spring/web-applicationContext.xml > classpath:META-INF/spring/core-applicationContext.xml > classpath:META-INF/spring/ext-applicationContext.xml > classpath:META-INF/spring/performance-applicationContext.xml</param-value> > </init-param> > <load-on-startup>0</load-on-startup> > </servlet></pre> > > ...and I put the 'shiroFilter' bean into my web-applicationContext.xml > file. > > Is it possible to get Shiro working in my environment, or is it necessary > to > use ContextLoaderListener and create an applicationContext.xml file in > WEB-INF? > > > > -- > View this message in context: > http://shiro-user.582556.n2.nabble.com/No-WebApplicationContext-found-tp7579433.html > Sent from the Shiro User mailing list archive at Nabble.com. > -- ---------------------------------------------------------------------------------- The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Policy Expert is a trading name of QMetric Group Limited who is authorised and regulated by the Financial Conduct Authority. The registered company address of QMetric Group Limited is: 32-38 Dukes Place, London, EC3A 7LP and its company registration number is 07151701.
