[cas-user] Putting web.xml in my overlay causes runtime exception (version 3.4.5)

26 views
Skip to first unread message

Bryan Wooten

unread,
Jun 20, 2011, 9:21:58 AM6/20/11
to cas-...@lists.jasig.org

When I put the web.xml in my overlay (exact copy of the one in cas-server-webapp) I get the following error when I try and log in:

 

[#|2011-06-20T07:16:07.061-0600|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterpri

se.web|_ThreadID=27;_ThreadName=Thread-1;|StandardWrapperValve[default]: PWC1406: Servlet.service() for servl

et default threw exception

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'characterEncodingFilter' is d

efined

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultList

ableBeanFactory.java:509)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(Abstrac

tBeanFactory.java:1041)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:2

73)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193

)

 

 

Any ideas what would cause this?

 

Thanks,

 

Bryan

-- 
You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Andrew Petro

unread,
Jun 20, 2011, 10:13:44 AM6/20/11
to cas-...@lists.jasig.org
Bryan,

I can help you understand what the stack trace is saying, but I don't know why this problem is happening in your local environment without looking at your web.xml and local Spring configuration files.



web.xml declares a character encoding filter.

    <filter>
        <filter-name>characterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>


The Java Servlet Filter class that your servlet container (apparently, GlassFish) instantiates is a generic Spring-provided Filter (DelegatingFilterProxy) that then delegates to a bean wired up by Spring.  What bean? The bean with the same name as the filter.  So, the bean named "characterEncodingFilter".

Web.xml declares the listener that does this wiring and enumerates the (locations of) Spring configuration files.

	<listener>
		<listener-class>
			org.jasig.cas.web.init.SafeContextLoaderListener
		</listener-class>
	</listener>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			/WEB-INF/spring-configuration/*.xml
			/WEB-INF/deployerConfigContext.xml
		</param-value>
	</context-param>




What this stack trace is telling you is that there is no such bean named "characterEncodingFilter".

characterEncodingFilter is normally declared in /WEB-INF/spring-configuration/filters.xml

    <bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter"
            p:encoding="UTF-8"
            p:forceEncoding="true" />


https://source.jasig.org/cas3/tags/cas-server-3.4.5/cas-server-webapp/src/main/webapp/WEB-INF/spring-configuration/filters.xml



So, at least one of these problems should be it:
1) your filters.xml does not declare  bean characterEncodingFilter.
2) your filters.xml does not exist at all (neither coming from the cas-server-war you're Maven overlaying upon nor coming from your local configuration)
3) your web.xml contextConfigLocation int-param is such that the paths or explicit files it enumerates doesn't include your filter.xml


As for how this is supposed to work: filters.xml is supposed to be coming from the war you're overlaying upon, such that you need do nothing and this Bean is just present and accounted for automatically.

Best wishes,

Andrew



On 06/20/2011 09:21 AM, Bryan Wooten wrote:

When I put the web.xml in my overlay (exact copy of the one in cas-server-webapp) I get the following error when I try and log in:

 

[#|2011-06-20T07:16:07.061-0600|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterpri

se.web|_ThreadID=27;_ThreadName=Thread-1;|StandardWrapperValve[default]: PWC1406: Servlet.service() for servl

et default threw exception

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'characterEncodingFilter' is d

efined

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultList

ableBeanFactory.java:509)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(Abstrac

tBeanFactory.java:1041)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:2

73)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193

)

 

 

Any ideas what would cause this?

 

Thanks,

 

Bryan

-- 
You are currently subscribed to cas-...@lists.jasig.org as: ape...@unicon.net
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Bryan Wooten

unread,
Jun 20, 2011, 10:45:28 AM6/20/11
to cas-...@lists.jasig.org

Thanks Andrew,

 

I have fixed the problem, but it doesn't really make any sense. I simply copied BOTH filters.xml and web.xml to my overlay and now everything works.

 

This has me really scratching my head, but I am not inclined to dig deeper as it works now.

 

Cheers,

 

Bryan

-- 
You are currently subscribed to cas-...@lists.jasig.org as: bryan....@utah.edu

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Reply all
Reply to author
Forward
0 new messages