CheckOutHelper.makeTaxContext .... r718913 goes boooom !!

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

CheckOutHelper.makeTaxContext .... r718913 goes boooom !!

Grant Edwards-2
Hi,

Got release 718913 yesterday and have run into the following checkout
problems.

Seems to be the same problem as described in ----->
http://www.nabble.com/Re%3A-svn-commit%3A-r713396----ofbiz-trunk-applications-product-src-org-ofbiz-product-product-ProductServices.java-to20462557.html#a20505411 



User Interface shows ::

The Following Errors Occurred:Error calling event:
org.ofbiz.webapp.event.EventHandlerException: Problems processing event:
java.lang.NullPointerException (null)




OFBiz.log shows ::

008-11-21 13:45:29,779 (http-0.0.0.0-8443-1) [    
RequestHandler.java:238:INFO ] [Processing Request]: calcTax
sessionId=10CFC75D97D336E6507D859D59711D31.jvm1
2008-11-21 13:45:29,850 (http-0.0.0.0-8443-1) [  
JavaEventHandler.java:97 :ERROR]
---- runtime exception report
--------------------------------------------------
Problems Processing Event
Exception: java.lang.NullPointerException
Message: null
---- stack trace
---------------------------------------------------------------
java.lang.NullPointerException
org.ofbiz.order.shoppingcart.CheckOutHelper.makeTaxContext(CheckOutHelper.java:805)

org.ofbiz.order.shoppingcart.CheckOutHelper.calcAndAddTax(CheckOutHelper.java:749)

org.ofbiz.order.shoppingcart.CheckOutHelper.calcAndAddTax(CheckOutHelper.java:739)

org.ofbiz.order.shoppingcart.CheckOutEvents.calcTax(CheckOutEvents.java:589)

org.ofbiz.order.shoppingcart.CheckOutEvents.calcTax(CheckOutEvents.java:573)

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:597)
org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:89)
org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:75)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:444)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:276)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:379)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:379)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:204)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:42)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------------------




Some prior explanation of the problem from Nabble ::

CartShipInfo.*shipItemInfo*, which used to be a LinkedMap, but is now a
LinkedHashMap.  LinkedMap, from commons-collections, has an overridden
get() method, that takes an int.  LinkedHashMap does not have such a
method.  So, it tries to call get(Object); java1.5 happily auto-boxes
the int to an Integer. However, *shipItemInfo* keys are of
ShoppingCartItem, so *null* is returned.  Things then go boom.

CheckOutHelper.calcAndAddTax has the same problem, expecting there to be
a get(int).

This code is rather poorly written; it requires *shipItemInfo* to be a map
with an implict order.  I'd like to keep the change of *shipItemInfo*'s
type to LinkedHashMap, but things aren't simple.

calcAndAddTax calls makeTaxContext.  This returns a Map, that contains
items that are of type List.  These lists are constructed by looping
over *shipItemInfo*, using the aforementioned get(int).  This particular
loop can be changed to be a standard Iterator, and just call
List.add(Object), instead of List.add(int, Object).

However, calcAndAddTax then loops over the constructed Lists, using an
int counter, then tries to fetch from the shipItemMap using get(int).

I've fixed it to be more collections friendly in 714082.




Although a fix is implied, the problem still appears to be there.


Kind regards

Grant Edwards
Reply | Threaded
Open this post in threaded view
|

Returns Invoice

Rees Watkins
Hi

An invoice is not generated when do a return using this method:

Order ->Returns->create new return

But

If I do a return by clicking on:

Quick Refund Entire Order from within an order then

An Invoice is generated.

Is there any reason for this difference? Is there a way to get the first method to generate a returns invoice?

Thanks
Rees


Reply | Threaded
Open this post in threaded view
|

Re: CheckOutHelper.makeTaxContext .... r718913 goes boooom !!

Jacques Le Roux
Administrator
In reply to this post by Grant Edwards-2
This bug has been fixed in r713396, I suggest to try last revision

Jacques

From: "Grant Edwards" <[hidden email]>

> Hi,
>
> Got release 718913 yesterday and have run into the following checkout problems.
>
> Seems to be the same problem as described in ----->
> http://www.nabble.com/Re%3A-svn-commit%3A-r713396----ofbiz-trunk-applications-product-src-org-ofbiz-product-product-ProductServices.java-to20462557.html#a20505411
>
>
> User Interface shows ::
>
> The Following Errors Occurred:Error calling event: org.ofbiz.webapp.event.EventHandlerException: Problems processing event:
> java.lang.NullPointerException (null)
>
>
>
>
> OFBiz.log shows ::
>
> 008-11-21 13:45:29,779 (http-0.0.0.0-8443-1) [     RequestHandler.java:238:INFO ] [Processing Request]: calcTax
> sessionId=10CFC75D97D336E6507D859D59711D31.jvm1
> 2008-11-21 13:45:29,850 (http-0.0.0.0-8443-1) [   JavaEventHandler.java:97 :ERROR]
> ---- runtime exception report --------------------------------------------------
> Problems Processing Event
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.order.shoppingcart.CheckOutHelper.makeTaxContext(CheckOutHelper.java:805)
> org.ofbiz.order.shoppingcart.CheckOutHelper.calcAndAddTax(CheckOutHelper.java:749)
> org.ofbiz.order.shoppingcart.CheckOutHelper.calcAndAddTax(CheckOutHelper.java:739)
> org.ofbiz.order.shoppingcart.CheckOutEvents.calcTax(CheckOutEvents.java:589)
> org.ofbiz.order.shoppingcart.CheckOutEvents.calcTax(CheckOutEvents.java:573)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:597)
> org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:89)
> org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:75)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:444)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:276)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:379)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:379)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:204)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
> org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:42)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> java.lang.Thread.run(Thread.java:619)
> --------------------------------------------------------------------------------
>
>
>
>
> Some prior explanation of the problem from Nabble ::
>
> CartShipInfo.*shipItemInfo*, which used to be a LinkedMap, but is now a
> LinkedHashMap.  LinkedMap, from commons-collections, has an overridden
> get() method, that takes an int.  LinkedHashMap does not have such a
> method.  So, it tries to call get(Object); java1.5 happily auto-boxes
> the int to an Integer. However, *shipItemInfo* keys are of
> ShoppingCartItem, so *null* is returned.  Things then go boom.
>
> CheckOutHelper.calcAndAddTax has the same problem, expecting there to be
> a get(int).
>
> This code is rather poorly written; it requires *shipItemInfo* to be a map
> with an implict order.  I'd like to keep the change of *shipItemInfo*'s
> type to LinkedHashMap, but things aren't simple.
>
> calcAndAddTax calls makeTaxContext.  This returns a Map, that contains
> items that are of type List.  These lists are constructed by looping
> over *shipItemInfo*, using the aforementioned get(int).  This particular
> loop can be changed to be a standard Iterator, and just call
> List.add(Object), instead of List.add(int, Object).
>
> However, calcAndAddTax then loops over the constructed Lists, using an
> int counter, then tries to fetch from the shipItemMap using get(int).
>
> I've fixed it to be more collections friendly in 714082.
>
>
>
>
> Although a fix is implied, the problem still appears to be there.
>
>
> Kind regards
>
> Grant Edwards
>

Reply | Threaded
Open this post in threaded view
|

Re: Returns Invoice

Jacques Le Roux
Administrator
In reply to this post by Rees Watkins
You need to successively put the return header status from requested to accepted and finally completed. You will then find the
corresponding invoice Customer Return generated in accoutning component

Jacques

From: "Rees Watkins" <[hidden email]>
Hi

An invoice is not generated when do a return using this method:

Order ->Returns->create new return

But

If I do a return by clicking on:

Quick Refund Entire Order from within an order then

An Invoice is generated.

Is there any reason for this difference? Is there a way to get the first method to generate a returns invoice?

Thanks
Rees



Reply | Threaded
Open this post in threaded view
|

Re: Returns Invoice

Shereen
Hi all

I'm using release10.04
I'm asking about the auto creation of the invoice (Customer refund invoice)
I go to the certain order I want. then "create return" and specify the items then click accept then go and receive the shipment and the recieve the return from the inventory and the status remains received not completed when I changed it myself to completed it generated for me the invoice but the total is zero and there's no items would anyone please tell me what I'm doing wrong?

Thanks in advance