[ https://issues.apache.org/jira/browse/OFBIZ-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13941481#comment-13941481 ]
nguyenthang commented on OFBIZ-5587: ------------------------------------ thanks Jacopo! It work! But I think we should be create a message to informed this error for clearer and not confuse like that. If you interested in with message problem, discussed in this thread: http://ofbiz.135035.n4.nabble.com/Discussion-How-to-customize-messages-in-ofbiz-td4649370.html > Error when add product to sales order > ------------------------------------- > > Key: OFBIZ-5587 > URL: https://issues.apache.org/jira/browse/OFBIZ-5587 > Project: OFBiz > Issue Type: Bug > Components: order > Reporter: nguyenthang > Assignee: Jacopo Cappellato > > Error appear when add a product to sales order: > In form Order Items: > Method public java.util.List > org.ofbiz.entity.GenericValue.getRelated(java.lang.String,java.util.Map,java.util.List,boolean) > throws org.ofbiz.entity.GenericEntityException threw an exception when > invoked on > [GenericEntity:Product][amountUomTypeId,null()][autoCreateKeywords,null()][billOfMaterialLevel,0(java.lang.Long)][brandName,null()][chargeShipping,null()][comments,null()][configId,null()][createdByUserLogin,admin(java.lang.String)][createdDate,2014-03-13 > 11:32:21.0(java.sql.Timestamp)][createdStamp,2014-03-13 > 11:32:21.0(java.sql.Timestamp)][createdTxStamp,2014-03-13 > 11:32:21.0(java.sql.Timestamp)][defaultShipmentBoxTypeId,null()][depthUomId,null()][description,null()][detailImageUrl,null()][detailScreen,null()][diameterUomId,null()][facilityId,null()][fixedAmount,null()][heightUomId,null()][inShippingBox,N(java.lang.String)][includeInPromotions,null()][internalName,olbiusProduct(java.lang.String)][introductionDate,null()][inventoryMessage,null()][isVariant,N(java.lang.String)][isVirtual,N(java.lang.String)][largeImageUrl,null()][lastModifiedByUserLogin,admin(java.lang.String)][lastModifiedDate,2014-03-13 > 14:23:48.0(java.sql.Timestamp)][lastUpdatedStamp,2014-03-13 > 14:23:48.0(java.sql.Timestamp)][lastUpdatedTxStamp,2014-03-13 > 14:23:48.0(java.sql.Timestamp)][longDescription,null()][lotIdFilledIn,Allowed(java.lang.String)][manufacturerPartyId,null()][mediumImageUrl,null()][orderDecimalQuantity,null()][originGeoId,null()][originalImageUrl,null()][piecesIncluded,null()][priceDetailText,null()][primaryProductCategoryId,null()][productDepth,null()][productDiameter,null()][productHeight,null()][productId,olbiusTestProduct(java.lang.String)][productName,null()][productRating,3.000000(java.math.BigDecimal)][productTypeId,FINISHED_GOOD(java.lang.String)][productWeight,null()][productWidth,null()][quantityIncluded,null()][quantityUomId,null()][ratingTypeEnum,PRDR_MAX(java.lang.String)][releaseDate,null()][requireAmount,null()][requireInventory,null()][requirementMethodEnumId,null()][reserv2ndPPPerc,null()][reservMaxPersons,null()][reservNthPPPerc,null()][returnable,null()][salesDiscWhenNotAvail,null()][salesDiscontinuationDate,null()][shippingDepth,null()][shippingHeight,null()][shippingWidth,null()][smallImageUrl,null()][supportDiscontinuationDate,null()][taxable,null()][virtualVariantMethodEnum,null()][weight,null()][weightUomId,null()][widthUomId,null()] > with arguments of types > [java.lang.String,null,java.util.LinkedList,java.lang.Boolean,] The > problematic instruction: ---------- ==> assignment: > itemProductAssocList=cartLine.getProduct().getRelated("MainProductAssoc", > null, Static["org.ofbiz.base.util.UtilMisc"].toList("productAssocTypeId", > "sequenceNum"), false)?if_exists [on line 222, column 15 in > component://order/webapp/ordermgr/entry/cart/showcartitems.ftl] ---------- > Java backtrace for programmers: ---------- > freemarker.template.TemplateModelException: Method public java.util.List > org.ofbiz.entity.GenericValue.getRelated(java.lang.String,java.util.Map,java.util.List,boolean) > throws org.ofbiz.entity.GenericEntityException threw an exception when > invoked on > [GenericEntity:Product][amountUomTypeId,null()][autoCreateKeywords,null()][billOfMaterialLevel,0(java.lang.Long)][brandName,null()][chargeShipping,null()][comments,null()][configId,null()][createdByUserLogin,admin(java.lang.String)][createdDate,2014-03-13 > 11:32:21.0(java.sql.Timestamp)][createdStamp,2014-03-13 > 11:32:21.0(java.sql.Timestamp)][createdTxStamp,2014-03-13 > 11:32:21.0(java.sql.Timestamp)][defaultShipmentBoxTypeId,null()][depthUomId,null()][description,null()][detailImageUrl,null()][detailScreen,null()][diameterUomId,null()][facilityId,null()][fixedAmount,null()][heightUomId,null()][inShippingBox,N(java.lang.String)][includeInPromotions,null()][internalName,olbiusProduct(java.lang.String)][introductionDate,null()][inventoryMessage,null()][isVariant,N(java.lang.String)][isVirtual,N(java.lang.String)][largeImageUrl,null()][lastModifiedByUserLogin,admin(java.lang.String)][lastModifiedDate,2014-03-13 > 14:23:48.0(java.sql.Timestamp)][lastUpdatedStamp,2014-03-13 > 14:23:48.0(java.sql.Timestamp)][lastUpdatedTxStamp,2014-03-13 > 14:23:48.0(java.sql.Timestamp)][longDescription,null()][lotIdFilledIn,Allowed(java.lang.String)][manufacturerPartyId,null()][mediumImageUrl,null()][orderDecimalQuantity,null()][originGeoId,null()][originalImageUrl,null()][piecesIncluded,null()][priceDetailText,null()][primaryProductCategoryId,null()][productDepth,null()][productDiameter,null()][productHeight,null()][productId,olbiusTestProduct(java.lang.String)][productName,null()][productRating,3.000000(java.math.BigDecimal)][productTypeId,FINISHED_GOOD(java.lang.String)][productWeight,null()][productWidth,null()][quantityIncluded,null()][quantityUomId,null()][ratingTypeEnum,PRDR_MAX(java.lang.String)][releaseDate,null()][requireAmount,null()][requireInventory,null()][requirementMethodEnumId,null()][reserv2ndPPPerc,null()][reservMaxPersons,null()][reservNthPPPerc,null()][returnable,null()][salesDiscWhenNotAvail,null()][salesDiscontinuationDate,null()][shippingDepth,null()][shippingHeight,null()][shippingWidth,null()][smallImageUrl,null()][supportDiscontinuationDate,null()][taxable,null()][virtualVariantMethodEnum,null()][weight,null()][weightUomId,null()][widthUomId,null()] > with arguments of types > [java.lang.String,null,java.util.LinkedList,java.lang.Boolean,] at > freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:134) > at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at > freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at > freemarker.core.BuiltIn$if_existsBI._getAsTemplateModel(BuiltIn.java:751) at > freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at > freemarker.core.Assignment.accept(Assignment.java:90) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167) at > freemarker.core.Environment.visit(Environment.java:428) at > freemarker.core.IteratorBlock.accept(IteratorBlock.java:102) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.IfBlock.accept(IfBlock.java:82) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:221) at > freemarker.core.Environment.process(Environment.java:199) at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:251) > at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:224) at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString(HtmlWidget.java:269) > at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:129) at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString(ModelScreenWidget.java:1004) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString(ModelScreenWidget.java:702) > at > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render(ModelScreenWidget.java:133) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString(ModelScreenWidget.java:735) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString(ModelScreenWidget.java:702) > at > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render(ModelScreenWidget.java:133) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString(ModelScreenWidget.java:735) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:337) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString(ModelScreenWidget.java:337) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) > at > org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) > at > org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:602) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) > at > org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) > at > org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString(ModelScreenWidget.java:602) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) > at > org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:669) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) > at > org.ofbiz.widget.screen.ScreenFactory.renderReferencedScreen(ScreenFactory.java:216) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString(ModelScreenWidget.java:669) > at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:108) > at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:195) > at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:396) > at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:135) at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:97) at > org.ofbiz.widget.screen.MacroScreenViewHandler.render(MacroScreenViewHandler.java:104) > at > org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:978) > at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:679) > at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:639) > at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:214) at > org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:86) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:314) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) > at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) > at > org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) > at > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) > at > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:744) Caused by: > org.ofbiz.entity.transaction.GenericTransactionException: The current > transaction is marked for rollback, not beginning a new transaction and > aborting current operation; the rollbackOnly was caused by: Error in > simple-method [Is Store Inventory Available > [file:/home/nguyenthang/Documents/work/DEV/OlbiusOFBiz/ofbiz_src/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml#isStoreInventoryAvailable]]: > ; [ProductStore with id has Y for oneInventoryFacility but > inventoryFacilityId is empty, not checking available inventory.] at > org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:156) > at > org.ofbiz.entity.transaction.TransactionUtil.begin(TransactionUtil.java:124) > at org.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1791) at > org.ofbiz.entity.GenericDelegator.findByAnd(GenericDelegator.java:1729) at > org.ofbiz.entity.GenericDelegator.getRelated(GenericDelegator.java:1964) at > org.ofbiz.entity.GenericValue.getRelated(GenericValue.java:146) at > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) at > freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:888) at > freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:104) > ... 94 more -- This message was sent by Atlassian JIRA (v6.2#6252)