Back Forum Reply New

ChannelProcessingFilter

I'm upgrading from Security 2.5.X to 3.0.5.

This former definition for channelProcessingFilter no longer works (after updating the FQN and the name of the property - since filterInvocationDefinitionSource left with no forwarding address):Code:
lt;bean id=quot;channelProcessingFilterquot; class=quot;org..security.web.access.channel.ChannelProcessingFilterquot;gt; lt;property name=quot;securityMetadataSourcequot;gt;   lt;valuegt;     CONVERT_ucl_TO_LOWERCASE_BEFORE_COMPARISON     PATTERN_TYPE_APACHE_ANT     /**=REQUIRES_SECURE_CHANNEL   lt;/valuegt; lt;/propertygt; lt;property name=quot;channelDecisionManagerquot; ref=quot;channelDecisionManagerquot; /gt;
lt;/beangt;
The error is:

Code:
Caused by: org..beans.factory.BeanCreationException: Error creating bean with name 'channelProcessingFilter' defined in ServletContext resource [/WEB-INF/config/applicationContext-security.xml]: Initialization of bean failed; nested exception is org..beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org..security.web.access.intercept.FilterInvocationSecurityMetadataSource' for property 'securityMetadataSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org..security.web.access.intercept.FilterInvocationSecurityMetadataSource] for property 'securityMetadataSource': no matching editors or conversion strategy found
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org..beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org..beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org..beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org..beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org..beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 34 more
Caused by: org..beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org..security.web.access.intercept.FilterInvocationSecurityMetadataSource' for property 'securityMetadataSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org..security.web.access.intercept.FilterInvocationSecurityMetadataSource] for property 'securityMetadataSource': no matching editors or conversion strategy found
at org..beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:462)
at org..beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
at org..beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:493)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 40 more
Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org..security.web.access.intercept.FilterInvocationSecurityMetadataSource] for property 'securityMetadataSource': no matching editors or conversion strategy found
at org..beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org..beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
... 46 more
Understood.  The simple value definition won't work.

Based on the changes I successfully made to my definition of org..security.web.FilterChainProxy and other forum posts, I figured I could define the property as:Code:
lt;property name=quot;securityMetadataSourcequot;gt; lt;security:filter-security-metadata-source path-type=quot;antquot; id=quot;securityDefinitionSourcequot;gt;   lt;security:intercept-ucl pattern=quot;/**quot; access=quot;REQUIRES_SECURE_CHANNELquot; /gt; lt;/security:filter-security-metadata-sourcegt;
lt;/propertygt;
However, that resulted in:

Code:
Caused by: org..beans.factory.BeanCreationException: Error creating bean with name 'filterInvocationInterceptor' defined in ServletContext resource [/WEB-INF/config/applicationContext-security.xml]: Initialization of bean failed; nested exception is org..beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org..security.web.access.intercept.FilterInvocationSecurityMetadataSource' for property 'objectDefinitionSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org..security.web.access.intercept.FilterInvocationSecurityMetadataSource] for property 'objectDefinitionSource': no matching editors or conversion strategy found
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org..beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org..beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org..beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org..beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org..beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 34 more
Caused by: org..beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org..security.web.access.intercept.FilterInvocationSecurityMetadataSource' for property 'objectDefinitionSource'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org..security.web.access.intercept.FilterInvocationSecurityMetadataSource] for property 'objectDefinitionSource': no matching editors or conversion strategy found
at org..beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:462)
at org..beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
at org..beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:493)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
... 40 more
Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [org..security.web.access.intercept.FilterInvocationSecurityMetadataSource] for property 'objectDefinitionSource': no matching editors or conversion strategy found
at org..beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org..beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
... 46 more
I sort of get it ... There's Spring doesn't know how to convert the filter-security-metadata-source tag into a FilterInvocationSecurityMetadataSource.  

Can someone provide a better example or description of how to get this working?

Thanks.

Sigh ... my bad.

The property name 'objectDefinitionSource' should have been a better clue.

I had a FilterSecurityInterceptor which used that property which also needed to be converted to a lt;security:filter-security-metadata-sourcegt;.

The ChannelProcessingFilter worked as advertised with the above changes.

Sorry for the confusion.
¥
Back Forum Reply New