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 #608786] Wed, 18 July 2007 10:53
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!
Previous Topic:[Teneo] another problems: my datas are modified by Teneo
Next Topic:problem with initialzing jpoxDataStore(emf+teneo+derby)
Goto Forum:
  


Current Time: Sat Aug 13 00:35:28 GMT 2022

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

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

Back to the top