cancel
Showing results for 
Search instead for 
Did you mean: 

custom addon controller was not able to call from storefront

Former Member
0 Kudos

HI Team

I am facing an issue here , please help me

I was created one addon through extgen and i have added one controller in addon , now i am trying to call that controller from storefront , but it was not mapping the call.

Note : i was installed addon on that storefront.

thanks Nagendra D

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nagendra,

Make sure that you have added component-scan to your addon-web-spring.xml:

     <context:component-scan base-package="package.with.your.controller" />

Cheers, Mirek

Former Member
0 Kudos

HI Miroslaw

Thanks for your response

But i have added tag properly even though i am facing problem , and one more thing i would mention here that even java bean class's and jsp pages also not binding into storefront.

Thanks Nagendra D

Former Member
0 Kudos

Hi ,

Let's say the storefront is yb2bacceleratorstorefront. The addon is myb2baddon.

  1. yb2baccelratorstorefront/extensioninfo.xml contains require directive

  2. myb2baddon/project.properties exist and contains: yb2bacceleratorstorefront.additionalWebSpringConfigs.myb2baddon=classpath\:/savedcartsaddon/web/spring/myb2baddon-web-spring.xml

  3. the myb2baddon-web-spring.xml contains componnet-scan with proper package

  4. The class is annotated with @Controller

  5. ant all has been issued so the controller class was copied to yb2bacceleratorstorefront\web\addonsrc\myb2baddon and compiled.

Former Member
0 Kudos

here you can read more about addoinstall tool:

https://help.hybris.com/6.1.0/hcd/8adf7365866910149ceb975f778d809d.html

former_member664713
Active Participant
0 Kudos

Hi I follow the same , my addon web spring xml was not loading

Former Member
0 Kudos

Add "addonsupport" in localextensions.xml and give a try.

Former Member
0 Kudos

Hi,

By adding this to my addon-web-spring.xml file, I get below exception while server start:

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'xyz' for bean class [controller.package.XYZController] conflicts with existing, non-compatible bean definition of same name and class [controller.package.XYZController]

0 Kudos

Did you get solution for this.?

Answers (6)

Answers (6)

0 Kudos

Hi Nagendra,

Try with below impex, replace with your addonName and path

INSERT_UPDATE PageTemplate;$contentCV[unique=true];uid[unique=true];name;frontendTemplateName;restrictedPageTypes(code);active[default=true]
;;CategoryPageTemplate;Category Page Template;addon:${addOnName}/pages/telco/category/${customCategoryJSP};CategoryPage

FYI, https://help.hybris.com/1808/hcd/8acf28c386691014a31dc2e54c3e98ec.html

Former Member
0 Kudos

I guess need to add URL handler mapping is missing,

     <property name="mappings">
         <props>
             <prop key="/url/**">controller_name</prop>

...

Former Member
0 Kudos

Add "addonsupport" in localextensions.xml and give a try.

Former Member
0 Kudos

Hello, I'm facing the same. Did anyone solved this? Share it! :)

Former Member
0 Kudos

Did you get any solution for this?

former_member184944
Participant
0 Kudos

Hello , I am facing similar issue. Kindly share if you were able to resolve the issue.

Former Member
0 Kudos

We can use buildcallbacks as a hack to replace AbstractPageController with customized AbstractPageController