cancel
Showing results for 
Search instead for 
Did you mean: 

Hybris upgradation from 1808 to 2011 : No bean named 'restTemplate' available

We are getting below error while server start. Even though required(spring-web-5.2.9.RELEASE.jar) jar is available under platform folder.

INFO [localhost-startStop-7] [DefaultCacheController] Registered Listener de.hybris.platform.media.storage.impl.DefaultLocalMediaFileCacheService$MediaCacheLifecycleCallback@29e6fb34 on cache controller. Currently registered 1 INFO [localhost-startStop-7] [HybrisSpringSessionFilter] Hybris Spring Session filter disabled INFO [localhost-startStop-7] [Reflections] Reflections took 363 ms to scan 1 urls, producing 9 keys and 16 values INFO [localhost-startStop-7] [Reflections] Reflections took 1 ms to scan 1 urls, producing 2 keys and 5 values INFO [localhost-startStop-7] [ListMergeDirectiveBeanPostProcessor] Post Processing ListMergeDirective [priceProcessorsMergeDirective] on Bean [defaultPriceProcessors] INFO [localhost-startStop-7] [ListMergeDirectiveBeanPostProcessor] Post Processing ListMergeDirective [discountProcessorsMergeDirective] on Bean [defaultDiscountProcessors] INFO [localhost-startStop-7] [ListMergeDirectiveBeanPostProcessor] Post Processing ListMergeDirective [taxProcessorsMergeDirective] on Bean [defaultTaxProcessors] INFO [localhost-startStop-7] [PricingCustomizationDetector] PDT smart calculation mode is enabled (pdt.calculation.mode=smart). This setting is not recommended for production environment. WARN [localhost-startStop-7] [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultInterceptorRegistry' defined in class path resource [interceptor-spring.xml]: Unsatisfied dependency expressed through bean property 'interceptorMappings'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'removeDiscountsOnCurrencyRemoveMapping' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'removeDiscountsOnCurrencyRemovalInterceptor' while setting bean property 'interceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'removeDiscountsOnCurrencyRemovalInterceptor' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'discountService' while setting bean property 'discountService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDiscountService' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'findDiscountValuesStrategy' while setting bean property 'findDiscountValuesStrategy'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'findPDTValuesInformationsSwitcher' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'findDeliveryCostStrategy' while setting bean property 'findDeliveryCostStrategy'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customWdFindDeliveryCostStrategy': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customWdDeliveryCostHelper': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customWdUpsRatingService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'restTemplate' available ERROR [localhost-startStop-7] [HybrisContextFactory] Error initializing global application context! org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultInterceptorRegistry' defined in class path resource [interceptor-spring.xml]: Unsatisfied dependency expressed through bean property 'interceptorMappings'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'removeDiscountsOnCurrencyRemoveMapping' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'removeDiscountsOnCurrencyRemovalInterceptor' while setting bean property 'interceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'removeDiscountsOnCurrencyRemovalInterceptor' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'discountService' while setting bean property 'discountService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultDiscountService' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'findDiscountValuesStrategy' while setting bean property 'findDiscountValuesStrategy'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'findPDTValuesInformationsSwitcher' defined in class path resource [order-spring.xml]: Cannot resolve reference to bean 'findDeliveryCostStrategy' while setting bean property 'findDeliveryCostStrategy'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customWdFindDeliveryCostStrategy': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customWdDeliveryCostHelper': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customWdUpsRatingService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'restTemplate' available at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1524) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1404) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]

Accepted Solutions (0)

Answers (2)

Answers (2)

GiuseppeRamella
Associate
Associate
0 Kudos

Hello,

In general, one should carefully follow the steps of the documentation linked in KBA 3273785 when upgrading between releases.

Changes to type system and beans can cause builds and deployments to fail.

If you compare y2ysync/resources/y2ysync-spring.xml in 1811 and 1905, you can see a new bean was introduced:

 
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
    <property name="messageConverters">
        <list>
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
        </list>
    </property>
</bean>

Regards,
Giuseppe

GiuseppeRamella
Associate
Associate
0 Kudos

Hello,

In general, one should carefully follow the steps of the documentation linked in KBA 3273785 when upgrading between releases.

Changes to type system and beans can cause builds and deployments to fail.

If you compare y2ysync/resources/y2ysync-spring.xml in 1811 and 1905, you can see a new bean was introduced:

 
<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
    <property name="messageConverters">
        <list>
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
        </list>
    </property>
</bean>

Regards,
Giuseppe