Page 1 of 1

Exception when adding new product to homepage

Posted: Sun Aug 23, 2015 4:20 pm
by blondeMatrix
Hello team,

Broadleaf throws an exception when I attempt to alter/add a product to those displayed on the home page.

After logging in as admin, I click on...

Catalog>> Categories>>Home>>Products>>Add

But when selecting a product from the pop up list, I get the following exception.

An error occurred×

Problem adding new entity : org.hibernate.exception.ConstraintViolationException: Duplicate entry '12' for key 1 org.broadleafcommerce.common.exception.ServiceException: Problem adding new entity : org.hibernate.exception.ConstraintViolationException: Duplicate entry '12' for key 1 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: Duplicate entry '12' for key 1 org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) org.hibernate.exception.ConstraintViolationException: Duplicate entry '12' for key 1 org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:74) com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '12' for key 1 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Is this perhaps a bug?

Thanks & regards,

Chris.

Re: Exception when adding new product to homepage

Posted: Tue Sep 15, 2015 8:08 am
by phillipuniverse
Look at the value of ProductImpl in the SEQUENCE_GENERATOR table in your database. Broadleaf uses this table to determine which new ID to obtain for new table entries like BLC_PRODUCT.