Error while creating a new product


#1

Hi,
I am trying the demo website. When I try to create a product, it throws the following error:

The Following Errors Occurred:

Exception thrown while creating the “newEntity” GenericValue: org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:Product][amountUomTypeId,null()][billOfMaterialLevel,0(java.lang.Long)][brandName,Sherwani(java.lang.String)][chargeShipping,N(java.lang.String)][comments,null()][createdByUserLogin,admin(java.lang.String)][createdDate,2018-09-11 15:31:21.517(java.sql.Timestamp)][createdStamp,2018-09-11 15:31:21.517(java.sql.Timestamp)][createdTxStamp,2018-09-11 15:31:21.516(java.sql.Timestamp)][defaultShipmentBoxTypeId,null()][depthUomId,null()][diameterUomId,null()][heightUomId,null()][inShippingBox,N(java.lang.String)][includeInPromotions,N(java.lang.String)][internalName,Sherwani(java.lang.String)][introductionDate,null()][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][inventoryMessage,null()][isVariant,N(java.lang.String)][isVirtual,Y(java.lang.String)][lastModifiedByUserLogin,admin(java.lang.String)][lastModifiedDate,2018-09-11 15:31:21.517(java.sql.Timestamp)][lastUpdatedStamp,2018-09-11 15:31:21.517(java.sql.Timestamp)][lastUpdatedTxStamp,2018-09-11 15:31:21.516(java.sql.Timestamp)][lotIdFilledIn,Allowed(java.lang.String)][manufacturerPartyId,OEMUSERID(java.lang.String)][orderDecimalQuantity,N(java.lang.String)][piecesIncluded,null()][primaryProductCategoryId,null()][productDepth,null()][productDiameter,null()][productHeight,null()][productId,10002(java.lang.String)][productName,Sherwani(java.lang.String)][productRating,null()][productTypeId,FINISHED_GOOD(java.lang.String)][productWeight,null()][productWidth,null()][quantityIncluded,null()][quantityUomId,null()][ratingTypeEnum,null()][releaseDate,null()][requireAmount,N(java.lang.String)][requireInventory,N(java.lang.String)][requirementMethodEnumId,null()][returnable,N(java.lang.String)][salesDiscWhenNotAvail,N(java.lang.String)][salesDiscontinuationDate,null()][supportDiscontinuationDate,null()][taxable,N(java.lang.String)][weightUomId,null()][widthUomId,null()] (SQL Exception while executing the following:INSERT INTO OFBIZ.PRODUCT (PRODUCT_ID, PRODUCT_TYPE_ID, PRIMARY_PRODUCT_CATEGORY_ID, MANUFACTURER_PARTY_ID, FACILITY_ID, INTRODUCTION_DATE, RELEASE_DATE, SUPPORT_DISCONTINUATION_DATE, SALES_DISCONTINUATION_DATE, SALES_DISC_WHEN_NOT_AVAIL, INTERNAL_NAME, BRAND_NAME, COMMENTS, PRODUCT_NAME, DESCRIPTION, LONG_DESCRIPTION, PRICE_DETAIL_TEXT, SMALL_IMAGE_URL, MEDIUM_IMAGE_URL, LARGE_IMAGE_URL, DETAIL_IMAGE_URL, ORIGINAL_IMAGE_URL, DETAIL_SCREEN, INVENTORY_MESSAGE, REQUIRE_INVENTORY, INVENTORY_ITEM_TYPE_ID, QUANTITY_UOM_ID, QUANTITY_INCLUDED, PIECES_INCLUDED, REQUIRE_AMOUNT, FIXED_AMOUNT, AMOUNT_UOM_TYPE_ID, WEIGHT_UOM_ID, WEIGHT, PRODUCT_WEIGHT, HEIGHT_UOM_ID, PRODUCT_HEIGHT, SHIPPING_HEIGHT, WIDTH_UOM_ID, PRODUCT_WIDTH, SHIPPING_WIDTH, DEPTH_UOM_ID, PRODUCT_DEPTH, SHIPPING_DEPTH, DIAMETER_UOM_ID, PRODUCT_DIAMETER, PRODUCT_RATING, RATING_TYPE_ENUM, RETURNABLE, TAXABLE, CHARGE_SHIPPING, AUTO_CREATE_KEYWORDS, INCLUDE_IN_PROMOTIONS, IS_VIRTUAL, IS_VARIANT, VIRTUAL_VARIANT_METHOD_ENUM, ORIGIN_GEO_ID, REQUIREMENT_METHOD_ENUM_ID, BILL_OF_MATERIAL_LEVEL, RESERV_MAX_PERSONS, RESERV2ND_P_P_PERC, RESERV_NTH_P_P_PERC, CONFIG_ID, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, IN_SHIPPING_BOX, DEFAULT_SHIPMENT_BOX_TYPE_ID, LOT_ID_FILLED_IN, ORDER_DECIMAL_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table ‘PRODUCT’ caused a violation of foreign key constraint ‘PROD_MFG_PARTY’ for key (OEMUSERID). The statement has been rolled back.)) (Error while inserting: [GenericEntity:Product][amountUomTypeId,null()][billOfMaterialLevel,0(java.lang.Long)][brandName,Sherwani(java.lang.String)][chargeShipping,N(java.lang.String)][comments,null()][createdByUserLogin,admin(java.lang.String)][createdDate,2018-09-11 15:31:21.517(java.sql.Timestamp)][createdStamp,2018-09-11 15:31:21.517(java.sql.Timestamp)][createdTxStamp,2018-09-11 15:31:21.516(java.sql.Timestamp)][defaultShipmentBoxTypeId,null()][depthUomId,null()][diameterUomId,null()][heightUomId,null()][inShippingBox,N(java.lang.String)][includeInPromotions,N(java.lang.String)][internalName,Sherwani(java.lang.String)][introductionDate,null()][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][inventoryMessage,null()][isVariant,N(java.lang.String)][isVirtual,Y(java.lang.String)][lastModifiedByUserLogin,admin(java.lang.String)][lastModifiedDate,2018-09-11 15:31:21.517(java.sql.Timestamp)][lastUpdatedStamp,2018-09-11 15:31:21.517(java.sql.Timestamp)][lastUpdatedTxStamp,2018-09-11 15:31:21.516(java.sql.Timestamp)][lotIdFilledIn,Allowed(java.lang.String)][manufacturerPartyId,OEMUSERID(java.lang.String)][orderDecimalQuantity,N(java.lang.String)][piecesIncluded,null()][primaryProductCategoryId,null()][productDepth,null()][productDiameter,null()][productHeight,null()][productId,10002(java.lang.String)][productName,Sherwani(java.lang.String)][productRating,null()][productTypeId,FINISHED_GOOD(java.lang.String)][productWeight,null()][productWidth,null()][quantityIncluded,null()][quantityUomId,null()][ratingTypeEnum,null()][releaseDate,null()][requireAmount,N(java.lang.String)][requireInventory,N(java.lang.String)][requirementMethodEnumId,null()][returnable,N(java.lang.String)][salesDiscWhenNotAvail,N(java.lang.String)][salesDiscontinuationDate,null()][supportDiscontinuationDate,null()][taxable,N(java.lang.String)][weightUomId,null()][widthUomId,null()] (SQL Exception while executing the following:INSERT INTO OFBIZ.PRODUCT (PRODUCT_ID, PRODUCT_TYPE_ID, PRIMARY_PRODUCT_CATEGORY_ID, MANUFACTURER_PARTY_ID, FACILITY_ID, INTRODUCTION_DATE, RELEASE_DATE, SUPPORT_DISCONTINUATION_DATE, SALES_DISCONTINUATION_DATE, SALES_DISC_WHEN_NOT_AVAIL, INTERNAL_NAME, BRAND_NAME, COMMENTS, PRODUCT_NAME, DESCRIPTION, LONG_DESCRIPTION, PRICE_DETAIL_TEXT, SMALL_IMAGE_URL, MEDIUM_IMAGE_URL, LARGE_IMAGE_URL, DETAIL_IMAGE_URL, ORIGINAL_IMAGE_URL, DETAIL_SCREEN, INVENTORY_MESSAGE, REQUIRE_INVENTORY, INVENTORY_ITEM_TYPE_ID, QUANTITY_UOM_ID, QUANTITY_INCLUDED, PIECES_INCLUDED, REQUIRE_AMOUNT, FIXED_AMOUNT, AMOUNT_UOM_TYPE_ID, WEIGHT_UOM_ID, WEIGHT, PRODUCT_WEIGHT, HEIGHT_UOM_ID, PRODUCT_HEIGHT, SHIPPING_HEIGHT, WIDTH_UOM_ID, PRODUCT_WIDTH, SHIPPING_WIDTH, DEPTH_UOM_ID, PRODUCT_DEPTH, SHIPPING_DEPTH, DIAMETER_UOM_ID, PRODUCT_DIAMETER, PRODUCT_RATING, RATING_TYPE_ENUM, RETURNABLE, TAXABLE, CHARGE_SHIPPING, AUTO_CREATE_KEYWORDS, INCLUDE_IN_PROMOTIONS, IS_VIRTUAL, IS_VARIANT, VIRTUAL_VARIANT_METHOD_ENUM, ORIGIN_GEO_ID, REQUIREMENT_METHOD_ENUM_ID, BILL_OF_MATERIAL_LEVEL, RESERV_MAX_PERSONS, RESERV2ND_P_P_PERC, RESERV_NTH_P_P_PERC, CONFIG_ID, CREATED_DATE, CREATED_BY_USER_LOGIN, LAST_MODIFIED_DATE, LAST_MODIFIED_BY_USER_LOGIN, IN_SHIPPING_BOX, DEFAULT_SHIPMENT_BOX_TYPE_ID, LOT_ID_FILLED_IN, ORDER_DECIMAL_QUANTITY, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table ‘PRODUCT’ caused a violation of foreign key constraint ‘PROD_MFG_PARTY’ for key (OEMUSERID). The statement has been rolled back.)))

Regards,
Noorul


#2

It looks like you tried to assign the product to a party that doesn’t exist (manufacturerPartyId = OEMUSERID) - is that the case? There should be a lookup field you can use to check for existing parties, so that this doesn’t happen. In this case, you should create the party first, before creating the product, or create the product without the manufacturer info and add that info later, once you have it all setup.

Please be aware: manufacturers have a special role in scipio, as you can setup the system to automatically reorder products from the manufacturer. This is different from the Vendor, which is just a String that is displayed to the customer.


#3

… admittedly the error message is rather crude. :wink:


#4

Thanks madpiper. Our business users got confused when they saw that error


#5

No problem. Like I said, the error is a correct one, just that the error message could be more userfriendly…