Home » Modeling » EMF » [Teneo] QuickStart Tutorial fails to create tables(tables are not created for the ECore model in the tutorial)
| | | | | | |
Re: [Teneo] QuickStart Tutorial fails to create tables [message #656861 is a reply to message #656835] |
Mon, 28 February 2011 19:35 |
Robert Lario Messages: 8 Registered: February 2011 |
Junior Member |
|
|
Adding the logging information helped identify where the issues is. Tnx
Does Teneo work with MySQL? Is there a special setting or configuration I need for Teneo to work with MySQL?
It appears that it does not like type InnoDB. Where is what I found in the logs
0 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table `book` (e_id bigint not null auto_increment, dtype varchar(255) not null, e_version integer not null, `title` varchar(255) not null, `pages` integer, `category` varchar(255), author bigint, `library_books_e_id` bigint, `library_books_idx` integer, econtainer_class varchar(255), e_container varchar(255), e_container_feature_name varchar(255), primary key (e_id)) type=InnoDB
32 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 1
|
|
|
Re: [Teneo] QuickStart Tutorial fails to create tables [message #656870 is a reply to message #656861] |
Mon, 28 February 2011 20:03 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Yes sure, Hibernate/Teneo works fine with Mysql, what hibernate dialect are you using?
gr. Martin
On 02/28/2011 08:35 PM, Robert Lario wrote:
> Adding the logging information helped identify where the issues is. Tnx
>
> Does Teneo work with MySQL? Is there a special setting or configuration I need for Teneo to work with MySQL?
>
> It appears that it does not like type InnoDB. Where is what I found in the logs
>
>
> 0 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table `book` (e_id bigint not null
> auto_increment, dtype varchar(255) not null, e_version integer not null, `title` varchar(255) not null, `pages` integer,
> `category` varchar(255), author bigint, `library_books_e_id` bigint, `library_books_idx` integer, econtainer_class
> varchar(255), e_container varchar(255), e_container_feature_name varchar(255), primary key (e_id)) type=InnoDB
> 32 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB' at line 1
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [Teneo] QuickStart Tutorial fails to create tables [message #656879 is a reply to message #656871] |
Mon, 28 February 2011 21:17 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hmm, I wonder why this happens with you and not with me ;-). Teneo does not generate these create statements, it is
native Hibernate which does this (which I guess should work with mysql).
Can you show how you set the properties? What dialect do you use?
gr. Martin
On 02/28/2011 09:26 PM, Robert Lario wrote:
> it appears that "type=InnoDB" is the offending statement. MySQL syntex "ENGINE=InnoDB".
>
> I took (statement being used by TENEO to create the table):
> create table `library` (e_id bigint not null auto_increment, dtype varchar(255) not null, e_version integer not null,
> `name` varchar(255) not null, primary key (e_id)) type=InnoDB
>
> and changed it to ENGINE (not TYPE) and executed in the MySQL Workbench :
> create table `library` (e_id bigint not null auto_increment, dtype varchar(255) not null, e_version integer not null,
> `name` varchar(255) not null, primary key (e_id)) ENGINE=InnoDB
>
> This works fine.
>
> Is there a means to change the statement created by TENEO to use "ENGINE" and not "TYPE"?
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [Teneo] QuickStart Tutorial fails to create tables [message #1006698 is a reply to message #656888] |
Fri, 01 February 2013 13:36 |
M B Messages: 5 Registered: February 2013 |
Junior Member |
|
|
I create from example here rcp-vision_com: "Eclipse EMF: an out-of-the-box CRUD for a database".
But I use H2 database.
Database properties are next:
// create the data store
HbDataStore hbds = (HbDataStore) HbHelper.INSTANCE.createRegisterDataStore("MyDB");
//Set Database properties
Properties props = new Properties();
props.setProperty(Environment.DRIVER, "org.h2.Driver");
props.setProperty(Environment.URL, "jdbc:h2:~/test1");
props.setProperty(Environment.USER, "sa");
props.setProperty(Environment.PASS, "");
props.setProperty(Environment.DIALECT, org.hibernate.dialect.H2Dialect.class.getName());
props.setProperty(Environment.SHOW_SQL, "true");
props.setProperty(Environment.HBM2DDL_AUTO, "update");
// props.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
hbds.setProperties(props);
//Register EMF package in this datastore
hbds.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
// initialize, also creates the database tables
try {
hbds.initialize();
} finally {
// print the generated mapping
System.err.println(hbds.getMappingXML());
}
Have an error on initialize.
Feb 01, 2013 2:16:20 PM org.eclipse.emf.teneo.hibernate.HbHelper createRegisterDataStore
INFO: Creating emf data store and registering it under name: MyDB
Feb 01, 2013 2:16:20 PM org.eclipse.emf.teneo.hibernate.HbHelper createRegisterDataStore
INFO: Returning created emf data store, initialize this newly created data store!
Feb 01, 2013 2:16:20 PM org.eclipse.emf.teneo.classloader.ClassLoaderResolver setClassLoaderStrategy
INFO: Class loader strategy set to: org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See ... for more info.
...
!ENTRY org.eclipse.osgi 4 0 2013-02-01 14:16:20.924
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/hibernate/cache/HashtableCacheProvider
at org.eclipse.emf.teneo.hibernate.HbDataStore.setDefaultProperties(HbDataStore.java:403)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.setPropertiesInConfiguration(HbSessionDataStore.java:137)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:79)
at library.presentation.LibraryEditorAdvisor.initialize(LibraryEditorAdvisor.java:589)
...
Could you give me an advise?
|
|
|
Re: [Teneo] QuickStart Tutorial fails to create tables [message #1006747 is a reply to message #1006698] |
Fri, 01 February 2013 16:33 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi MB,
Did you install the hibernate plugin?
http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install#Plugins_and_dependencies.2C_update_site_locations
and if so did you add the hibernate plugin of the plugin running your test code.
gr. Martin
On 02/01/2013 03:18 PM, M B wrote:
> I create from example here rcp-vision_com: "Eclipse EMF: an out-of-the-box CRUD for a database".
> But I use H2 database.
> Database properties are next:
>
> // create the data store
> HbDataStore hbds = (HbDataStore) HbHelper.INSTANCE.createRegisterDataStore("MyDB");
>
> //Set Database properties
> Properties props = new Properties();
> props.setProperty(Environment.DRIVER, "org.h2.Driver");
> props.setProperty(Environment.URL, "jdbc:h2:~/test1");
> props.setProperty(Environment.USER, "sa");
> props.setProperty(Environment.PASS, "");
> props.setProperty(Environment.DIALECT, org.hibernate.dialect.H2Dialect.class.getName());
> props.setProperty(Environment.SHOW_SQL, "true");
> props.setProperty(Environment.HBM2DDL_AUTO, "update");
> // props.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
> hbds.setProperties(props);
>
> //Register EMF package in this datastore
> hbds.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>
> // initialize, also creates the database tables
> try {
> hbds.initialize();
> } finally {
> // print the generated mapping
> System.err.println(hbds.getMappingXML());
> }
>
> Have an error on initialize.
>
> Feb 01, 2013 2:16:20 PM org.eclipse.emf.teneo.hibernate.HbHelper createRegisterDataStore
> INFO: Creating emf data store and registering it under name: MyDB
> Feb 01, 2013 2:16:20 PM org.eclipse.emf.teneo.hibernate.HbHelper createRegisterDataStore
> INFO: Returning created emf data store, initialize this newly created data store!
> Feb 01, 2013 2:16:20 PM org.eclipse.emf.teneo.classloader.ClassLoaderResolver setClassLoaderStrategy
> INFO: Class loader strategy set to: org.eclipse.emf.teneo.classloader.ContextClassLoaderStrategy
> log4j:WARN No appenders could be found for logger (org.jboss.logging).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See ... for more info.
> ...
> !ENTRY org.eclipse.osgi 4 0 2013-02-01 14:16:20.924
> !MESSAGE Application error
> !STACK 1
> java.lang.NoClassDefFoundError: org/hibernate/cache/HashtableCacheProvider
> at org.eclipse.emf.teneo.hibernate.HbDataStore.setDefaultProperties(HbDataStore.java:403)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.setPropertiesInConfiguration(HbSessionDataStore.java:137)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:79)
> at library.presentation.LibraryEditorAdvisor.initialize(LibraryEditorAdvisor.java:589)
> ...
>
> Could you give me an advise?
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
| |
Re: [Teneo] QuickStart Tutorial fails to create tables [message #1006975 is a reply to message #1006857] |
Sun, 03 February 2013 13:18 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi MB,
Not sure, I don't recognize the line number from Teneo in the latest version. Which Teneo and which Hibernate version
are you using?
For the update sites of the latest versions:
http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install#Plugins_and_dependencies.2C_update_site_locations
gr. Martin
On 02/03/2013 12:57 AM, M B wrote:
> Thank you for the answer!
>
> Yes, I have installed all needed plugins (org.eclipse.emf.teneo.hibernate, org.hibernate, org.h2) and have added it in
> dependencies of *.editor/plugin.xml. Plugin for H2 I have created as Plugin from existing JAR and have added too.
> However I have this error on initialize().
>
> What can I check else?
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo] QuickStart Tutorial fails to create tables [message #1006976 is a reply to message #1006857] |
Sun, 03 February 2013 13:19 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi MB,
Not sure, I don't recognize the line number from Teneo in the latest version. Which Teneo and which Hibernate version
are you using?
For the update sites of the latest versions:
http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install#Plugins_and_dependencies.2C_update_site_locations
gr. Martin
On 02/03/2013 12:57 AM, M B wrote:
> Thank you for the answer!
>
> Yes, I have installed all needed plugins (org.eclipse.emf.teneo.hibernate, org.hibernate, org.h2) and have added it in
> dependencies of *.editor/plugin.xml. Plugin for H2 I have created as Plugin from existing JAR and have added too.
> However I have this error on initialize().
>
> What can I check else?
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
| |
Goto Forum:
Current Time: Sun Sep 22 08:55:37 GMT 2024
Powered by FUDForum. Page generated in 0.06287 seconds
|