I have a custom ofbiz-component which have a java event class,
MyCustomEvent, having processCustomDetails.
I want to call "processCustomDetails" event after "processpayment" request
of ecommerce on success. I have changed the mapping in ecommerce as follows
:
<request-map uri="processpayment">
<security https="true" direct-request="false"/>
<event type="java"
path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="processPayment"/>
<!-- COMMENTING THIS response name="success" type="request"
value="clearcartfororder"/ -->
<response name="success" type="request"
value="processCustomDetails"/>
<response name="fail" type="request" value="checkouterror"/>
<response name="error" type="view" value="checkoutreview"/>
</request-map>
I have also included controller.xml of custom component, so that
"processCustomDetails" is accessible to ecommerce.
<include
location="component://custom-component/webapp/custom-component/WEB-INF/controller.xml"/>
But when I run the ecommerce checkout process, I get the below error message
/ exception :
org.ofbiz.webapp.event.EventHandlerException: Problems processing event:
java.lang.NoSuchMethodException:
com.custom.MyCustomEvent.processCustomDetails(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
(com.custom.MyCustomEvent.processCustomDetails(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse))
Although "processCustomDetails" method signature is correct.
public static String processCustomDetails(HttpServletRequest request,
HttpServletResponse response) throws EventHandlerException
To check I copied my java event class and the request mappings directly to
ecommerce, and it was running fine.
I don't know what's wrong ? I gues ecommerce can call the events of
components in hot-deploy ? or do I need to configure reference to the
custom-component in ecommerce somewhere ?