Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » WrongPrimayKeyException and MissingColoumnExceptions while using elver with jpox
WrongPrimayKeyException and MissingColoumnExceptions while using elver with jpox [message #590875] Wed, 13 September 2006 17:31
Eclipse UserFriend
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 )
Previous Topic:EODM tutorial
Next Topic:Cannot find operation xyz() for the type (abc)
Goto Forum:
  


Current Time: Fri Sep 20 00:10:20 GMT 2024

Powered by FUDForum. Page generated in 0.05245 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top