cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

platform core spring beans not getting injected in storefront

Former Member
0 Likes
1,522

I'm getting the following error below:

 WARN  [localhost-startStop-1] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storefrontMessageSource' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Cannot resolve reference to bean 'baseMessageSource' while setting bean property 'parentMessageSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseMessageSource' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1011E:(pos 35): Method call: Attempted to call method getProperty(java.lang.String) on null context object
 WARN  [localhost-startStop-1] [TenantIgnoreXmlWebApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storefrontMessageSource' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Cannot resolve reference to bean 'baseMessageSource' while setting bean property 'parentMessageSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseMessageSource' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1011E:(pos 35): Method call: Attempted to call method getProperty(java.lang.String) on null context object
 ERROR [localhost-startStop-1] [ContextLoader] Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'storefrontMessageSource' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Cannot resolve reference to bean 'baseMessageSource' while setting bean property 'parentMessageSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseMessageSource' defined in ServletContext resource [/WEB-INF/config/spring-mvc-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1011E:(pos 35): Method call: Attempted to call method getProperty(java.lang.String) on null context object


And upon further debugging and investigation, I found out that the spring beans from core, specifically configurationService is returning as null, see #{configurationService.configuration.getProperty()} call below.

 <bean id="baseMessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" >
         <property name="basenames">
             <list>
                 <value>/WEB-INF/messages/base</value>
             </list>
         </property>
         <property name="defaultEncoding" value="UTF-8"/>
         <!-- The number of seconds to cache loaded properties files. Set to -1 (never) for production. -->
         <property name="cacheSeconds" value="#{configurationService.configuration.getProperty('storefront.resourceBundle.cacheSeconds')}"/>
         <property name="fallbackToSystemLocale" value="false"/>
     </bean>

And I can see that the context is being loaded properly along with the parent based from the log file.

 INFO  [localhost-startStop-1] [HybrisContextLoaderListener] *************************************************************
 INFO  [localhost-startStop-1] [HybrisContextLoaderListener] adding custom config locations [WEB-INF/config/web-application-config.xml,classpath:/acceleratorstorefrontcommons/web/spring/acceleratorstorefrontcommons-spring.xml,classpath:/addonsupport/web/spring/addonsupport-b2c-web-spring.xml] for ctx Root WebApplicationContext - /newstorefront: startup date [Wed Dec 31 19:00:00 EST 1969]; parent: hybris Application context - master
 INFO  [localhost-startStop-1] [HybrisContextLoaderListener] *************************************************************

We have three storefront extensions and they are all working fine, I've created a new storefront using ext-gen, updated the extensioninfo.xml to use our generated facade extension which is the same configuration as the other three storefront extensions.

I'm kinda lost on what's goin on here as it seems like the context is getting loaded properly and the other three storefronts doesn't have any problem with context loading.

Here are the additional details that might be messing things up.

  • platform version is 6.4

  • the other three storefront version is 6.2

  • the facade extension is 6.2

  • the new storefront extension on which i'm having problem is 6.4

Accepted Solutions (0)

Answers (0)