add order question

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

add order question

jjmbconquista
i am trying create an Order with the statements below:

    public static Map createSalesOrder(DispatchContext dctx, Map context)
    {
       
        Debug.logInfo("Running method MLOrderServices.createSalesOrder", module);
        try{
            LocalDispatcher dispatcher = dctx.getDispatcher();
            GenericDelegator delegator = dctx.getDelegator();
            String partyId=(String)context.get("partyId");
            String productId=(String)context.get("productId");
            Double quantity=(Double)context.get("quantity");
            Double unitPrice=(Double)context.get("unitPrice");
            String entryDate=(String)context.get("entryDate");
            String contacMech=(String)context.get("contacMech");
            GenericValue userLogin=(GenericValue)context.get("userLogin");
            Map result = null;
           
            Map ctx = UtilMisc.toMap("partyId", partyId, "orderTypeId", "SALES_ORDER", "currencyUom", "BRL", "productStoreId", "9000");
            List orderContactMechs = new ArrayList();
            GenericValue orderContactMech = delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechId", contacMech, "contactMechPurposeTypeId", "ORDER_EMAIL"));
            orderContactMechs.add(orderContactMech);
            ctx.put("orderContactMechs", orderContactMechs);
           
            List orderItems = new ArrayList();
            GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemTypeId", "PRODUCT_ORDER_ITEM", "productId", "GZ-1000", "quantity", quantity, "selectedAmount", new Double(0.0)));
            orderItem.set("isPromo", "N");
            orderItem.set("isModifiedPrice", "N");
            orderItem.set("unitPrice", unitPrice);
            orderItem.set("statusId", "ITEM_CREATED");
           
            orderItems.add(orderItem);
            ctx.put("orderItems", orderItems);
           // ctx.put("BillToCustomerPartyId", partyId);
            //ctx.put("shipToCustomerPartyId", partyId);
            ctx.put("orderName", partyId);
          
            List <GenericValue> orderTerms = FastList.newInstance();
            ctx.put("orderTerms", orderTerms);
                   
            List <GenericValue> orderAdjustments = FastList.newInstance();
            ctx.put("orderAdjustments", orderAdjustments);

            ctx.put("userLogin", userLogin);
           
           
            Debug.logInfo("Creating order...", module);
             result = dispatcher.runSync("storeOrder",ctx);
}

and get the error:

2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [     OrderProcessor.java:123:INFO ] Creating order...
2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:28 :INFO ] Running method MLOrderServices.createSalesOrder
2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:73 :INFO ] Creating order...
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:294:WARN ]
---- exception report ----------------------------------------------------------
[TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
Exception: java.lang.Exception
Message: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:294)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:241)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:426)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:74)
org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:470:DEBUG] Sync service [pedido/storeOrder] finished in [62] milliseconds
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:81 :ERROR] Problem during the creation of orderBean
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:89 :ERROR]
---- exception report ----------------------------------------------------------
Failed of Auth to createOrder:
Exception: org.ofbiz.entity.GenericEntityException
Message: Problem during the creation of orderBean
---- stack trace ---------------------------------------------------------------
org.ofbiz.entity.GenericEntityException: Problem during the creation of orderBean
org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:82)
org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:76 :INFO ] tytryr3-------------
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:84 :INFO ] Done run method Integrator.processUreadEmailsFromSite
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:203:ERROR]
---- exception report ----------------------------------------------------------
Rollback Only was set when trying to commit transaction here; throwing rollbackOnly cause exception
Exception: javax.transaction.RollbackException
Message: null
---- stack trace ---------------------------------------------------------------
javax.transaction.RollbackException
org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:82)
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:182)
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:436:ERROR]
---- exception report ----------------------------------------------------------
Could not commit transaction for service [importEmaisFromSite] call
Exception: org.ofbiz.entity.transaction.GenericTransactionException
Message: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
---- stack trace ---------------------------------------------------------------
org.ofbiz.entity.transaction.GenericTransactionException: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:204)
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,379 (http-0.0.0.0-8080-Processor3) [ServiceEventHandler.java:326:ERROR]
---- exception report ----------------------------------------------------------
Service invocation error
Exception: org.ofbiz.service.GenericServiceException
Message: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
---- stack trace ---------------------------------------------------------------
org.ofbiz.service.GenericServiceException: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:440)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
-----

someone have idea?

thanks, jjmbconquista



      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
Reply | Threaded
Open this post in threaded view
|

Re: add order question

BJ Freeman

Take a look at the ebay getorders for some Idea about how to handle and
external order.
also good if you read the log is has most of the answers
>  2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:294:WARN ]
>>



jose junior malheiros barros sent the following on 8/6/2008 2:21 PM:

> i am trying create an Order with the statements below:
>
>     public static Map createSalesOrder(DispatchContext dctx, Map context)
>     {
>        
>         Debug.logInfo("Running method MLOrderServices.createSalesOrder", module);
>         try{
>             LocalDispatcher dispatcher = dctx.getDispatcher();
>             GenericDelegator delegator = dctx.getDelegator();
>             String partyId=(String)context.get("partyId");
>             String productId=(String)context.get("productId");
>             Double quantity=(Double)context.get("quantity");
>             Double unitPrice=(Double)context.get("unitPrice");
>             String entryDate=(String)context.get("entryDate");
>             String contacMech=(String)context.get("contacMech");
>             GenericValue userLogin=(GenericValue)context.get("userLogin");
>             Map result = null;
>            
>             Map ctx = UtilMisc.toMap("partyId", partyId, "orderTypeId", "SALES_ORDER", "currencyUom", "BRL", "productStoreId", "9000");
>             List orderContactMechs = new ArrayList();
>             GenericValue orderContactMech = delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechId", contacMech, "contactMechPurposeTypeId", "ORDER_EMAIL"));
>             orderContactMechs.add(orderContactMech);
>             ctx.put("orderContactMechs", orderContactMechs);
>            
>             List orderItems = new ArrayList();
>             GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemTypeId", "PRODUCT_ORDER_ITEM", "productId", "GZ-1000", "quantity", quantity, "selectedAmount", new Double(0.0)));
>             orderItem.set("isPromo", "N");
>             orderItem.set("isModifiedPrice", "N");
>             orderItem.set("unitPrice", unitPrice);
>             orderItem.set("statusId", "ITEM_CREATED");
>            
>             orderItems.add(orderItem);
>             ctx.put("orderItems", orderItems);
>            // ctx.put("BillToCustomerPartyId", partyId);
>             //ctx.put("shipToCustomerPartyId", partyId);
>             ctx.put("orderName", partyId);
>            
>             List <GenericValue> orderTerms = FastList.newInstance();
>             ctx.put("orderTerms", orderTerms);
>                    
>             List <GenericValue> orderAdjustments = FastList.newInstance();
>             ctx.put("orderAdjustments", orderAdjustments);
>
>             ctx.put("userLogin", userLogin);
>            
>            
>             Debug.logInfo("Creating order...", module);
>              result = dispatcher.runSync("storeOrder",ctx);
> }
>
> and get the error:
>
> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [     OrderProcessor.java:123:INFO ] Creating order...
> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:28 :INFO ] Running method MLOrderServices.createSalesOrder
> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:73 :INFO ] Creating order...
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:294:WARN ]
> ---- exception report ----------------------------------------------------------
> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
> Exception: java.lang.Exception
> Message: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> ---- stack trace ---------------------------------------------------------------
> java.lang.Exception: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:294)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:241)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:426)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
> org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:74)
> org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
> org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
> org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
> org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> java.lang.reflect.Method.invoke(Unknown Source)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> java.lang.Thread.run(Unknown Source)
> --------------------------------------------------------------------------------
>
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:470:DEBUG] Sync service [pedido/storeOrder] finished in [62] milliseconds
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:81 :ERROR] Problem during the creation of orderBean
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:89 :ERROR]
> ---- exception report ----------------------------------------------------------
> Failed of Auth to createOrder:
> Exception: org.ofbiz.entity.GenericEntityException
> Message: Problem during the creation of orderBean
> ---- stack trace ---------------------------------------------------------------
> org.ofbiz.entity.GenericEntityException: Problem during the creation of orderBean
> org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:82)
> org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
> org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
> org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
> org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> java.lang.reflect.Method.invoke(Unknown Source)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> java.lang.Thread.run(Unknown Source)
> --------------------------------------------------------------------------------
>
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:76 :INFO ] tytryr3-------------
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:84 :INFO ] Done run method Integrator.processUreadEmailsFromSite
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:203:ERROR]
> ---- exception report ----------------------------------------------------------
> Rollback Only was set when trying to commit transaction here; throwing rollbackOnly cause exception
> Exception: javax.transaction.RollbackException
> Message: null
> ---- stack trace ---------------------------------------------------------------
> javax.transaction.RollbackException
> org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:82)
> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:182)
> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> java.lang.Thread.run(Unknown Source)
> --------------------------------------------------------------------------------
>
> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:436:ERROR]
> ---- exception report ----------------------------------------------------------
> Could not commit transaction for service [importEmaisFromSite] call
> Exception: org.ofbiz.entity.transaction.GenericTransactionException
> Message: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> ---- stack trace ---------------------------------------------------------------
> org.ofbiz.entity.transaction.GenericTransactionException: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:204)
> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> java.lang.Thread.run(Unknown Source)
> --------------------------------------------------------------------------------
>
> 2008-08-06 18:13:20,379 (http-0.0.0.0-8080-Processor3) [ServiceEventHandler.java:326:ERROR]
> ---- exception report ----------------------------------------------------------
> Service invocation error
> Exception: org.ofbiz.service.GenericServiceException
> Message: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> ---- stack trace ---------------------------------------------------------------
> org.ofbiz.service.GenericServiceException: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:440)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> java.lang.Thread.run(Unknown Source)
> -----
>
> someone have idea?
>
> thanks, jjmbconquista
>
>
>
>       Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
> http://br.new.mail.yahoo.com/addresses


Reply | Threaded
Open this post in threaded view
|

Re: add order question

BJ Freeman
also it would be simpler, IMHO, if you used the email container
then used and mca to send the email to your service.
if you look at the
application/content/src/org/ofbiz/content/mail
you will get some ideas on how to intercept mail and process it.
that can then call the routines to parse the email and create orders.

just my 2 cents.

BJ Freeman sent the following on 8/6/2008 2:32 PM:

> Take a look at the ebay getorders for some Idea about how to handle and
> external order.
> also good if you read the log is has most of the answers
>>  2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:294:WARN ]
>>>
>
>
>
> jose junior malheiros barros sent the following on 8/6/2008 2:21 PM:
>> i am trying create an Order with the statements below:
>>
>>     public static Map createSalesOrder(DispatchContext dctx, Map context)
>>     {
>>        
>>         Debug.logInfo("Running method MLOrderServices.createSalesOrder", module);
>>         try{
>>             LocalDispatcher dispatcher = dctx.getDispatcher();
>>             GenericDelegator delegator = dctx.getDelegator();
>>             String partyId=(String)context.get("partyId");
>>             String productId=(String)context.get("productId");
>>             Double quantity=(Double)context.get("quantity");
>>             Double unitPrice=(Double)context.get("unitPrice");
>>             String entryDate=(String)context.get("entryDate");
>>             String contacMech=(String)context.get("contacMech");
>>             GenericValue userLogin=(GenericValue)context.get("userLogin");
>>             Map result = null;
>>            
>>             Map ctx = UtilMisc.toMap("partyId", partyId, "orderTypeId", "SALES_ORDER", "currencyUom", "BRL", "productStoreId", "9000");
>>             List orderContactMechs = new ArrayList();
>>             GenericValue orderContactMech = delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechId", contacMech, "contactMechPurposeTypeId", "ORDER_EMAIL"));
>>             orderContactMechs.add(orderContactMech);
>>             ctx.put("orderContactMechs", orderContactMechs);
>>            
>>             List orderItems = new ArrayList();
>>             GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemTypeId", "PRODUCT_ORDER_ITEM", "productId", "GZ-1000", "quantity", quantity, "selectedAmount", new Double(0.0)));
>>             orderItem.set("isPromo", "N");
>>             orderItem.set("isModifiedPrice", "N");
>>             orderItem.set("unitPrice", unitPrice);
>>             orderItem.set("statusId", "ITEM_CREATED");
>>            
>>             orderItems.add(orderItem);
>>             ctx.put("orderItems", orderItems);
>>            // ctx.put("BillToCustomerPartyId", partyId);
>>             //ctx.put("shipToCustomerPartyId", partyId);
>>             ctx.put("orderName", partyId);
>>            
>>             List <GenericValue> orderTerms = FastList.newInstance();
>>             ctx.put("orderTerms", orderTerms);
>>                    
>>             List <GenericValue> orderAdjustments = FastList.newInstance();
>>             ctx.put("orderAdjustments", orderAdjustments);
>>
>>             ctx.put("userLogin", userLogin);
>>            
>>            
>>             Debug.logInfo("Creating order...", module);
>>              result = dispatcher.runSync("storeOrder",ctx);
>> }
>>
>> and get the error:
>>
>> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [     OrderProcessor.java:123:INFO ] Creating order...
>> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:28 :INFO ] Running method MLOrderServices.createSalesOrder
>> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:73 :INFO ] Creating order...
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:294:WARN ]
>> ---- exception report ----------------------------------------------------------
>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
>> Exception: java.lang.Exception
>> Message: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> ---- stack trace ---------------------------------------------------------------
>> java.lang.Exception: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:294)
>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:241)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:426)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:74)
>> org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
>> org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
>> org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
>> org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> java.lang.reflect.Method.invoke(Unknown Source)
>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:470:DEBUG] Sync service [pedido/storeOrder] finished in [62] milliseconds
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:81 :ERROR] Problem during the creation of orderBean
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:89 :ERROR]
>> ---- exception report ----------------------------------------------------------
>> Failed of Auth to createOrder:
>> Exception: org.ofbiz.entity.GenericEntityException
>> Message: Problem during the creation of orderBean
>> ---- stack trace ---------------------------------------------------------------
>> org.ofbiz.entity.GenericEntityException: Problem during the creation of orderBean
>> org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:82)
>> org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
>> org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
>> org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
>> org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> java.lang.reflect.Method.invoke(Unknown Source)
>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:76 :INFO ] tytryr3-------------
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:84 :INFO ] Done run method Integrator.processUreadEmailsFromSite
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:203:ERROR]
>> ---- exception report ----------------------------------------------------------
>> Rollback Only was set when trying to commit transaction here; throwing rollbackOnly cause exception
>> Exception: javax.transaction.RollbackException
>> Message: null
>> ---- stack trace ---------------------------------------------------------------
>> javax.transaction.RollbackException
>> org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:82)
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:182)
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:436:ERROR]
>> ---- exception report ----------------------------------------------------------
>> Could not commit transaction for service [importEmaisFromSite] call
>> Exception: org.ofbiz.entity.transaction.GenericTransactionException
>> Message: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> ---- stack trace ---------------------------------------------------------------
>> org.ofbiz.entity.transaction.GenericTransactionException: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:204)
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,379 (http-0.0.0.0-8080-Processor3) [ServiceEventHandler.java:326:ERROR]
>> ---- exception report ----------------------------------------------------------
>> Service invocation error
>> Exception: org.ofbiz.service.GenericServiceException
>> Message: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> ---- stack trace ---------------------------------------------------------------
>> org.ofbiz.service.GenericServiceException: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:440)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> -----
>>
>> someone have idea?
>>
>> thanks, jjmbconquista
>>
>>
>>
>>       Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
>> http://br.new.mail.yahoo.com/addresses
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: add order question

Bilgin Ibryam
In reply to this post by jjmbconquista
On Wed, 2008-08-06 at 14:21 -0700, jose junior malheiros barros wrote:
> someone have idea?
>
> thanks, jjmbconquista
>

Hi,

You have to set also orderItemSeqid field. Something like this:

 orderItem.set("statusId", "ITEM_CREATED");
 delegator.setNextSubSeqId(orderItem, "orderItemSeqId", 5, 1);
 orderItems.add(orderItem);

Bilgin

Reply | Threaded
Open this post in threaded view
|

Re: add order question

jjmbconquista
Thanks Bilgin, I will try
--- Em qui, 7/8/08, Bilgin Ibryam <[hidden email]> escreveu:
De: Bilgin Ibryam <[hidden email]>
Assunto: Re: add order question
Para: [hidden email]
Cc: [hidden email]
Data: Quinta-feira, 7 de Agosto de 2008, 5:11

On Wed, 2008-08-06 at 14:21 -0700, jose junior malheiros barros wrote:
> someone have idea?
>
> thanks, jjmbconquista
>

Hi,

You have to set also orderItemSeqid field. Something like this:

 orderItem.set("statusId", "ITEM_CREATED");
 delegator.setNextSubSeqId(orderItem, "orderItemSeqId", 5, 1);
 orderItems.add(orderItem);

Bilgin




      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
Reply | Threaded
Open this post in threaded view
|

Re: add order question

jjmbconquista
In reply to this post by jjmbconquista
Someone have some tutorial that can help me to create an Order? Is very hard to find some documentation about ofbiz!
jjmbconquista wrote
i am trying create an Order with the statements below:

    public static Map createSalesOrder(DispatchContext dctx, Map context)
    {
       
        Debug.logInfo("Running method MLOrderServices.createSalesOrder", module);
        try{
            LocalDispatcher dispatcher = dctx.getDispatcher();
            GenericDelegator delegator = dctx.getDelegator();
            String partyId=(String)context.get("partyId");
            String productId=(String)context.get("productId");
            Double quantity=(Double)context.get("quantity");
            Double unitPrice=(Double)context.get("unitPrice");
            String entryDate=(String)context.get("entryDate");
            String contacMech=(String)context.get("contacMech");
            GenericValue userLogin=(GenericValue)context.get("userLogin");
            Map result = null;
           
            Map ctx = UtilMisc.toMap("partyId", partyId, "orderTypeId", "SALES_ORDER", "currencyUom", "BRL", "productStoreId", "9000");
            List orderContactMechs = new ArrayList();
            GenericValue orderContactMech = delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechId", contacMech, "contactMechPurposeTypeId", "ORDER_EMAIL"));
            orderContactMechs.add(orderContactMech);
            ctx.put("orderContactMechs", orderContactMechs);
           
            List orderItems = new ArrayList();
            GenericValue orderItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemTypeId", "PRODUCT_ORDER_ITEM", "productId", "GZ-1000", "quantity", quantity, "selectedAmount", new Double(0.0)));
            orderItem.set("isPromo", "N");
            orderItem.set("isModifiedPrice", "N");
            orderItem.set("unitPrice", unitPrice);
            orderItem.set("statusId", "ITEM_CREATED");
           
            orderItems.add(orderItem);
            ctx.put("orderItems", orderItems);
           // ctx.put("BillToCustomerPartyId", partyId);
            //ctx.put("shipToCustomerPartyId", partyId);
            ctx.put("orderName", partyId);
          
            List <GenericValue> orderTerms = FastList.newInstance();
            ctx.put("orderTerms", orderTerms);
                   
            List <GenericValue> orderAdjustments = FastList.newInstance();
            ctx.put("orderAdjustments", orderAdjustments);

            ctx.put("userLogin", userLogin);
           
           
            Debug.logInfo("Creating order...", module);
             result = dispatcher.runSync("storeOrder",ctx);
}

and get the error:

2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [     OrderProcessor.java:123:INFO ] Creating order...
2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:28 :INFO ] Running method MLOrderServices.createSalesOrder
2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:73 :INFO ] Creating order...
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:294:WARN ]
---- exception report ----------------------------------------------------------
[TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
Exception: java.lang.Exception
Message: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:294)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:241)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:426)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:74)
org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:470:DEBUG] Sync service [pedido/storeOrder] finished in [62] milliseconds
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:81 :ERROR] Problem during the creation of orderBean
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    MLOrderServices.java:89 :ERROR]
---- exception report ----------------------------------------------------------
Failed of Auth to createOrder:
Exception: org.ofbiz.entity.GenericEntityException
Message: Problem during the creation of orderBean
---- stack trace ---------------------------------------------------------------
org.ofbiz.entity.GenericEntityException: Problem during the creation of orderBean
org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:82)
org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:76 :INFO ] tytryr3-------------
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [         Integrator.java:84 :INFO ] Done run method Integrator.processUreadEmailsFromSite
2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [    TransactionUtil.java:203:ERROR]
---- exception report ----------------------------------------------------------
Rollback Only was set when trying to commit transaction here; throwing rollbackOnly cause exception
Exception: javax.transaction.RollbackException
Message: null
---- stack trace ---------------------------------------------------------------
javax.transaction.RollbackException
org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:82)
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:182)
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  ServiceDispatcher.java:436:ERROR]
---- exception report ----------------------------------------------------------
Could not commit transaction for service [importEmaisFromSite] call
Exception: org.ofbiz.entity.transaction.GenericTransactionException
Message: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
---- stack trace ---------------------------------------------------------------
org.ofbiz.entity.transaction.GenericTransactionException: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:204)
org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------

2008-08-06 18:13:20,379 (http-0.0.0.0-8080-Processor3) [ServiceEventHandler.java:326:ERROR]
---- exception report ----------------------------------------------------------
Service invocation error
Exception: org.ofbiz.service.GenericServiceException
Message: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
---- stack trace ---------------------------------------------------------------
org.ofbiz.service.GenericServiceException: Could not commit transaction for service [importEmaisFromSite] call: Roll back error, could not commit transaction, was rolled back instead because of: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:440)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)
-----

someone have idea?

thanks, jjmbconquista



      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses
Reply | Threaded
Open this post in threaded view
|

Re: add order question

BJ Freeman
The only documentation is the code.
seen how a order is processed in the ecommerce section or ebay get orders.
you can also look in the order module for create Order from a Order
entry screen.

jjmbconquista sent the following on 8/7/2008 5:30 AM:

> Someone have some tutorial that can help me to create an Order? Is very hard
> to find some documentation about ofbiz!
>
> jjmbconquista wrote:
>> i am trying create an Order with the statements below:
>>
>>     public static Map createSalesOrder(DispatchContext dctx, Map context)
>>     {
>>        
>>         Debug.logInfo("Running method MLOrderServices.createSalesOrder",
>> module);
>>         try{
>>             LocalDispatcher dispatcher = dctx.getDispatcher();
>>             GenericDelegator delegator = dctx.getDelegator();
>>             String partyId=(String)context.get("partyId");
>>             String productId=(String)context.get("productId");
>>             Double quantity=(Double)context.get("quantity");
>>             Double unitPrice=(Double)context.get("unitPrice");
>>             String entryDate=(String)context.get("entryDate");
>>             String contacMech=(String)context.get("contacMech");
>>             GenericValue userLogin=(GenericValue)context.get("userLogin");
>>             Map result = null;
>>            
>>             Map ctx = UtilMisc.toMap("partyId", partyId, "orderTypeId",
>> "SALES_ORDER", "currencyUom", "BRL", "productStoreId", "9000");
>>             List orderContactMechs = new ArrayList();
>>             GenericValue orderContactMech =
>> delegator.makeValue("OrderContactMech", UtilMisc.toMap("contactMechId",
>> contacMech, "contactMechPurposeTypeId", "ORDER_EMAIL"));
>>             orderContactMechs.add(orderContactMech);
>>             ctx.put("orderContactMechs", orderContactMechs);
>>            
>>             List orderItems = new ArrayList();
>>             GenericValue orderItem = delegator.makeValue("OrderItem",
>> UtilMisc.toMap("orderItemTypeId", "PRODUCT_ORDER_ITEM", "productId",
>> "GZ-1000", "quantity", quantity, "selectedAmount", new Double(0.0)));
>>             orderItem.set("isPromo", "N");
>>             orderItem.set("isModifiedPrice", "N");
>>             orderItem.set("unitPrice", unitPrice);
>>             orderItem.set("statusId", "ITEM_CREATED");
>>            
>>             orderItems.add(orderItem);
>>             ctx.put("orderItems", orderItems);
>>            // ctx.put("BillToCustomerPartyId", partyId);
>>             //ctx.put("shipToCustomerPartyId", partyId);
>>             ctx.put("orderName", partyId);
>>            
>>             List <GenericValue> orderTerms = FastList.newInstance();
>>             ctx.put("orderTerms", orderTerms);
>>                    
>>             List <GenericValue> orderAdjustments = FastList.newInstance();
>>             ctx.put("orderAdjustments", orderAdjustments);
>>
>>             ctx.put("userLogin", userLogin);
>>            
>>            
>>             Debug.logInfo("Creating order...", module);
>>              result = dispatcher.runSync("storeOrder",ctx);
>> }
>>
>> and get the error:
>>
>> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [    
>> OrderProcessor.java:123:INFO ] Creating order...
>> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [  
>> MLOrderServices.java:28 :INFO ] Running method
>> MLOrderServices.createSalesOrder
>> 2008-08-06 18:13:20,302 (http-0.0.0.0-8080-Processor3) [  
>> MLOrderServices.java:73 :INFO ] Creating order...
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [
>> ServiceDispatcher.java:422:ERROR] Service Error [storeOrder]: ERROR:
>> Cannot get orderItemSeqId, got NULL
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  
>> TransactionUtil.java:294:WARN ]
>> ---- exception report
>> ----------------------------------------------------------
>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>> this stack trace shows where this is happening:
>> Exception: java.lang.Exception
>> Message: Service Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got
>> NULL
>> ---- stack trace
>> ---------------------------------------------------------------
>> java.lang.Exception: Service Error [storeOrder]: ERROR: Cannot get
>> orderItemSeqId, got NULL
>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:294)
>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:241)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:426)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:74)
>> org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
>> org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
>> org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
>> org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> java.lang.reflect.Method.invoke(Unknown Source)
>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [
>> ServiceDispatcher.java:470:DEBUG] Sync service [pedido/storeOrder]
>> finished in [62] milliseconds
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  
>> MLOrderServices.java:81 :ERROR] Problem during the creation of orderBean
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  
>> MLOrderServices.java:89 :ERROR]
>> ---- exception report
>> ----------------------------------------------------------
>> Failed of Auth to createOrder:
>> Exception: org.ofbiz.entity.GenericEntityException
>> Message: Problem during the creation of orderBean
>> ---- stack trace
>> ---------------------------------------------------------------
>> org.ofbiz.entity.GenericEntityException: Problem during the creation of
>> orderBean
>> org.ofbiz.mercadolivre.orders.MLOrderServices.createSalesOrder(MLOrderServices.java:82)
>> org.ofbiz.mercadolivre.manager.OrderProcessor.execute(OrderProcessor.java:124)
>> org.ofbiz.mercadolivre.manager.Integrator.processMessenger(Integrator.java:108)
>> org.ofbiz.mercadolivre.manager.Integrator.processEmail(Integrator.java:144)
>> org.ofbiz.mercadolivre.manager.Integrator.processUreadEmailsFromSite(Integrator.java:74)
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> java.lang.reflect.Method.invoke(Unknown Source)
>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:94)
>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:56)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:347)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [        
>> Integrator.java:76 :INFO ] tytryr3-------------
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [        
>> Integrator.java:84 :INFO ] Done run method
>> Integrator.processUreadEmailsFromSite
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [  
>> TransactionUtil.java:203:ERROR]
>> ---- exception report
>> ----------------------------------------------------------
>> Rollback Only was set when trying to commit transaction here; throwing
>> rollbackOnly cause exception
>> Exception: javax.transaction.RollbackException
>> Message: null
>> ---- stack trace
>> ---------------------------------------------------------------
>> javax.transaction.RollbackException
>> org.apache.geronimo.transaction.context.GeronimoTransactionManager.commit(GeronimoTransactionManager.java:82)
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:182)
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,364 (http-0.0.0.0-8080-Processor3) [
>> ServiceDispatcher.java:436:ERROR]
>> ---- exception report
>> ----------------------------------------------------------
>> Could not commit transaction for service [importEmaisFromSite] call
>> Exception: org.ofbiz.entity.transaction.GenericTransactionException
>> Message: Roll back error, could not commit transaction, was rolled back
>> instead because of: Service Error [storeOrder]: ERROR: Cannot get
>> orderItemSeqId, got NULL
>> ---- stack trace
>> ---------------------------------------------------------------
>> org.ofbiz.entity.transaction.GenericTransactionException: Roll back error,
>> could not commit transaction, was rolled back instead because of: Service
>> Error [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:204)
>> org.ofbiz.entity.transaction.TransactionUtil.commit(TransactionUtil.java:168)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:433)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> --------------------------------------------------------------------------------
>>
>> 2008-08-06 18:13:20,379 (http-0.0.0.0-8080-Processor3)
>> [ServiceEventHandler.java:326:ERROR]
>> ---- exception report
>> ----------------------------------------------------------
>> Service invocation error
>> Exception: org.ofbiz.service.GenericServiceException
>> Message: Could not commit transaction for service [importEmaisFromSite]
>> call: Roll back error, could not commit transaction, was rolled back
>> instead because of: Service Error [storeOrder]: ERROR: Cannot get
>> orderItemSeqId, got NULL
>> ---- stack trace
>> ---------------------------------------------------------------
>> org.ofbiz.service.GenericServiceException: Could not commit transaction
>> for service [importEmaisFromSite] call: Roll back error, could not commit
>> transaction, was rolled back instead because of: Service Error
>> [storeOrder]: ERROR: Cannot get orderItemSeqId, got NULL
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:440)
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:214)
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:152)
>> org.ofbiz.webapp.event.ServiceEventHandler.invoke(ServiceEventHandler.java:310)
>> org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:448)
>> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:277)
>> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:192)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:251)
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>> java.lang.Thread.run(Unknown Source)
>> -----
>>
>> someone have idea?
>>
>> thanks, jjmbconquista
>>
>>
>>
>>       Novos endereços, o Yahoo! que você conhece. Crie um email novo com a
>> sua cara @ymail.com ou @rocketmail.com.
>> http://br.new.mail.yahoo.com/addresses
>>
>