Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » a strange problem when configure jpoxDataStore
a strange problem when configure jpoxDataStore [message #90646] Thu, 19 July 2007 09:51 Go to next message
Eclipse UserFriend
Originally posted by: danceslower.sina.com

Hi All,
I have meet a strange problem during integrating jpox and derby. an
exception is throwed when i tried to configue the database
connection.Here is the code:
////////////////////////
org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;
// set the database connection info, PMFConfiguration is
org.jpox.PMFConfiguration
Properties properties = new Properties();
properties.setProperty(PMFConfiguration.JDO_DATASTORE_DRIVER NAME_PROPERTY,
"org.apache.derby.jdbc.ClientDriver");
properties.setProperty(PMFConfiguration.JDO_DATASTORE_URL_PR OPERTY,
"jdbc:derby://localhost:1527/MyDbTest;");
properties.setProperty(PMFConfiguration.JDO_DATASTORE_USERNA ME_PROPERTY,
"sa");
properties.setProperty(PMFConfiguration.JDO_DATASTORE_PASSWO RD_PROPERTY,
"sa");
properties.setProperty(PMFConfiguration.AUTO_CREATE_TABLES_P ROPERTY, "true");
properties.setProperty(PMFConfiguration.CACHE_LEVEL_1_TYPE_P ROPERTY,
"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();
////////////////////////
and here is the exception:
////////////////////////
Exception in thread "main" javax.jdo.JDODataStoreException: SQL exception:
Add classes to Catalog "", Schema "SA"
at
org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2444)
at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.ja va:821)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:518)
at
org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
at
com.ibm.crl.bo.tops.util.TestTeneoCustomer.main(TestTeneoCus tomer.java:56)
NestedThrowablesStackTrace:
java.sql.SQLException:
Re: a strange problem when configure jpoxDataStore [message #90662 is a reply to message #90646] Thu, 19 July 2007 10:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Wangyan,
What does the sql exception say?
I see this (the message is garbled which is probably caused by character encoding issues):
Caused by: org.apache.derby.client.am.SqlException:
Óöµ½ÁËÍøÂçЭÒé´íÎó£¬Á¬½ÓÒÑÖÕÖ¹ £º·þÎñÆ÷δʵÏÖËùÇëÇóµÄÃüÁ»ò ÕßÃüÁîÓöµ½Ìض¨ÓÚʵÏÖµÄÇé¿ö£¬¶ø ûÓÐÕë¶Ô´ËÇé¿öµÄÌض¨ÓÚʵÏÖµÄÏû Ï¢

gr. Martin

wangyan wrote:
> Hi All,
> I have meet a strange problem during integrating jpox and derby. an
> exception is throwed when i tried to configue the database
> connection.Here is the code:
> ////////////////////////
> org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;
> // set the database connection info, PMFConfiguration is
> org.jpox.PMFConfiguration
> Properties properties = new Properties();
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_DRIVER NAME_PROPERTY,
> "org.apache.derby.jdbc.ClientDriver");
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_URL_PR OPERTY,
> "jdbc:derby://localhost:1527/MyDbTest;");
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_USERNA ME_PROPERTY,
> "sa");
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_PASSWO RD_PROPERTY,
> "sa");
> properties.setProperty(PMFConfiguration.AUTO_CREATE_TABLES_P ROPERTY, "true");
> properties.setProperty(PMFConfiguration.CACHE_LEVEL_1_TYPE_P ROPERTY,
> "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();
> ////////////////////////
> and here is the exception:
> ////////////////////////
> Exception in thread "main" javax.jdo.JDODataStoreException: SQL exception:
> Add classes to Catalog "", Schema "SA"
> at
> org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2444)
> at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.ja va:821)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:518)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at
> com.ibm.crl.bo.tops.util.TestTeneoCustomer.main(TestTeneoCus tomer.java:56)
> NestedThrowablesStackTrace:
> java.sql.SQLException: Óöµ½ÁËÍøÂçЭÒé´íÎó£¬Á¬½ÓÒÑÖÕÖ¹ £º·þÎñÆ÷δʵÏÖËùÇëÇóµÄÃüÁ»ò ÕßÃüÁîÓöµ½Ìض¨ÓÚʵÏÖµÄÇé¿ö£¬¶ø ûÓÐÕë¶Ô´ËÇé¿öµÄÌض¨ÓÚʵÏÖµÄÏû Ï¢
> at org.apache.derby.client.am.SQLExceptionFactory.getSQLExcepti on(Unknown
> Source)
> at org.apache.derby.client.am.SqlException.getSQLException(Unkn own Source)
> at org.apache.derby.client.am.Connection.getAutoCommit(Unknown Source)
> at
> org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2415)
> at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.ja va:821)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:518)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at
> com.ibm.crl.bo.tops.util.TestTeneoCustomer.main(TestTeneoCus tomer.java:56)
> Caused by: org.apache.derby.client.am.SqlException: Óöµ½ÁËÍøÂçЭÒé´íÎó£¬Á¬½ÓÒÑÖÕÖ¹ £º·þÎñÆ÷δʵÏÖËùÇëÇóµÄÃüÁ»ò ÕßÃüÁîÓöµ½Ìض¨ÓÚʵÏÖµÄÇé¿ö£¬¶ø ûÓÐÕë¶Ô´ËÇé¿öµÄÌض¨ÓÚʵÏÖµÄÏû Ï¢
> at
> org.apache.derby.client.am.SqlException.copyAsUnchainedSQLEx ception(Unknown
> Source)
> at
> org.apache.derby.client.am.Sqlca.chainDeferredExceptionsToAg entOrAsConnectionWarnings(Unknown
> Source)
> at org.apache.derby.client.am.Sqlca.getJDBCMessage(Unknown Source)
> at org.apache.derby.client.am.SqlException.getMessage(Unknown Source)
> at org.apache.derby.client.am.SqlException.getSQLException(Unkn own Source)
> at org.apache.derby.client.am.DatabaseMetaData.getIndexInfo(Unk nown Source)
> at
> org.jpox.store.rdbms.adapter.DatabaseAdapter.getExistingInde xes(DatabaseAdapter.java:1648)
> at
> org.jpox.store.rdbms.table.TableImpl.getExistingCandidateKey s(TableImpl.java:1014)
> at
> org.jpox.store.rdbms.table.TableImpl.validateCandidateKeys(T ableImpl.java:615)
> at
> org.jpox.store.rdbms.table.TableImpl.validateConstraints(Tab leImpl.java:393)
> at
> org.jpox.store.rdbms.table.ClassTable.validateConstraints(Cl assTable.java:2875)
> at
> org.jpox.store.rdbms.RDBMSManager$ClassAdder.performTablesVa lidation(RDBMSManager.java:3110)
> at
> org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTablesA ndValidate(RDBMSManager.java:3313)
> at org.jpox.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManage r.java:2554)
> at
> org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2406)
> ... 4 more
> ////////////////////////
> Is there any problem in my package.jdo?
>
>


--

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: a strange problem when configure jpoxDataStore [message #608804 is a reply to message #90646] Thu, 19 July 2007 10:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Wangyan,
What does the sql exception say?
I see this (the message is garbled which is probably caused by character encoding issues):
Caused by: org.apache.derby.client.am.SqlException:
Óöµ½ÁËÍøÂçЭÒé´íÎó£¬Á¬½ÓÒÑÖÕÖ¹ £º·þÎñÆ÷δʵÏÖËùÇëÇóµÄÃüÁ»ò ÕßÃüÁîÓöµ½Ìض¨ÓÚʵÏÖµÄÇé¿ö£¬¶ø ûÓÐÕë¶Ô´ËÇé¿öµÄÌض¨ÓÚʵÏÖµÄÏû Ï¢

gr. Martin

wangyan wrote:
> Hi All,
> I have meet a strange problem during integrating jpox and derby. an
> exception is throwed when i tried to configue the database
> connection.Here is the code:
> ////////////////////////
> org.eclipse.osgi.framework.debug.Debug.DEBUG_GENERAL = true;
> // set the database connection info, PMFConfiguration is
> org.jpox.PMFConfiguration
> Properties properties = new Properties();
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_DRIVER NAME_PROPERTY,
> "org.apache.derby.jdbc.ClientDriver");
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_URL_PR OPERTY,
> "jdbc:derby://localhost:1527/MyDbTest;");
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_USERNA ME_PROPERTY,
> "sa");
> properties.setProperty(PMFConfiguration.JDO_DATASTORE_PASSWO RD_PROPERTY,
> "sa");
> properties.setProperty(PMFConfiguration.AUTO_CREATE_TABLES_P ROPERTY, "true");
> properties.setProperty(PMFConfiguration.CACHE_LEVEL_1_TYPE_P ROPERTY,
> "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();
> ////////////////////////
> and here is the exception:
> ////////////////////////
> Exception in thread "main" javax.jdo.JDODataStoreException: SQL exception:
> Add classes to Catalog "", Schema "SA"
> at
> org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2444)
> at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.ja va:821)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:518)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at
> com.ibm.crl.bo.tops.util.TestTeneoCustomer.main(TestTeneoCus tomer.java:56)
> NestedThrowablesStackTrace:
> java.sql.SQLException: Óöµ½ÁËÍøÂçЭÒé´íÎó£¬Á¬½ÓÒÑÖÕÖ¹ £º·þÎñÆ÷δʵÏÖËùÇëÇóµÄÃüÁ»ò ÕßÃüÁîÓöµ½Ìض¨ÓÚʵÏÖµÄÇé¿ö£¬¶ø ûÓÐÕë¶Ô´ËÇé¿öµÄÌض¨ÓÚʵÏÖµÄÏû Ï¢
> at org.apache.derby.client.am.SQLExceptionFactory.getSQLExcepti on(Unknown
> Source)
> at org.apache.derby.client.am.SqlException.getSQLException(Unkn own Source)
> at org.apache.derby.client.am.Connection.getAutoCommit(Unknown Source)
> at
> org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2415)
> at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.ja va:821)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:518)
> at
> org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:213)
> at
> com.ibm.crl.bo.tops.util.TestTeneoCustomer.main(TestTeneoCus tomer.java:56)
> Caused by: org.apache.derby.client.am.SqlException: Óöµ½ÁËÍøÂçЭÒé´íÎó£¬Á¬½ÓÒÑÖÕÖ¹ £º·þÎñÆ÷δʵÏÖËùÇëÇóµÄÃüÁ»ò ÕßÃüÁîÓöµ½Ìض¨ÓÚʵÏÖµÄÇé¿ö£¬¶ø ûÓÐÕë¶Ô´ËÇé¿öµÄÌض¨ÓÚʵÏÖµÄÏû Ï¢
> at
> org.apache.derby.client.am.SqlException.copyAsUnchainedSQLEx ception(Unknown
> Source)
> at
> org.apache.derby.client.am.Sqlca.chainDeferredExceptionsToAg entOrAsConnectionWarnings(Unknown
> Source)
> at org.apache.derby.client.am.Sqlca.getJDBCMessage(Unknown Source)
> at org.apache.derby.client.am.SqlException.getMessage(Unknown Source)
> at org.apache.derby.client.am.SqlException.getSQLException(Unkn own Source)
> at org.apache.derby.client.am.DatabaseMetaData.getIndexInfo(Unk nown Source)
> at
> org.jpox.store.rdbms.adapter.DatabaseAdapter.getExistingInde xes(DatabaseAdapter.java:1648)
> at
> org.jpox.store.rdbms.table.TableImpl.getExistingCandidateKey s(TableImpl.java:1014)
> at
> org.jpox.store.rdbms.table.TableImpl.validateCandidateKeys(T ableImpl.java:615)
> at
> org.jpox.store.rdbms.table.TableImpl.validateConstraints(Tab leImpl.java:393)
> at
> org.jpox.store.rdbms.table.ClassTable.validateConstraints(Cl assTable.java:2875)
> at
> org.jpox.store.rdbms.RDBMSManager$ClassAdder.performTablesVa lidation(RDBMSManager.java:3110)
> at
> org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTablesA ndValidate(RDBMSManager.java:3313)
> at org.jpox.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManage r.java:2554)
> at
> org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RD BMSManager.java:2406)
> ... 4 more
> ////////////////////////
> Is there any problem in my package.jdo?
>
>


--

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:a strange problem when configure jpoxDataStore
Next Topic:Writing a DiffModel as .uml
Goto Forum:
  


Current Time: Fri Apr 19 04:23:11 GMT 2024

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

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

Back to the top