custom event issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

custom event issue

Abdullah Shaikh-3
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 ?
Reply | Threaded
Open this post in threaded view
|

Re: custom event issue

rajsaini
Hi Abdullah,

I think as long as your customEvent code is in classpath it should not
matter who is calling it. Check if your code is really compiled.

However, I have another suggestion. If you have extended your
application form e-commerce, why you want to modify stuff in e-commerce?
Why not top copy the complete request map chain to your custom
application and hook up your custom event where ever you want with the
chain?

Thanks,

Raj

Abdullah Shaikh wrote:

> 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 ?
>
>