Spring security error "No bean named 'org.hippoecm.hst.core.container.Pipelines' available"

Hi,

In our Bloomreach 13.4.4 enterprise project we want to add spring security to place some part of the site behind a login. When I follow this guide (HST Spring Security Support Documentation – How to use HST Spring Security Support & HST Spring Security Support Documentation – Configuration) I run into the warning & error below. Unfortunately the essentials way wasn’t working, probably due to the fact that this is an upgraded project, so I had to go the manual way.

What is not 100% properly described in the guide is where to put the xml definitions so maybe I made a mistake there.

Who can help me solve this and provide a solution to this problem?

[INFO] [talledLocalContainer] 18.02.2021 10:24:15 WARN  main [SpringSecurityCoreVersion.performVersionChecks:84] **** You are advised to use Spring 5.2.1.RELEASE or later with this version. You are running: 5.1.15.RELEASE
[INFO] [talledLocalContainer] 18.02.2021 10:24:16 WARN  main [AbstractApplicationContext.__refresh:557] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#0' defined in ServletContext resource [/WEB-INF/applicationContext-dev.xml]: Cannot create inner bean 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#1b4d593' of type [org.springframework.beans.factory.config.MethodInvokingFactoryBean] while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#1b4d593' defined in ServletContext resource [/WEB-INF/applicationContext-dev.xml]: Cannot resolve reference to bean 'org.hippoecm.hst.core.container.Pipelines' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.hippoecm.hst.core.container.Pipelines' available
[INFO] [talledLocalContainer] 18.02.2021 10:24:16 ERROR main [ContextLoader.initWebApplicationContext:313] Context initialization failed
[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#0' defined in ServletContext resource [/WEB-INF/applicationContext-dev.xml]: Cannot create inner bean 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#1b4d593' of type [org.springframework.beans.factory.config.MethodInvokingFactoryBean] while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.MethodInvokingFactoryBean#1b4d593' defined in ServletContext resource [/WEB-INF/applicationContext-dev.xml]: Cannot resolve reference to bean 'org.hippoecm.hst.core.container.Pipelines' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.hippoecm.hst.core.container.Pipelines' available
[INFO] [talledLocalContainer] 18-Feb-2021 10:24:16.636 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:361) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]
[INFO] [talledLocalContainer] 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.1.15.RELEASE.jar:5.1.15.RELEASE]

I think the ‘pipelining’ [1] should follow the general guideline [2]. So you can put the xml in the location in the demo project, too. [3]
Please feel free to suggest a PR in the documentation [4] as well. :wink:

Thanks,

Woonsan

[1] HST Spring Security Support Documentation – Configuration
[2] Create a Custom Valve - Bloomreach Experience - Open Source CMS
[3] hst-spring-security/spring-security.xml at develop · bloomreach-forge/hst-spring-security · GitHub
[4] hst-spring-security/configuration.xml at develop · bloomreach-forge/hst-spring-security · GitHub

Yes, that was the error in my config. I put that configuration in applicationContext-security.xml…
Apparently that was wrong.

I’ll spend some time to enhance the documentation.

Thanks @woonsanko

Thank you very much @Dennis_Vonk for your patience and helps in this community!
Tell us any time whenever you find something new, to improve or to fix.

Cheers, Woonsan