[#11866] - ldap integration breaks jasperserver

Category:
Bug report
Priority:
Urgent
Status:
Confirmed
Project: Severity:
Block
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
6

when i add applicationcontext-externalauth-ldap.xml file to web-inf the application will not run

v7.2
efrain.torres's picture
Joined: Nov 16 2015 - 4:26am
Last seen: 4 months 3 weeks ago

9 Comments:

#1
  • Priority:Normal» Urgent
  • Severity:Minor» Major
#2

Have the same issue. Seams to be an issue with the configuration of the spring beans.

2019-06-04 10:59:14,096 ERROR ContextLoader,localhost-startStop-1:350 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proxyBasicProcessingFilter' defined in ServletContext resource [/WEB-INF/applicationContext-externalAuth-LDAP.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'authenticationManager' of bean class [com.jaspersoft.jasperserver.api.security.externalAuth.ExternalAuthBasicProcessingFilter]: Bean property 'authenticationManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1281)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'authenticationManager' of bean class [com.jaspersoft.jasperserver.api.security.externalAuth.ExternalAuthBasicProcessingFilter]: Bean property 'authenticationManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.createNotWritablePropertyException(BeanWrapperImpl.java:239)
at org.springframework.beans.AbstractNestablePropertyAccessor.processLocalProperty(AbstractNestablePropertyAccessor.java:435)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:290)
at org.springframework.beans.AbstractNestablePropertyAccessor.setPropertyValue(AbstractNestablePropertyAccessor.java:278)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1567)
... 26 more

#3
  • Reproducibility:N/A» Always
#4
#5
  • Severity:Major» Block
#6
  • Status:New» Confirmed

I have just started working on adding LDAP integration for Jasper, this bug impacts us too. The supplied sample ldap auth file sample-applicationContext-externalAuth-LDAP.xml apparently does not work with the changes to spring beans 4.0 (from 3.1) that were done as of Jasper 7.2.

#7

With migration from Spring 3 to Spring 4 many Spring security classes no longer allow to set up some property after bean was created, as Some JRS security related classes extends Spring classes - they also changed this way.
To fix this kind of issues bean definitions should be changed to Constructor based.
for "proxyBasicProcessingFilter" just replace

<property name="authenticationManager" ref="ldapAuthenticationManager"/>

with

<constructor-arg index="0"><ref bean="ldapAuthenticationManager"/></constructor-arg>

#8

Hi ogavavka,
thanks, you really help me!
Jan

#9

Hi ogavavka
Thanks for your help!
I also had to change "proxyBasicProcessingFilter" from

<property name="providers">
<list>
<ref local="ldapAuthenticationProvider"/>
<ref bean="${bean.daoAuthenticationProvider}"/>
</list>
</property>

to

<constructor-arg index="0">
<list>
<ref local="ldapAuthenticationProvider"/>
<ref bean="${bean.daoAuthenticationProvider}"/>
</list>
</constructor-arg>

Roland

Feedback
randomness