WrongPrimayKeyException and MissingColoumnExceptions while using elver with jpox [message #590875] |
Wed, 13 September 2006 17:31 |
Eclipse User |
|
|
|
Originally posted by: varunkumarm.gmail.com
Iam getting both of these exceptions when i tried running the tutorial
after setting the connection for my database.
I may not be using the other features like resources but i want the schema
to be created first.
The line
PersistenceManager pm = jpoxDataStore.getPersistenceManager(); is shown as
error first and so i changed it to
PersistenceManager pm = jpoxDataStore.getPMF().getPersistenceManager();
I dont think there is nothing wrong with it.
This is stacktrace that is printed.
org.jpox.store.exceptions.WrongPrimaryKeyException: Expected primary key
for table JPOX_TABLES CONSTRAINT JPOX_TABLES_PK PRIMARY KEY () not found
in existing keys CONSTRAINT PRIMARY PRIMARY KEY (CLASS_NAME)
at
org.jpox.store.rdbms.table.TableImpl.validatePrimaryKey(Tabl eImpl.java:284)
at org.jpox.store.rdbms.table.TableImpl.validate(TableImpl.java :186)
at
org.jpox.store.rdbms.SchemaAutoStarter.<init>(SchemaAutoStarter.java:93)
at
org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:450)
at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:237)
at
org.jpox.store.rdbms.RDBMSManagerFactory.getStoreManager(RDB MSManagerFactory.java:59)
at
org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:221)
at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:34)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:887)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:862)
at
org.elver.store.jpox.emf.JpoxDataStore.createSchema(JpoxData Store.java:377)
at
org.elver.store.jpox.emf.JpoxDataStore.initialize(JpoxDataSt ore.java:186)
at org.eclipse.example.library.Tutorial1.main(Tutorial1.java:74 )
Exception in thread "main"
org.jpox.store.exceptions.MissingColumnException: Required columns missing
from table "LIBRARY" : `NAME`, LIBRARY_ID. Perhaps your MetaData is
incorrect, or you havent enabled "org.jpox.autoCreateColumns".
at
org.jpox.store.rdbms.table.TableImpl.validateColumns(TableIm pl.java:259)
at org.jpox.store.rdbms.table.TableImpl.validate(TableImpl.java :183)
at
org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTablesA ndValidate(RDBMSManager.java:2462)
at
org.jpox.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManage r.java:2003)
at
org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:1859)
at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.ja va:553)
at
org.elver.store.jpox.emf.JpoxDataStore.createSchema(JpoxData Store.java:380)
at
org.elver.store.jpox.emf.JpoxDataStore.initialize(JpoxDataSt ore.java:186)
at org.eclipse.example.library.Tutorial1.main(Tutorial1.java:74 )
|
|
|
Powered by
FUDForum. Page generated in 0.05245 seconds