Skip to Content
author's profile photo Former Member
Former Member

AddOn for OCC Web Services spring context

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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 05, 2014 at 06:42 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Amel,

      Yes I've added the additionalWebSpringConfigs. This way my controller got picked by the context:component-scan tag and I got access to the checkoutFacade.

      The problem is that I don't get access to all those beans from ycommercewebservices context.

      Tnanks, Alecs

  • Posted on Sep 08, 2014 at 04:07 PM

    Hi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.