You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Nathan Hampton - Circuit Rider Books <op...@circuitriderbooks.org> on 2008/10/21 07:21:30 UTC

Product Stores & Purchase Orders

Now that I've (finally!) managed to track down the problem, I can ask  
what to do about it!

BACKGROUND:

This problem occurs with revision 678902.  I haven't checked more  
recent versions because I'm trying to get us up and running before  
changing anything else.  If this has been fixed or changed, I  
apologize in advance for any inconvenience.

Every time I try to create a purchase order, I get the following:

---- runtime exception report  
---------------------------------------------------
Problems Processing Event Exception: java.lang.NullPointerException  
Message: null
---- stack trace  
----------------------------------------------------------------
java.lang.NullPointerException  
org 
.ofbiz 
.product 
.store 
.ProductStoreWorker.getStoreCurrencyUomId(ProductStoreWorker.java:95)
org.ofbiz.order.shoppingcart.WebShoppingCart.(WebShoppingCart.java:44)
org 
.ofbiz 
.order 
.shoppingcart.ShoppingCartEvents.getCartObject(ShoppingCartEvents.java: 
961)
org 
.ofbiz 
.order 
.shoppingcart.ShoppingCartEvents.getCartObject(ShoppingCartEvents.java: 
980)
org 
.ofbiz 
.order 
.shoppingcart 
.ShoppingCartEvents.initializeOrderEntry(ShoppingCartEvents.java:1524)
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:585)
org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:88)
org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:74)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java: 
454)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java: 
281)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:198)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
{{ Low-level crap omitted for the sake of brevity. }}
--------------------------------------------------------------------------------

After tracing the execution through the source files, I managed to  
determine that when initorderentry doesn't find a ProductStore in the  
request, it looks for one in the WebSite, and since I don't have a  
WebSite with the ID "OrderEntry", it can't find one.

QUESTIONS:

1) What is the significance of the WebSite-ProductStore association?
2) What should I consider when deciding which of my five ProductStores  
to associate with the WebSite "OrderEntry"?
3) I understand the need for a ProductStore when creating a Sales  
Order, but why do I need one when creating a Purchase Order?  If it's  
just to set a default Currency UOM, isn't there -- or shouldn't we  
find -- a better way to do this?  Alternately, why can't we just skip  
the default and set the Currency UOM on the next screen, where we  
already have a way to change it?

Thanks for the help!

--Nathan

Re: Product Stores & Purchase Orders

Posted by BJ Freeman <bj...@free-man.net>.
There has been some work on this lately, that may cause this.
suggest you open a Jira, so the parties can check what they did.


Nathan Hampton - Circuit Rider Books sent the following on 10/20/2008
10:21 PM:
> Now that I've (finally!) managed to track down the problem, I can ask
> what to do about it!
> 
> BACKGROUND:
> 
> This problem occurs with revision 678902.  I haven't checked more recent
> versions because I'm trying to get us up and running before changing
> anything else.  If this has been fixed or changed, I apologize in
> advance for any inconvenience.
> 
> Every time I try to create a purchase order, I get the following:
> 
> ---- runtime exception report
> ---------------------------------------------------
> Problems Processing Event Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ----------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.product.store.ProductStoreWorker.getStoreCurrencyUomId(ProductStoreWorker.java:95)
> 
> org.ofbiz.order.shoppingcart.WebShoppingCart.(WebShoppingCart.java:44)
> org.ofbiz.order.shoppingcart.ShoppingCartEvents.getCartObject(ShoppingCartEvents.java:961)
> 
> org.ofbiz.order.shoppingcart.ShoppingCartEvents.getCartObject(ShoppingCartEvents.java:980)
> 
> org.ofbiz.order.shoppingcart.ShoppingCartEvents.initializeOrderEntry(ShoppingCartEvents.java:1524)
> 
> 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:585)
> org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:88)
> org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:74)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:454)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:281)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:198)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
> {{ Low-level crap omitted for the sake of brevity. }}
> --------------------------------------------------------------------------------
> 
> 
> After tracing the execution through the source files, I managed to
> determine that when initorderentry doesn't find a ProductStore in the
> request, it looks for one in the WebSite, and since I don't have a
> WebSite with the ID "OrderEntry", it can't find one.
> 
> QUESTIONS:
> 
> 1) What is the significance of the WebSite-ProductStore association?
> 2) What should I consider when deciding which of my five ProductStores
> to associate with the WebSite "OrderEntry"?
> 3) I understand the need for a ProductStore when creating a Sales Order,
> but why do I need one when creating a Purchase Order?  If it's just to
> set a default Currency UOM, isn't there -- or shouldn't we find -- a
> better way to do this?  Alternately, why can't we just skip the default
> and set the Currency UOM on the next screen, where we already have a way
> to change it?
> 
> Thanks for the help!
> 
> --Nathan
> 
>