I am populating data from xml and persisting entities using entitymanager during my application startup and everything is fine. But however I am trying to run the junits with setup containing the script to load the test data by persisting them using entitymanager, I am seeing the following exception...
PS: I haven't set any userId value in my unit tests. not sure what does this mean.... am not able to get away with this exception. appreciate any quick help. Primary key field com.all4u.server.domain.Member.userId of com.all4u.server.domain.Member@187e184 has non-default value. The instance life cycle is in PNewState state and hence an existing non-default value for the identity field is not permitted. You either need to remove the @GeneratedValue annotation or modify the code to remove the initializer processing.; nested exception is <openjpa-2.2.0-r422266:1244990 nonfatal user error> org.apache.openjpa.persistence.InvalidStateException: Primary key field com.all4u.server.domain.Member.userId of com.all4u.server.domain.Member@187e184 has non-default value. The instance life cycle is in PNewState state and hence an existing non-default value for the identity field is not permitted. You either need to remove the @GeneratedValue annotation or modify the code to remove the initializer processing. -- View this message in context: http://openjpa.208410.n2.nabble.com/Exception-during-the-unit-tests-in-Eclipse-including-maven-tp7570130.html Sent from the OpenJPA Users mailing list archive at Nabble.com.