Hello all,
I am facing problem while calling ajax requests in Checkout page. I think Ajax requests in which events of type="jsonsimple" are invoked, are not working properly. The requests like createUpdateShippingAddress, getShipOptions, createUpdateBillingAndPayment et.c. which invoke events of type= "jsonsimple" are breaking the process. I also tried putting security https="false" but then also error occurs. The error log i get is : 2009-03-16 16:10:59,360 (http-0.0.0.0-8443-1) [ ControlServlet.java:208:ERROR] ---- runtime exception report -------------------------------------------------- Error in request handler: Exception: java.lang.NullPointerException Message: null ---- stack trace --------------------------------------------------------------- java.lang.NullPointerException org.ofbiz.webapp.event.SimpleEventHandler.invoke(SimpleEventHandler.java:54) org.ofbiz.webapp.event.AbstractJSONEventHandler.invoke(AbstractJSONEventHandler.java:48) org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:538) org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:336) I tried to trace the source from where the error is coming then found that it is generated by statement, String eventReturn = eventHandler.invoke(event, requestMap, request, response); in RequestHandler.java. I think these requests are troubling after some security changes done for XSRF. I may be wrong, please provide suggestions, how this problem could be resolved. Thanks & Regards, -- Ashish Nagar |
Can you try with this change:
Index: framework/webapp/src/org/ofbiz/webapp/event/ AbstractJSONEventHandler.java =================================================================== --- framework/webapp/src/org/ofbiz/webapp/event/ AbstractJSONEventHandler.java (revision 754880) +++ framework/webapp/src/org/ofbiz/webapp/event/ AbstractJSONEventHandler.java (working copy) @@ -45,7 +45,7 @@ public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException { // call into the java handler for parameters parsing and invocation - String respCode = service.invoke(null, requestMap, request, response); + String respCode = service.invoke(event, requestMap, request, response); // pull out the service response from the request attribute Map<String, Object> attrMap = UtilHttp.getJSONAttributeMap(request); Bilgin On Mar 16, 2009, at 1:01 PM, Ashish Nagar wrote: > Hello all, > > I am facing problem while calling ajax requests in Checkout page. I > think Ajax requests in which events of type="jsonsimple" are > invoked, are not working properly. The requests like > createUpdateShippingAddress, getShipOptions, > createUpdateBillingAndPayment et.c. which invoke events of type= > "jsonsimple" are breaking the process. I also tried putting security > https="false" but then also error occurs. The error log i get is : > > > > 2009-03-16 16:10:59,360 (http-0.0.0.0-8443-1) > [ ControlServlet.java:208:ERROR] > ---- runtime exception report > -------------------------------------------------- > Error in request handler: > Exception: java.lang.NullPointerException > Message: null > ---- stack trace > --------------------------------------------------------------- > java.lang.NullPointerException > org > .ofbiz > .webapp.event.SimpleEventHandler.invoke(SimpleEventHandler.java:54) > org > .ofbiz > .webapp > .event.AbstractJSONEventHandler.invoke(AbstractJSONEventHandler.java: > 48) > org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java: > 538) > org > .ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java: > 336) > > > > I tried to trace the source from where the error is coming then > found that it is generated by statement, > String eventReturn = eventHandler.invoke(event, requestMap, request, > response); in RequestHandler.java. > > I think these requests are troubling after some security changes > done for XSRF. I may be wrong, please provide suggestions, how this > problem could be resolved. > > > Thanks & Regards, > -- > Ashish Nagar > |
Thanks Bilgin,
Now these events are working fine. I think this should be fixed in trunk as well. Thanks & Regards, -- Ashish Nagar Bilgin Ibryam wrote: > Can you try with this change: > > Index: > framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java > =================================================================== > --- > framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java > (revision 754880) > +++ > framework/webapp/src/org/ofbiz/webapp/event/AbstractJSONEventHandler.java > (working copy) > @@ -45,7 +45,7 @@ > > public String invoke(Event event, RequestMap requestMap, > HttpServletRequest request, HttpServletResponse response) throws > EventHandlerException { > // call into the java handler for parameters parsing > and invocation > - String respCode = service.invoke(null, requestMap, request, > response); > + String respCode = service.invoke(event, requestMap, request, > response); > // pull out the service response from the request attribute > Map<String, Object> attrMap = > UtilHttp.getJSONAttributeMap(request); > > > Bilgin > > > On Mar 16, 2009, at 1:01 PM, Ashish Nagar wrote: > >> Hello all, >> >> I am facing problem while calling ajax requests in Checkout page. I >> think Ajax requests in which events of type="jsonsimple" are invoked, >> are not working properly. The requests like >> createUpdateShippingAddress, getShipOptions, >> createUpdateBillingAndPayment et.c. which invoke events of type= >> "jsonsimple" are breaking the process. I also tried putting security >> https="false" but then also error occurs. The error log i get is : >> >> >> >> 2009-03-16 16:10:59,360 (http-0.0.0.0-8443-1) [ >> ControlServlet.java:208:ERROR] >> ---- runtime exception report >> -------------------------------------------------- >> Error in request handler: >> Exception: java.lang.NullPointerException >> Message: null >> ---- stack trace >> --------------------------------------------------------------- >> java.lang.NullPointerException >> org.ofbiz.webapp.event.SimpleEventHandler.invoke(SimpleEventHandler.java:54) >> >> org.ofbiz.webapp.event.AbstractJSONEventHandler.invoke(AbstractJSONEventHandler.java:48) >> >> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:538) >> >> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:336) >> >> >> >> >> I tried to trace the source from where the error is coming then found >> that it is generated by statement, >> String eventReturn = eventHandler.invoke(event, requestMap, request, >> response); in RequestHandler.java. >> >> I think these requests are troubling after some security changes done >> for XSRF. I may be wrong, please provide suggestions, how this >> problem could be resolved. >> >> >> Thanks & Regards, >> -- >> Ashish Nagar >> > |
Free forum by Nabble | Edit this page |