Hi,
I am trying to run the following 'calculateProductPrice' service, using the below code, but i am getting errors, i will appreciate if someone can help me understand where i might be making a mistake: try { GenericValue product = null; product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productid)); Map priceContext = FastMap.newInstance(); priceContext.put("product", product); priceContext.put("partyId", "admin"); priceContext.put("prodCatalogId", "DemoCatalog"); priceContext.put("webSiteId", "WebStore"); priceContext.put("productStoreId", "9000"); priceContext.put("quantity", "1"); priceContext.put("currencyUomId","USD"); priceContext.put("checkIncludeVat", "Y"); BigDecimal listPrice = BigDecimal.ZERO; Map priceResult = dispatcher.runSync("calculateProductPrice", priceContext); // this line does not work. if (ServiceUtil.isError(priceResult)) { System.out.println("There was an error while calculating the price: " + ServiceUtil.getErrorMessage(priceResult)); } } catch (Exception e) {} I have put the 'priceContext' in error log and it appears that the detials are passed to the service, still the service throws a runsync error. The error log is pasted below: 3. passed the var to service [product=[GenericEntity:Product][amountUomTypeId,nu ll()][autoCreateKeywords,null()][billOfMaterialLevel,null()][brandName,null()][c hargeShipping,null()][comments,null()][configId,null()][createdByUserLogin,null( )][createdDate,null()][createdStamp,2009-05-09 12:36:13.687(java.sql.Timestamp)] [createdTxStamp,2009-05-09 12:36:13.329(java.sql.Timestamp)][defaultShipmentBoxT ypeId,null()][depthUomId,null()][description,Heating/Cooling Unit.(java.lang.Str ing)][detailImageUrl,null()][detailScreen,null()][facilityId,null()][fixedAmount ,null()][heightUomId,null()][inShippingBox,null()][includeInPromotions,null()][i nternalName,Heating/Cooling Unit(java.lang.String)][introductionDate,null()][inv entoryMessage,null()][isVariant,null()][isVirtual,null()][largeImageUrl,null()][ lastModifiedByUserLogin,null()][lastModifiedDate,null()][lastUpdatedStamp,2009-0 5-09 12:36:13.687(java.sql.Timestamp)][lastUpdatedTxStamp,2009-05-09 12:36:13.32 9(java.sql.Timestamp)][longDescription,null()][manufacturerPartyId,null()][mediu mImageUrl,null()][originGeoId,null()][originalImageUrl,null()][piecesIncluded,nu ll()][priceDetailText,null()][primaryProductCategoryId,null()][productDepth,null ()][productHeight,null()][productId,HVAC_UNIT(java.lang.String)][productName,Hea ting/Cooling Unit(java.lang.String)][productRating,null()][productTypeId,ASSET_U SAGE(java.lang.String)][productWidth,null()][quantityIncluded,null()][quantityUo mId,null()][ratingTypeEnum,null()][requireAmount,null()][requireInventory,null() ][requirementMethodEnumId,null()][reserv2ndPPPerc,null()][reservMaxPersons,null( )][reservNthPPPerc,null()][returnable,null()][salesDiscWhenNotAvail,null()][sale sDiscontinuationDate,null()][shippingDepth,null()][shippingHeight,null()][shippi ngWidth,null()][smallImageUrl,null()][supportDiscontinuationDate,null()][taxable ,null()][virtualVariantMethodEnum,null()][weight,null()][weightUomId,null()][wid thUomId,null()], partyId=admin, prodCatalogId=DemoCatalog, webSiteId=WebStore, p roductStoreId=9000, quantity=1, currencyUomId=USD, checkIncludeVat=Y] now doing mapresult 1. service threw an error 2009-05-26 00:20:18,396 (default-invoker-Thread-11) [ ServiceDispatcher.java:50 3:INFO ] [[Sync service failed...- total:0.0,since last(Begin):0.0]] - 'JobDispa tcher / gexport' 2009-05-26 00:20:18,400 (default-invoker-Thread-11) [ ServiceDispatcher.java:50 6:ERROR] ---- exception report ---------------------------------------------------------- Service [gexport] threw an unexpected exception/error Exception: org.ofbiz.service.GenericServiceException Message: Service [gexport] did not return a Map object ---- stack trace --------------------------------------------------------------- org.ofbiz.service.GenericServiceException: Service [gexport] did not return a Ma p object org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:390) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:219) org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:159) org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:69) org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:240) java.lang.Thread.run(Thread.java:619) -------------------------------------------------------------------------------- 2009-05-26 00:20:18,400 (default-invoker-Thread-11) [ TransactionUtil.java:28 5:ERROR] ---- exception report ---------------------------------------------------------- [TransactionUtil.rollback] Exception: java.lang.Exception Message: Stack Trace ---- stack trace --------------------------------------------------------------- java.lang.Exception: Stack Trace org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:284) org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:266) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:509) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:219) org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:159) org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:69) org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:240) java.lang.Thread.run(Thread.java:619) -------------------------------------------------------------------------------- 2009-05-26 00:20:18,402 (default-invoker-Thread-11) [ TransactionUtil.java:29 5:INFO ] [TransactionUtil.rollback] transaction rolled back 2009-05-26 00:20:18,402 (default-invoker-Thread-11) [ TransactionUtil.java:21 9:WARN ] [TransactionUtil.commit] Not committing transaction, status is No Trans action (6) 2009-05-26 00:20:18,404 (default-invoker-Thread-9) [ ServiceDispatcher.java:503 :INFO ] [[Sync service failed...- total:0.0,since last(Begin):0.0]] - 'JobDispat cher / gexport' 2009-05-26 00:20:18,404 (default-invoker-Thread-9) [ ServiceDispatcher.java:506 :ERROR] ---- exception report ---------------------------------------------------------- Service [gexport] threw an unexpected exception/error Exception: org.ofbiz.service.GenericServiceException Message: Service [gexport] did not return a Map object ---- stack trace --------------------------------------------------------------- org.ofbiz.service.GenericServiceException: Service [gexport] did not return a Ma p object org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:390) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:219) org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:159) org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:69) org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:240) java.lang.Thread.run(Thread.java:619) -------------------------------------------------------------------------------- 2009-05-26 00:20:18,405 (default-invoker-Thread-9) [ TransactionUtil.java:285 :ERROR] |
I guess your service 'gexport' is the problem - not the
'calculateProductPrice'. 'gexport' must return a Map. Viele Grüße Best Regards Dimitri Unruh Consultant AEW Agrenon GmbH Johanniskirchplatz 6 33615 Bielefeld Deutschland Fon: +49 521 5247-0 Fax: +49 521 5247-250 Mobil: +49 160 90 57 55 13 Company and Management Headquarters: Agrenon GmbH, Johanniskirchplatz 6, 33615 Bielefeld, Deutschland, Fon: +49 521 5247-0, Fax: +49 521 5247-250, www.agrenon.com Court Registration: Amtsgericht Bielefeld HRB 36795 Chief Executive Officer: Dirk Osterkamp ---------------------------------------------------------------------------------------------------- This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation. ---------------------------------------------------------------------------------------------------- * |
Free forum by Nabble | Edit this page |