cancel
Showing results for 
Search instead for 
Did you mean: 

Access a bean defined in b2ccheckoutaddon-web-spring.xml

Former Member
0 Kudos

Hi everyone,

I'm trying to access a bean defined in b2ccheckoutaddon-web-spring.xml but my AddOn can not see it. I already defined the in extensioninfo.xml, and I added the reference in merchandisecheckoutaddon-web-spring.xml - which is the xml for my extension.

The errro I'm getting is

Error creating bean with name 'merchandiseMultiFlowCheckoutGroup' defined in class path resource [merchandisecheckoutaddon/web/spring/merchandisecheckoutaddon-web-spring.xml]: Cannot resolve reference to bean 'multiStepCheckout' while setting bean property 'checkoutStepMap' with key [TypedStringValue: value [multi], target type [null]]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'multiStepCheckout' is defined

Any idea what can happen?

Thanks.

Former Member
0 Kudos

You said that you did add b2ccheckoutaddon to the extensioninfo.xml file?

Did you add <classpathentry combineaccessrules="false" kind="src" path="/b2ccheckoutaddon"/> to the .classpath file?

Former Member
0 Kudos

Hi Kyle,

Yes, actually I added this:

 <classpathentry combineaccessrules="false" kind="src" path="/b2ccheckoutaddon"/>
 <classpathentry combineaccessrules="false" kind="src" path="/acceleratorstorefrontcommons"/>



And still is not working.

Former Member
0 Kudos

And yes, I added b2ccheckoutaddon to the extensioninfo.xml file from my AddOn.

I really appreciate your help.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kyle.. Thanks for yout time on this.

I tried to copy and paste the bean definition placed in b2ccheckoutaddon, but it start to complaining for more references, so I don't think that is a good approach.

I just need to understand how to make visible one bean into the spring context, so it can be used in other addOn.

Any idea on what else can I do ?

Appreciate it.

Former Member
0 Kudos

If you comment out the <entry key="multi" value-ref="multiStepCheckout"/> line in your merchandiseMultiFlowCheckoutGroup bean, do you get any other bean reference errors?

Former Member
0 Kudos

Did you look inside b2ccheckoutaddon-web-spring.xml to see if the multiStepCheckout bean is defined?

If it is and you are still facing issues, a temporary issue might be to copy the bean defined in b2ccheckoutaddon-web-spring.xml into your merchandiseaddon-web-spring.xml

Former Member
0 Kudos

Hi Kyle.

Thanks for your answer.

Yes, the bean is defined, BUT, the multiStepCheckout is an alias, is not the bean id. I don´t know if that could bring any issue.

This is the bean definition:

 <alias name="defaultMultiStepCheckout" alias="multiStepCheckout" />
 <bean id="defaultMultiStepCheckout" parent="checkoutStep">
     <property name="checkoutGroup" ref="defaultCheckoutGroup"/>
     <property name="checkoutStepValidator" ref="defaultMultiStepCheckoutValidator"/>
     <property name="transitions">
         <map>
             <entry key="previous" value-ref="REDIRECT_TO_CART"/>
             <entry key="current" value-ref="REDIRECT_MULTI_STEP_CHECKOUT"/>
             <entry key="next" value-ref="REDIRECT_TO_DELIVERY_ADDRESS"/>
         </map>
     </property>
     <property name="progressBarId" value="multi"/>
 </bean>

I will try to apply your workaround, and I will let you know.

Best,

Former Member
0 Kudos

No, the alias should not be causing the issue. The alias is used in case you wanted to create a new bean definition called 'myMultiStepCheckout', but you want beans that reference 'multiStepCheckout' to now use your new bean instead.

Former Member
0 Kudos

Hi Kyle.. Thanks for yout time on this.

I tried to copy and paste the bean definition placed in b2ccheckoutaddon, but it start to complaining for more references, so I don't think that is a good approach.

I just need to understand how to make visible one bean into the spring context, so it can be used in other addOn.

Any idea on what else can I do ?

Appreciate it.