Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » problem with initialzing jpoxDataStore(emf+teneo+derby)
problem with initialzing jpoxDataStore(emf+teneo+derby) [message #90377] Wed, 18 July 2007 10:53 Go to next message
Eclipse UserFriend
Originally posted by: danceslower.sina.com

Hi all,
I am trying to integrate emf,teneo and derby into one application.
However, a strange problem occured when i tried to configue the database
connection.Here is the code:

/////////////////////
Properties properties = new Properties();
properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_DRIVERNAME_PROPERTY,
"com.ibm.db2.jcc.DB2Driver");
properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_URL_PROPERTY,
"jdbc:derby:net://localhost:1527/MyDbTest");
properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_USERNAME_PROPERTY,
"sa");
properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_PASSWORD_PROPERTY,
"sa");
properties.setProperty(PersistenceConfiguration.AUTO_CREATE_ TABLES_PROPERTY, "true");
properties.setProperty(PersistenceConfiguration.CACHE_LEVEL_ 1_TYPE_PROPERTY,
"org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache");

// create/register the JpoxDataStore, set the db props and the epackages
to persist, initialize creates
// the database
String pmfName = "MyPMF"; // the name of the JpoxDataStore
JpoxDataStore jpoxDataStore =
JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
jpoxDataStore.setProperties(properties);
jpoxDataStore.setEPackages(new EPackage[] { CustomerPackage.eINSTANCE });
jpoxDataStore.initialize();
///////////////////////////////////

an exception was throwed when execute to "jpoxDataStore.initialize". and
here is the error information:

///////////////////////
log4j:WARN No appenders could be found for logger
(org.eclipse.emf.teneo.jpox.JpoxHelper).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" javax.jdo.JDOFatalUserException: Level 1 Cache
"org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not registered. Please
check your CLASSPATH and specification.
at
org.jpox.jdo.JPOXJDOHelper.getJDOExceptionForJPOXException(J POXJDOHelper.java:320)
at
org.jpox.AbstractPersistenceManagerFactory.freezeConfigurati on(AbstractPersistenceManagerFactory.java:133)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager Factory(PersistenceManagerFactoryImpl.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:710)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:633)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:513)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
at com.test.customer.impl.TestTeneoCustomer.main(TestTeneoCusto mer.java:69)
NestedThrowablesStackTrace:
Level 1 Cache "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not
registered. Please check your CLASSPATH and specification.
org.jpox.exceptions.JPOXUserException: Level 1 Cache
"org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not registered. Please
check your CLASSPATH and specification.
at
org.jpox.ObjectManagerImpl.initialiseLevel1Cache(ObjectManag erImpl.java:271)
at org.jpox.ObjectManagerImpl.<init>(ObjectManagerImpl.java:245)
at
org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:113)
at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:39)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:256)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:236)
at org.jpox.store.rdbms.SchemaAutoStarter.open(SchemaAutoStarte r.java:136)
at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:298)
at
org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:758)
at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:306)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:93)
at
org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:58)
at
org.jpox.ObjectManagerFactoryImpl.initialiseStoreManager(Obj ectManagerFactoryImpl.java:168)
at
org.jpox.AbstractPersistenceManagerFactory.freezeConfigurati on(AbstractPersistenceManagerFactory.java:119)
at
org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager Factory(PersistenceManagerFactoryImpl.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:710)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:633)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:513)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
at com.test.customer.impl.TestTeneoCustomer.main(TestTeneoCusto mer.java:69)
////////////////////////

I have added the "org.eclipse.emf.teneo.jpox.jar" into plugins as while as
java build path of this project, why such exception has been reported? The
help document in the eclipse.org also shows that its crucial to set this
cache property and it should be added in this manner.
where is the problem?
Hoping for response!
Thank you very much!
Re: problem with initialzing jpoxDataStore(emf+teneo+derby) [message #90395 is a reply to message #90377] Wed, 18 July 2007 11:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Wangyan,
Are you maybe using jpox 1.2? Teneo is at jpox 1.1.8. For jpox 1.2 you need to add a plugin.xml
defining the teneo cache definitions. See here for the jpox documentation:
http://www.jpox.org/docs/1_2/extensions/level1_cache.html

Note that the Teneo cache is only required to ensure that eContainer pointers are correct, if you
are not interested in the correct value of the eContainer member then this cache is not required.

gr. Martin

wangyan wrote:
> Hi all,
> I am trying to integrate emf,teneo and derby into one application.
> However, a strange problem occured when i tried to configue the database
> connection.Here is the code:
>
> /////////////////////
> Properties properties = new Properties();
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_DRIVERNAME_PROPERTY,
> "com.ibm.db2.jcc.DB2Driver");
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_URL_PROPERTY,
> "jdbc:derby:net://localhost:1527/MyDbTest");
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_USERNAME_PROPERTY,
> "sa");
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_PASSWORD_PROPERTY,
> "sa");
> properties.setProperty(PersistenceConfiguration.AUTO_CREATE_ TABLES_PROPERTY, "true");
> properties.setProperty(PersistenceConfiguration.CACHE_LEVEL_ 1_TYPE_PROPERTY,
> "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache");
>
> // create/register the JpoxDataStore, set the db props and the epackages
> to persist, initialize creates
> // the database
> String pmfName = "MyPMF"; // the name of the JpoxDataStore
> JpoxDataStore jpoxDataStore =
> JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
> jpoxDataStore.setProperties(properties);
> jpoxDataStore.setEPackages(new EPackage[] { CustomerPackage.eINSTANCE });
> jpoxDataStore.initialize();
> ///////////////////////////////////
>
> an exception was throwed when execute to "jpoxDataStore.initialize". and
> here is the error information:
>
> ///////////////////////
> log4j:WARN No appenders could be found for logger
> (org.eclipse.emf.teneo.jpox.JpoxHelper).
> log4j:WARN Please initialize the log4j system properly.
> Exception in thread "main" javax.jdo.JDOFatalUserException: Level 1 Cache
> "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not registered. Please
> check your CLASSPATH and specification.
> at
> org.jpox.jdo.JPOXJDOHelper.getJDOExceptionForJPOXException(J POXJDOHelper.java:320)
> at
> org.jpox.AbstractPersistenceManagerFactory.freezeConfigurati on(AbstractPersistenceManagerFactory.java:133)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager Factory(PersistenceManagerFactoryImpl.java:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:710)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:633)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:513)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at com.test.customer.impl.TestTeneoCustomer.main(TestTeneoCusto mer.java:69)
> NestedThrowablesStackTrace:
> Level 1 Cache "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not
> registered. Please check your CLASSPATH and specification.
> org.jpox.exceptions.JPOXUserException: Level 1 Cache
> "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not registered. Please
> check your CLASSPATH and specification.
> at
> org.jpox.ObjectManagerImpl.initialiseLevel1Cache(ObjectManag erImpl.java:271)
> at org.jpox.ObjectManagerImpl.<init>(ObjectManagerImpl.java:245)
> at
> org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:113)
> at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:39)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:256)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:236)
> at org.jpox.store.rdbms.SchemaAutoStarter.open(SchemaAutoStarte r.java:136)
> at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:298)
> at
> org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:758)
> at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:306)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:93)
> at
> org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:58)
> at
> org.jpox.ObjectManagerFactoryImpl.initialiseStoreManager(Obj ectManagerFactoryImpl.java:168)
> at
> org.jpox.AbstractPersistenceManagerFactory.freezeConfigurati on(AbstractPersistenceManagerFactory.java:119)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager Factory(PersistenceManagerFactoryImpl.java:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:710)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:633)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:513)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at com.test.customer.impl.TestTeneoCustomer.main(TestTeneoCusto mer.java:69)
> ////////////////////////
>
> I have added the "org.eclipse.emf.teneo.jpox.jar" into plugins as while as
> java build path of this project, why such exception has been reported? The
> help document in the eclipse.org also shows that its crucial to set this
> cache property and it should be added in this manner.
> where is the problem?
> Hoping for response!
> Thank you very much!
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: problem with initialzing jpoxDataStore(emf+teneo+derby) [message #608787 is a reply to message #90377] Wed, 18 July 2007 11:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Wangyan,
Are you maybe using jpox 1.2? Teneo is at jpox 1.1.8. For jpox 1.2 you need to add a plugin.xml
defining the teneo cache definitions. See here for the jpox documentation:
http://www.jpox.org/docs/1_2/extensions/level1_cache.html

Note that the Teneo cache is only required to ensure that eContainer pointers are correct, if you
are not interested in the correct value of the eContainer member then this cache is not required.

gr. Martin

wangyan wrote:
> Hi all,
> I am trying to integrate emf,teneo and derby into one application.
> However, a strange problem occured when i tried to configue the database
> connection.Here is the code:
>
> /////////////////////
> Properties properties = new Properties();
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_DRIVERNAME_PROPERTY,
> "com.ibm.db2.jcc.DB2Driver");
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_URL_PROPERTY,
> "jdbc:derby:net://localhost:1527/MyDbTest");
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_USERNAME_PROPERTY,
> "sa");
> properties.setProperty(PersistenceConfiguration.JDO_DATASTOR E_PASSWORD_PROPERTY,
> "sa");
> properties.setProperty(PersistenceConfiguration.AUTO_CREATE_ TABLES_PROPERTY, "true");
> properties.setProperty(PersistenceConfiguration.CACHE_LEVEL_ 1_TYPE_PROPERTY,
> "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache");
>
> // create/register the JpoxDataStore, set the db props and the epackages
> to persist, initialize creates
> // the database
> String pmfName = "MyPMF"; // the name of the JpoxDataStore
> JpoxDataStore jpoxDataStore =
> JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
> jpoxDataStore.setProperties(properties);
> jpoxDataStore.setEPackages(new EPackage[] { CustomerPackage.eINSTANCE });
> jpoxDataStore.initialize();
> ///////////////////////////////////
>
> an exception was throwed when execute to "jpoxDataStore.initialize". and
> here is the error information:
>
> ///////////////////////
> log4j:WARN No appenders could be found for logger
> (org.eclipse.emf.teneo.jpox.JpoxHelper).
> log4j:WARN Please initialize the log4j system properly.
> Exception in thread "main" javax.jdo.JDOFatalUserException: Level 1 Cache
> "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not registered. Please
> check your CLASSPATH and specification.
> at
> org.jpox.jdo.JPOXJDOHelper.getJDOExceptionForJPOXException(J POXJDOHelper.java:320)
> at
> org.jpox.AbstractPersistenceManagerFactory.freezeConfigurati on(AbstractPersistenceManagerFactory.java:133)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager Factory(PersistenceManagerFactoryImpl.java:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:710)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:633)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:513)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at com.test.customer.impl.TestTeneoCustomer.main(TestTeneoCusto mer.java:69)
> NestedThrowablesStackTrace:
> Level 1 Cache "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not
> registered. Please check your CLASSPATH and specification.
> org.jpox.exceptions.JPOXUserException: Level 1 Cache
> "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache" is not registered. Please
> check your CLASSPATH and specification.
> at
> org.jpox.ObjectManagerImpl.initialiseLevel1Cache(ObjectManag erImpl.java:271)
> at org.jpox.ObjectManagerImpl.<init>(ObjectManagerImpl.java:245)
> at
> org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:113)
> at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:39)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:256)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:236)
> at org.jpox.store.rdbms.SchemaAutoStarter.open(SchemaAutoStarte r.java:136)
> at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:298)
> at
> org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:758)
> at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:306)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:93)
> at
> org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:58)
> at
> org.jpox.ObjectManagerFactoryImpl.initialiseStoreManager(Obj ectManagerFactoryImpl.java:168)
> at
> org.jpox.AbstractPersistenceManagerFactory.freezeConfigurati on(AbstractPersistenceManagerFactory.java:119)
> at
> org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager Factory(PersistenceManagerFactoryImpl.java:120)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:710)
> at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.j ava:633)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:513)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at com.test.customer.impl.TestTeneoCustomer.main(TestTeneoCusto mer.java:69)
> ////////////////////////
>
> I have added the "org.eclipse.emf.teneo.jpox.jar" into plugins as while as
> java build path of this project, why such exception has been reported? The
> help document in the eclipse.org also shows that its crucial to set this
> cache property and it should be added in this manner.
> where is the problem?
> Hoping for response!
> Thank you very much!
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:problem with initialzing jpoxDataStore(emf+teneo+derby)
Next Topic:[Teneo] PersistenceOptions.JOIN_COLUMN_NAMING_STRATEGY
Goto Forum:
  


Current Time: Tue Aug 16 04:58:15 GMT 2022

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

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

Back to the top