org.springframework.orm.jpa.JpaSystemException

Error in meta-data for net.opentemperament.entities.Comma.id: Cannot have a java.lang.Long primary key and be a child object (owning field is net.opentemperament.entities.Comma.alias).; nested exception is javax.persistence.PersistenceException: Error in meta-data for net.opentemperament.entities.Comma.id: Cannot have a java.lang.Long primary key and be a child object (owning field is net.opentemperament.entities.Comma.alias).

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web2

  • via Unknown by Niklas Saers,
  • via Unknown by Niklas Saers,
  • Stack trace

    • org.springframework.orm.jpa.JpaSystemException: Error in meta-data for net.opentemperament.entities.Comma.id: Cannot have a java.lang.Long primary key and be a child object (owning field is net.opentemperament.entities.Comma.alias).; nested exception is javax.persistence.PersistenceException: Error in meta-data for net.opentemperament.entities.Comma.id: Cannot have a java.lang.Long primary key and be a child object (owning field is net.opentemperament.entities.Comma.alias). at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:311) at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120) at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:480) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393) at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$afterReturning$org_springframework_transaction_aspectj_AbstractTransactionAspect$3$2a73e96c(AbstractTransactionAspect.aj:78) at net.opentemperament.entities.Comma_Roo_Entity.ajc$interMethod$net_opentemperament_entities_Comma_Roo_Entity$net_opentemperament_entities_Comma$persist(Comma_Roo_Entity.aj:55) at net.opentemperament.entities.Comma.persist(Comma.java:1) at net.opentemperament.entities.Comma_Roo_Entity.ajc$interMethodDispatch1$net_opentemperament_entities_Comma_Roo_Entity$net_opentemperament_entities_Comma$persist(Comma_Roo_Entity.aj) at net.opentemperament.entities.CommaDataOnDemand_Roo_DataOnDemand.ajc$interMethod$net_opentemperament_entities_CommaDataOnDemand_Roo_DataOnDemand$net_opentemperament_entities_CommaDataOnDemand$init(CommaDataOnDemand_Roo_DataOnDemand.aj:50) at net.opentemperament.entities.CommaDataOnDemand.init(CommaDataOnDemand.java:1) at net.opentemperament.entities.CommaDataOnDemand_Roo_DataOnDemand.ajc$interMethodDispatch1$net_opentemperament_entities_CommaDataOnDemand_Roo_DataOnDemand$net_opentemperament_entities_CommaDataOnDemand$init(CommaDataOnDemand_Roo_DataOnDemand.aj) at net.opentemperament.entities.CommaDataOnDemand_Roo_DataOnDemand.ajc$interMethod$net_opentemperament_entities_CommaDataOnDemand_Roo_DataOnDemand$net_opentemperament_entities_CommaDataOnDemand$getRandomComma(CommaDataOnDemand_Roo_DataOnDemand.aj:37) at net.opentemperament.entities.CommaDataOnDemand.getRandomComma(CommaDataOnDemand.java:1) at net.opentemperament.entities.CommaDataOnDemand_Roo_DataOnDemand.ajc$interMethodDispatch1$net_opentemperament_entities_CommaDataOnDemand_Roo_DataOnDemand$net_opentemperament_entities_CommaDataOnDemand$getRandomComma(CommaDataOnDemand_Roo_DataOnDemand.aj) at net.opentemperament.entities.CommaIntegrationTest_Roo_IntegrationTest.ajc$interMethod$net_opentemperament_entities_CommaIntegrationTest_Roo_IntegrationTest$net_opentemperament_entities_CommaIntegrationTest$testCountCommas(CommaIntegrationTest_Roo_IntegrationTest.aj:43) at net.opentemperament.entities.CommaIntegrationTest.testCountCommas(CommaIntegrationTest.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102) at org.apache.maven.surefire.Surefire.run(Surefire.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021) Caused by: javax.persistence.PersistenceException: Error in meta-data for net.opentemperament.entities.Comma.id: Cannot have a java.lang.Long primary key and be a child object (owning field is net.opentemperament.entities.Comma.alias). at org.datanucleus.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:264) at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:122) at org.datanucleus.store.appengine.jpa.DatastoreEntityTransactionImpl.commit(DatastoreEntityTransactionImpl.java:55) at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:467) ... 49 more Caused by: org.datanucleus.store.appengine.MetaDataValidator$DatastoreMetaDataException: Error in meta-data for net.opentemperament.entities.Comma.id: Cannot have a java.lang.Long primary key and be a child object (owning field is net.opentemperament.entities.Comma.alias). at org.datanucleus.store.appengine.MetaDataValidator.checkForIllegalChildField(MetaDataValidator.java:376) at org.datanucleus.store.appengine.MetaDataValidator.validateField(MetaDataValidator.java:226) at org.datanucleus.store.appengine.MetaDataValidator.validateFields(MetaDataValidator.java:148) at org.datanucleus.store.appengine.MetaDataValidator.validate(MetaDataValidator.java:121) at org.datanucleus.store.appengine.DatastoreManager.validateMetaDataForClass(DatastoreManager.java:766) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess(DatastorePersistenceHandler.java:328) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:251) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:240) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.flush(JDOStateManagerImpl.java:4513) at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:2814) at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:2754) at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2893) at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:369) at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:256) at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:104) ... 51 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    We couldn't find other users who have seen this exception.