org.apache.openjpa.persistence.InvalidStateException: The generated value processing detected an existing value assigned to this field: ... model.Bar.id <http://model.Foo.id>. This existing value was either provided via an initializer or by calling the setter method. You either need to remove the @GeneratedValue annotation or modify the code to remove the initializer processing.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via openjpa-users by Pinaki Poddar, 4 months ago
The generated value processing detected an existing value assigned to this field: ... model.Bar.id <http://model.Foo.id>. This existing value was either provided via an initializer or by calling the setter method. You either need to remove the @GeneratedValue annotation or modify the code to remove the initializer processing.
via openjpa-users by Daryl Stultz, 1 year ago
The generated value processing detected an existing value assigned to this field: ... model.Bar.id <http://model.Foo.id>. This existing value was either provided via an initializer or by calling the setter method. You either need to remove the @GeneratedValue annotation or modify the code to remove the initializer processing.
org.apache.openjpa.persistence.InvalidStateException: The generated value processing detected an existing value assigned to this field: ... model.Bar.id <http://model.Foo.id>. This existing value was either provided via an initializer or by calling the setter method. You either need to remove the @GeneratedValue annotation or modify the code to remove the initializer processing.
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:483)
at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:744)
at org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
at org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:520)
at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2824)
at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.