Upgrade 12.6 to version v13.02 springframework BeanCreationException SpringComponentManager-pagecomposer.xml

Hi, at the moment I am upgrading from 12.6 to 13.02. I have completed the upgrade steps. The project builds fine. However when starting up the project via cargo.run I get the following errors:

[INFO] [talledLocalContainer] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jaxrsHstConfigCxfServerFactoryBean’ defined in URL [jar:file:/myproject/target/tomcat9x/webapps/site/WEB-INF/lib/hst-page-composer-13.0.2.jar!/META-INF/hst-assembly/addon/org/hippoecm/hst/pagecomposer/SpringComponentManager-pagecomposer.xml]: Cannot create inner bean ‘org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider#42f33d11’ of type [org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider] while setting bean property ‘resourceProviders’ with key [6]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.apache.cxf.jaxrs.lifecycle.SingletonResourceProvider#42f33d11’ defined in URL [jar:file:/myproject/target/tomcat9x/webapps/site/WEB-INF/lib/hst-page-composer-13.0.2.jar!/META-INF/hst-assembly/addon/org/hippoecm/hst/pagecomposer/SpringComponentManager-pagecomposer.xml]: Cannot create inner bean ‘org.hippoecm.hst.pagecomposer.jaxrs.services.RootResource#2015eb08’ of type [org.hippoecm.hst.pagecomposer.jaxrs.services.RootResource] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.hippoecm.hst.pagecomposer.jaxrs.services.RootResource#2015eb08’ defined in URL [jar:file:/myproject/target/tomcat9x/webapps/site/WEB-INF/lib/hst-page-composer-13.0.2.jar!/META-INF/hst-assembly/addon/org/hippoecm/hst/pagecomposer/SpringComponentManager-pagecomposer.xml]: Cannot resolve reference to bean ‘channelService’ while setting bean property ‘channelService’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘channelService’ defined in URL [jar:file:/myproject/target/tomcat9x/webapps/site/WEB-INF/lib/hst-page-composer-13.0.2.jar!/META-INF/hst-assembly/addon/org/hippoecm/hst/pagecomposer/SpringComponentManager-pagecomposer.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:327) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:124) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:401) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1665) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1417) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:367) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
[INFO] [talledLocalContainer] … 70 more

Any idea why this is happening or pointers how to solve this? It seems to be something in hst-page-composer-13.0.2.jar…am I missing something?

regards

Looks beans are not created i am not sure your current code base had some beans mapped.
if yes you can use bean writer from essentials it will create all beans and hook as needed.

This is about Spring beans, not about document beans that you create with the bean writer.

There’s a NullPointerException in ChannelService#init which seems to indicate there’s no PlatformServices available. That one is registered by the HstCmsContextLoaderListener that you should have in the CMS’s web.xml, see [1]. Can you double check that?

Cheers, Jeroen

[1] https://documentation.bloomreach.com/library/upgrade-12-to-13/steps/upgrade-cms-web.xml.html

Hi Jeroen, the HstCmsContextLoaderListener is there in the web.xml of the CMS.
The error went away after adding the following dependencies to the site pom:

<dependency>
  <groupId>org.onehippo.cms7.hst.components</groupId>
  <artifactId>hst-platform</artifactId>
  <version>${hippo.hst.version}</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-rt-rs-client</artifactId>
  <version>3.2.7</version>
</dependency>
<dependency>
  <groupId>org.onehippo.cms7</groupId>
  <artifactId>hippo-cms-gallery-frontend</artifactId>
  <version>${hippo.hst.version}</version>
</dependency> 

Due to custom implementation I guess. So now we are continuing in our upgrade process…