org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

Erik Pragt-3
Hi all,

We're trying to deploy a Grails application (1.3.2) with Spring Security (1.2.7.1) to Tomcat (6.0.35). When doing a grails run-app, the application works fine, but when creating a war (grails war), and deploying the application to Tomcat, the application fails to startup with the following stacktrace:

[2012-05-21 17:20:23,045] [] INFO  core.SchedulerSignalerImpl  - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
[2012-05-21 17:20:23,045] [] INFO  core.QuartzScheduler  - Quartz Scheduler v.UNKNOWN.UNKNOWN.UNKNOWN created.
[2012-05-21 17:20:23,045] [] INFO  simpl.RAMJobStore  - RAMJobStore initialized.
[2012-05-21 17:20:23,045] [] INFO  impl.StdSchedulerFactory  - Quartz scheduler 'QuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
[2012-05-21 17:20:23,045] [] INFO  impl.StdSchedulerFactory  - Quartz scheduler version: UNKNOWN.UNKNOWN.UNKNOWN
[2012-05-21 17:20:23,497] [] WARN  base.Config  - OSCache: No properties file found in the classpath by filename /oscache.properties
[2012-05-21 17:20:23,497] [] INFO  web.ServletCacheAdministrator  - Created new instance of ServletCacheAdministrator with key __oscache_cache_admin
[2012-05-21 17:20:23,497] [] INFO  web.ServletCacheAdministrator  - Created new application-scoped cache at key: __oscache_cache
[2012-05-21 17:20:23,512] [] ERROR [/ccgui-2.3-17430]  - Exception starting filter springSecurityFilterChain
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:521)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1068)
       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:266)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
       at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1079)
       at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:217)
       at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:145)
       at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:179)
       at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
       at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
       at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
       at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
       at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
       at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
       at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
       at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
       at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
       at org.apache.catalina.core.StandardService.start(StandardService.java:525)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
May 21, 2012 5:20:23 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
May 21, 2012 5:20:23 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/ccgui-2.3-17430] startup failed due to previous errors
[2012-05-21 17:20:23,707] [] INFO  [/ccgui-2.3-17430]  - Closing Spring root WebApplicationContext
[2012-05-21 17:20:23,718] [] INFO  core.QuartzScheduler  - Scheduler quartzScheduler_$_NON_CLUSTERED paused.
[2012-05-21 17:20:23,762] [] INFO  core.QuartzScheduler  - Scheduler quartzScheduler_$_NON_CLUSTERED shutting down.

Can anyone point me in a direction to solve this issue? I'm currently a bit out of ideas how to fix this...

Thanks,

Erik

I've also attached the (generated) web.xml and applicationContext, in case it might help.

web.xml
<display-name>/ccgui-development-2.3</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>ccgui-development-2.3</param-value>
</context-param>
<filter>
<filter-name>staticFilter</filter-name>
<filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
<init-param>
<param-name>scope</param-name>
<param-value>application</param-value>
</init-param>
<init-param>
<param-name>time</param-name>
<param-value>86400</param-value>
</init-param>
<init-param>
<param-name>max-age</param-name>
<param-value>86400</param-value>
</init-param>
</filter>
<context-param>
<param-name>sample</param-name>
<param-value>Sample Value</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
<filter-name>monitoring</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<init-param>
<param-name>displayed-counters</param-name>
<param-value>http,sql,error,log,spring,jsp</param-value>
</init-param>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter</filter-class>
</filter>
<filter>
<filter-name>charEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetBeanName</param-name>
<param-value>characterEncodingFilter</param-value>
</init-param>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>urlMapping</filter-name>
<filter-class>org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter</filter-class>
</filter>
<filter>
<filter-name>hiddenHttpMethod</filter-name>
<filter-class>org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter</filter-class>
</filter>
<filter>
<filter-name>grailsWebRequest</filter-name>
<filter-class>org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter</filter-class>
</filter>
<filter>
<filter-name>reloadFilter</filter-name>
<filter-class>org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter</filter-class>
</filter>
<filter>
<filter-name>springcacheContentCache</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetBeanName</param-name>
<param-value>springcacheFilter</param-value>
</init-param>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>charEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>monitoring</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.png</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.jpg</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.jpeg</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.gif</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.ico</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.css</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>staticFilter</filter-name>
<url-pattern>*.js</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hiddenHttpMethod</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>springcacheContentCache</filter-name>
<url-pattern>*.dispatch</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>grailsWebRequest</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>ERROR</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>reloadFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>urlMapping</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>
<listener>
<listener-class>org.codehaus.groovy.grails.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>grails</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>gsp</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.pages.GroovyPagesServlet</servlet-class>
<init-param>
<description>Allows developers to view the intermediade source code, when they pass
                        a spillGroovy argument in the URL.</description>
<param-name>showSource</param-name>
<param-value>1</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>grails-errorhandler</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.servlet.ErrorHandlingServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>SoapUIMockServlet</servlet-name>
<servlet-class>grails.plugin.soapui.GrailsMockAsWarServlet</servlet-class>
<init-param>
<param-name>projectFile</param-name>
<param-value>WEB-INF/soapui/zeepui.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>gsp</servlet-name>
<url-pattern>*.gsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>grails-errorhandler</servlet-name>
<url-pattern>/grails-errorhandler</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>grails</servlet-name>
<url-pattern>*.dispatch</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SoapUIMockServlet</servlet-name>
<url-pattern>/soapui/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.gsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>500</error-code>
<location>/grails-errorhandler</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/grails-errorhandler</location>
</error-page>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://www.springframework.org/tags</taglib-uri>
<taglib-location>/WEB-INF/tld/spring.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://grails.codehaus.org/tags</taglib-uri>
<taglib-location>/WEB-INF/tld/grails.tld</taglib-location>
</taglib>
</jsp-config>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
</web-app>

applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
       xsi:schemaLocation="

<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="grailsResourceLoader" ref="grailsResourceLoader" />
</bean>

<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
<description>A bean that manages Grails plugins</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="application" ref="grailsApplication" />
</bean>

    <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
        <constructor-arg>
            <ref bean="grailsApplication" />
        </constructor-arg>
        <property name="pluginManager" ref="pluginManager" />
    </bean>

    <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean">
        <property name="grailsResourceHolder" ref="grailsResourceHolder" />
    </bean>

    <bean id="grailsResourceHolder" scope="prototype" class="org.codehaus.groovy.grails.commons.spring.GrailsResourceHolder">
        <property name="resources">
              <value>**/grails-app/**/*.groovy</value>
        </property>
    </bean>    
    
   <bean id="characterEncodingFilter"
      class="org.springframework.web.filter.CharacterEncodingFilter">
        <property name="encoding">
          <value>utf-8</value>
        </property>
   </bean>    
</beans>
Reply | Threaded
Open this post in threaded view
|

Re: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

findingjimoh
Hey Erik,

I'm having the same exact problem. Did you find a solution to this problem?