on ‎2018 Sep 20 3:46 PM
Hi All,
We have created a CustomProductController (extends from BaseController) in customwebserviceaddon and installed this addon in customcommercewebservices extension (from ycommercewebservices template).
But when we are injecting cwsSearchQueryCodecin (defined in customcommercewebservices/springmvc-v2-servlet.xml) in CustomProductController , then we are getting error No bean named cwsSearchQueryCodec during server start.
Note : We are not getting errors for beans which are defined in other extension-spring.xml but getting error for beans defined in springmvc-v2-servlet.xml.
Please anyone help me regarding this.
Request clarification before answering.
Hi
Try to move this bean definition to v2-web-spring.xml .
springmvc-v2-servlet.xml is loaded by WebConfig.java (@ImportResource annotation) on the servlet level.
web.xml :
<servlet>
<servlet-name>springmvc-v2</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
de.hybris.platform.ycommercewebservices.v2.config.WebConfig
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Additional config from addons are loaded on the web application level and it looks like servlet context is not visible there
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/ycommercewebservices-web-spring.xml</param-value>
</context-param>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 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.