on 09-05-2014 7:16 PM
Hello,
Following this tutorial you are able to create a new addon and install it on the ycommercewebservices extension.
I wanted to ask you if the spring context of a controller from this addon is different from the ones from ycommercewebservices and what should I do to get all the @Resources available in my controller.
I'll give an example from the tutorial itself have in the ExtendedCartController facades which can be injected with @Resource(name = "checkoutFacade")
private CheckoutFacade checkoutFacade;
but if I do the same as in de.hybris.platform.ycommercewebservices.v1.controller.CartController @Resource(name = "addressValidator")
private Validator addressValidator;
I get the error Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'addressValidator' is defined
.
Do you have any tips on what I'm doing wrong or what I should add more?
Hi Alecs,
Accoring to the tutorial, the addon web context should be added to the commerce webservice webcontext. Did you put the following in your project.properties.template ?
ycommercewebservices.additionalWebSpringConfigs.occaddon=classpath:/occaddon/web/spring/occaddon-web-spring.xml
Thanks,
Amel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Make sure that you have addonname-web-spring.xml localized in resource directory - and that it have something like this :
<context:component-scan base-package="path.to.your.contoller"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.