Hi,
This is  the error message given by EclipseLink not Griffin code. You may
changed entity code ( service- > src -> main -> java ->
org.apache.griffin.core.* -> entity)  before starting. When you start
Griffin, EclipseLink will automatically update database table
information,such as column, constraint.

 For example, for the error message *Internal Exception:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Can't write; duplicate key in table '#sql-12c8_1bf930' *with sql* ALTER
TABLE SEGMENTPREDICATE ADD CONSTRAINT FK_SEGMENTPREDICATE_data_connector_id
FOREIGN KEY (data_connector_id) REFERENCES DATACONNECTOR (ID)*,  the most
likely there is already a constraint with
*FK_SEGMENTPREDICATE_data_connector_id*  in your database.

Therefore, you can check your changed code find out where the problem lies. The
worst solution is to delete tables and update it automatically by
EclipseLink.

Thanks,
Kevin

On Mon, Feb 25, 2019 at 3:44 PM 大鹏 <[email protected]> wrote:

> When I started the service, I encountered the following exception. May I
> ask which line of code printed this exception? I didn't find it.The
> exception information is as follows:
>
>
> Call: ALTER TABLE SEGMENTPREDICATE ADD CONSTRAINT
> FK_SEGMENTPREDICATE_data_connector_id FOREIGN KEY (data_connector_id)
> REFERENCES DATACONNECTOR (ID)
> Query: DataModifyQuery(sql="ALTER TABLE SEGMENTPREDICATE ADD CONSTRAINT
> FK_SEGMENTPREDICATE_data_connector_id FOREIGN KEY (data_connector_id)
> REFERENCES DATACONNECTOR (ID)")
> [EL Warning]: 2019-02-25
> 15:40:19.465--ServerSession(1872774414)--Exception [EclipseLink-4002]
> (Eclipse Persistence Services - 2.6.0.v20150309-bf26070):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception:
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Can't write; duplicate key in table '#sql-12c8_1bf930'
> Error Code: 1022
> Call: ALTER TABLE DATACONNECTOR ADD CONSTRAINT
> FK_DATACONNECTOR_data_source_id FOREIGN KEY (data_source_id) REFERENCES
> DATASOURCE (ID)
> Query: DataModifyQuery(sql="ALTER TABLE DATACONNECTOR ADD CONSTRAINT
> FK_DATACONNECTOR_data_source_id FOREIGN KEY (data_source_id) REFERENCES
> DATASOURCE (ID)")
> [EL Warning]: 2019-02-25
> 15:40:19.499--ServerSession(1872774414)--Exception [EclipseLink-4002]
> (Eclipse Persistence Services - 2.6.0.v20150309-bf26070):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception:
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Can't write; duplicate key in table '#sql-12c8_1bf930'
> Error Code: 1022
> Call: ALTER TABLE DATASOURCE ADD CONSTRAINT FK_DATASOURCE_measure_id
> FOREIGN KEY (measure_id) REFERENCES MEASURE (ID)
> Query: DataModifyQuery(sql="ALTER TABLE DATASOURCE ADD CONSTRAINT
> FK_DATASOURCE_measure_id FOREIGN KEY (measure_id) REFERENCES MEASURE (ID)")
> [EL Warning]: 2019-02-25
> 15:40:19.532--ServerSession(1872774414)--Exception [EclipseLink-4002]
> (Eclipse Persistence Services - 2.6.0.v20150309-bf26070):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception:
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Can't write; duplicate key in table '#sql-12c8_1bf930'
> Error Code: 1022
> Call: ALTER TABLE EXTERNALMEASURE ADD CONSTRAINT
> FK_EXTERNALMEASURE_VIRTUALJOB_ID FOREIGN KEY (VIRTUALJOB_ID) REFERENCES job
> (ID)
> Query: DataModifyQuery(sql="ALTER TABLE EXTERNALMEASURE ADD CONSTRAINT
> FK_EXTERNALMEASURE_VIRTUALJOB_ID FOREIGN KEY (VIRTUALJOB_ID) REFERENCES job
> (ID)")
> [EL Warning]: 2019-02-25
> 15:40:19.561--ServerSession(1872774414)--Exception [EclipseLink-4002]
> (Eclipse Persistence Services - 2.6.0.v20150309-bf26070):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception:
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Can't write; duplicate key in table '#sql-12c8_1bf930'
> Error Code: 1022
> Call: ALTER TABLE GRIFFINMEASURE ADD CONSTRAINT FK_GRIFFINMEASURE_ID
> FOREIGN KEY (ID) REFERENCES MEASURE (ID)
> Query: DataModifyQuery(sql="ALTER TABLE GRIFFINMEASURE ADD CONSTRAINT
> FK_GRIFFINMEASURE_ID FOREIGN KEY (ID) REFERENCES MEASURE (ID)")
> [EL Warning]: 2019-02-25
> 15:40:19.594--ServerSession(1872774414)--Exception [EclipseLink-4002]
> (Eclipse Persistence Services - 2.6.0.v20150309-bf26070):
> org.eclipse.persistence.exceptions.DatabaseException
> Internal Exception:
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Can't write; duplicate key in table '#sql-12c8_1bf930'
> Error Code: 1022
>
>
>
>

Reply via email to