SAP Knowledge Base Article - Preview

3347451 - SAP Commerce with JRebel fails to start due to bean googleCaptchaV2ValidationStrategy

Symptom

Server startup with extension commercewebservicestests and using JRebel fails due to:

WARN [localhost-startStop-11] (junit) [CloseAwareApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'googleCaptchaV2ValidationStrategy' defined in class path resource [commercewebservicescommons-spring.xml]: Cannot resolve reference to bean 'httpClient' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mockOnHttpClient' defined in class path resource [commercewebservicestests/test/commercewebservicestests-test-spring.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Object]: Factory method 'mock' threw exception; nested exception is org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class org.apache.http.impl.client.CloseableHttpClient.
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mockOnHttpClient' defined in class path resource [commercewebservicestests/test/commercewebservicestests-test-spring.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.lang.Object]: Factory method 'mock' threw exception; nested exception is org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class org.apache.http.impl.client.CloseableHttpClient.
...


Read more...

Environment

SAP Commerce 2211 with JRebel

Product

SAP Commerce all versions

Keywords

googleCaptchaV2ValidationStrategy, commercewebservicescommons, httpClient, mockOnHttpClient, commercewebservicestests, JRebel, Mockito, JUnit , KBA , CEC-SCC-COM-BC-OCC , Commerce Web Services - OCC , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.