Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » DataStore.initialize fails with eclipse.org/bpel - Model
DataStore.initialize fails with eclipse.org/bpel - Model [message #93680] Tue, 21 August 2007 11:53 Go to next message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Hi,

i have a problem with the generation of the hibernate-mapping file.
My model project is the standard Bpel-Model from www.eclipse.org/bpel/.

I use Eclipse 3.3 WTP. And teneo 0.8. The code of the DB initialization is:

public static void main(String[] args) {

final String dataStoreName = "bpel20";
final HbDataStore dataStore = (HbDataStore) HbHelper.INSTANCE
.createRegisterDataStore(dataStoreName);
Properties hibernateProperties = new Properties();
hibernateProperties.setProperty(Environment.DRIVER,
"com.mysql.jdbc.Driver");
hibernateProperties.setProperty(Environment.USER, "XXX");
hibernateProperties.setProperty(Environment.URL,
"jdbc:mysql://127.0.0.1:3306/bpel20");
hibernateProperties.setProperty(Environment.PASS, "XXX");
hibernateProperties.setProperty(Environment.DIALECT,
"org.hibernate.dialect.MySQLInnoDBDialect");

dataStore.setHibernateProperties(hibernateProperties);
// coonfig persistence options
Properties persistenceOptions = new Properties();

persistenceOptions.setProperty(PersistenceOptions.INHERITANC E_MAPPING,
"JOINED");
persistenceOptions.setProperty(
PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "true");
dataStore.setPersistenceProperties(persistenceOptions);
dataStore.setEPackages(new EPackage[] {
org.eclipse.bpel.model.BPELPackage.eINSTANCE });
dataStore.initialize();
}



I get an error at the dataStore initalization. The following error
occured:

(...)

[main] DEBUG org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator -
Creating mapping for eclass Process
1236 [main] DEBUG
org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator - Creating
mapping for eclass ExtensibleElement
Exception in thread "main" java.lang.IllegalArgumentException: No
annotated model element present for: ExtensibleElement for type EClass
has its epackage been registered with Teneo?
at
org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:322)
at
org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:268)
at
org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessClass(DefaultAnnotator.java:353)
at
org.eclipse.emf.teneo.hibernate.hbannotation.util.HibernateD efaultAnnotator.processClass(HibernateDefaultAnnotator.java: 178)
at
org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessClass(DefaultAnnotator.java:362)
at
org.eclipse.emf.teneo.hibernate.hbannotation.util.HibernateD efaultAnnotator.processClass(HibernateDefaultAnnotator.java: 178)
at
org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessPackage(DefaultAnnotator.java:319)
at
org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.ma p(DefaultAnnotator.java:210)
at
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:128)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:531)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:149)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
at test.MainTest.createDatabase(MainTest.java:27)
at test.MainTest.main(MainTest.java:19)


With kind regards

Daniel Gerlach
Re: DataStore.initialize fails with eclipse.org/bpel - Model [message #93696 is a reply to message #93680] Tue, 21 August 2007 14:27 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
I don't know the bpel package but Teneo seems to miss the epackage which contains the
ExtensibleElement eclass. You can try to also pass the epackage instance which contains this eclass
in the setEPackages call.

gr. Martin

daniel.gerlach1@gmx.de wrote:
> Hi,
>
> i have a problem with the generation of the hibernate-mapping file.
> My model project is the standard Bpel-Model from www.eclipse.org/bpel/.
>
> I use Eclipse 3.3 WTP. And teneo 0.8. The code of the DB initialization is:
>
> public static void main(String[] args) {
>
> final String dataStoreName = "bpel20";
> final HbDataStore dataStore = (HbDataStore) HbHelper.INSTANCE
> .createRegisterDataStore(dataStoreName);
> Properties hibernateProperties = new Properties();
> hibernateProperties.setProperty(Environment.DRIVER,
> "com.mysql.jdbc.Driver");
> hibernateProperties.setProperty(Environment.USER, "XXX");
> hibernateProperties.setProperty(Environment.URL,
> "jdbc:mysql://127.0.0.1:3306/bpel20");
> hibernateProperties.setProperty(Environment.PASS, "XXX");
> hibernateProperties.setProperty(Environment.DIALECT,
> "org.hibernate.dialect.MySQLInnoDBDialect");
>
> dataStore.setHibernateProperties(hibernateProperties);
> // coonfig persistence options
> Properties persistenceOptions = new Properties();
>
> persistenceOptions.setProperty(PersistenceOptions.INHERITANC E_MAPPING,
> "JOINED");
> persistenceOptions.setProperty(
> PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "true");
> dataStore.setPersistenceProperties(persistenceOptions);
> dataStore.setEPackages(new EPackage[] {
> org.eclipse.bpel.model.BPELPackage.eINSTANCE });
> dataStore.initialize();
> }
>
>
>
> I get an error at the dataStore initalization. The following error
> occured:
>
> (...)
>
> [main] DEBUG org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator -
> Creating mapping for eclass Process
> 1236 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator - Creating
> mapping for eclass ExtensibleElement
> Exception in thread "main" java.lang.IllegalArgumentException: No
> annotated model element present for: ExtensibleElement for type EClass
> has its epackage been registered with Teneo?
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:322)
>
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:268)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessClass(DefaultAnnotator.java:353)
>
> at
> org.eclipse.emf.teneo.hibernate.hbannotation.util.HibernateD efaultAnnotator.processClass(HibernateDefaultAnnotator.java: 178)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessClass(DefaultAnnotator.java:362)
>
> at
> org.eclipse.emf.teneo.hibernate.hbannotation.util.HibernateD efaultAnnotator.processClass(HibernateDefaultAnnotator.java: 178)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessPackage(DefaultAnnotator.java:319)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.ma p(DefaultAnnotator.java:210)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:128)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:531)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:149)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
>
> at test.MainTest.createDatabase(MainTest.java:27)
> at test.MainTest.main(MainTest.java:19)
>
>
> With kind regards
>
> Daniel Gerlach


--

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: DataStore.initialize fails with eclipse.org/bpel - Model [message #93772 is a reply to message #93696] Tue, 21 August 2007 17:26 Go to previous messageGo to next message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Hi,

now i tried the dataStore.setPackages() with all dependencies of the
eclipse bpel.model-project, this is XSDPackage, WSDLPackage etc.

BPELPackage bpel = BPELPackage.eINSTANCE;
PartnerlinktypePackage partnerLink = PartnerlinktypePackage.eINSTANCE;
MessagepropertiesPackage messageProperties =
MessagepropertiesPackage.eINSTANCE;
WSDLPackage wsdlPackage = WSDLPackage.eINSTANCE;
XSDPackage xsdPackage = XSDPackage.eINSTANCE;
dataStore.setEPackages(new EPackage[] { bpel, partnerLink,
messageProperties, wsdlPackage, xsdPackage });

Now it works but i get a "duplicate class error" for
"ExtensibleElement.class" because it emerges in the BPELPackage and the
WSDLPackage. Any suggestions?

Exception in thread "main" org.hibernate.DuplicateMappingException:
Duplicate class/entity mapping ExtensibleElement
at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
at org.hibernate.cfg.HbmBinder.handleJoinedSubclass(HbmBinder.j ava:2214)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
at org.hibernate.cfg.Configuration.add(Configuration.java:669)
at org.hibernate.cfg.Configuration.addXML(Configuration.java:44 0)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:150)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
at test.MainTest.createDatabase(MainTest.java:32)
at test.MainTest.main(MainTest.java:24)


With kind regards

Daniel Gerlach
Re: DataStore.initialize fails with eclipse.org/bpel - Model [message #93787 is a reply to message #93772] Tue, 21 August 2007 17:34 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
In this case you should set the EntityNameStrategy to make the entityname unique. See here:
http://www.elver.org/hibernate/extensions.html
and then the section on the EntityNameStrategy extensionpoint.

gr. Martin

Daniel Gerlach wrote:
> Hi,
> now i tried the dataStore.setPackages() with all dependencies of the
> eclipse bpel.model-project, this is XSDPackage, WSDLPackage etc.
>
> BPELPackage bpel = BPELPackage.eINSTANCE;
> PartnerlinktypePackage partnerLink =
> PartnerlinktypePackage.eINSTANCE;
> MessagepropertiesPackage messageProperties =
> MessagepropertiesPackage.eINSTANCE;
> WSDLPackage wsdlPackage = WSDLPackage.eINSTANCE;
> XSDPackage xsdPackage = XSDPackage.eINSTANCE;
> dataStore.setEPackages(new EPackage[] { bpel, partnerLink,
> messageProperties, wsdlPackage, xsdPackage });
>
> Now it works but i get a "duplicate class error" for
> "ExtensibleElement.class" because it emerges in the BPELPackage and the
> WSDLPackage. Any suggestions?
>
> Exception in thread "main" org.hibernate.DuplicateMappingException:
> Duplicate class/entity mapping ExtensibleElement
> at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
> at
> org.hibernate.cfg.HbmBinder.handleJoinedSubclass(HbmBinder.j ava:2214)
> at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
> at org.hibernate.cfg.Configuration.add(Configuration.java:669)
> at org.hibernate.cfg.Configuration.addXML(Configuration.java:44 0)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:150)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
>
> at test.MainTest.createDatabase(MainTest.java:32)
> at test.MainTest.main(MainTest.java:24)
>
>
> With kind regards
>
> Daniel Gerlach
>
>


--

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: DataStore.initialize fails with eclipse.org/bpel - Model [message #609490 is a reply to message #93680] Tue, 21 August 2007 14:27 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
I don't know the bpel package but Teneo seems to miss the epackage which contains the
ExtensibleElement eclass. You can try to also pass the epackage instance which contains this eclass
in the setEPackages call.

gr. Martin

daniel.gerlach1@gmx.de wrote:
> Hi,
>
> i have a problem with the generation of the hibernate-mapping file.
> My model project is the standard Bpel-Model from www.eclipse.org/bpel/.
>
> I use Eclipse 3.3 WTP. And teneo 0.8. The code of the DB initialization is:
>
> public static void main(String[] args) {
>
> final String dataStoreName = "bpel20";
> final HbDataStore dataStore = (HbDataStore) HbHelper.INSTANCE
> .createRegisterDataStore(dataStoreName);
> Properties hibernateProperties = new Properties();
> hibernateProperties.setProperty(Environment.DRIVER,
> "com.mysql.jdbc.Driver");
> hibernateProperties.setProperty(Environment.USER, "XXX");
> hibernateProperties.setProperty(Environment.URL,
> "jdbc:mysql://127.0.0.1:3306/bpel20");
> hibernateProperties.setProperty(Environment.PASS, "XXX");
> hibernateProperties.setProperty(Environment.DIALECT,
> "org.hibernate.dialect.MySQLInnoDBDialect");
>
> dataStore.setHibernateProperties(hibernateProperties);
> // coonfig persistence options
> Properties persistenceOptions = new Properties();
>
> persistenceOptions.setProperty(PersistenceOptions.INHERITANC E_MAPPING,
> "JOINED");
> persistenceOptions.setProperty(
> PersistenceOptions.FETCH_CONTAINMENT_EAGERLY, "true");
> dataStore.setPersistenceProperties(persistenceOptions);
> dataStore.setEPackages(new EPackage[] {
> org.eclipse.bpel.model.BPELPackage.eINSTANCE });
> dataStore.initialize();
> }
>
>
>
> I get an error at the dataStore initalization. The following error
> occured:
>
> (...)
>
> [main] DEBUG org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator -
> Creating mapping for eclass Process
> 1236 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator - Creating
> mapping for eclass ExtensibleElement
> Exception in thread "main" java.lang.IllegalArgumentException: No
> annotated model element present for: ExtensibleElement for type EClass
> has its epackage been registered with Teneo?
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.checkAnnotatedPresent(PAnnotatedModelImpl.java:322)
>
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getPAnnotated(PAnnotatedModelImpl.java:268)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessClass(DefaultAnnotator.java:353)
>
> at
> org.eclipse.emf.teneo.hibernate.hbannotation.util.HibernateD efaultAnnotator.processClass(HibernateDefaultAnnotator.java: 178)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessClass(DefaultAnnotator.java:362)
>
> at
> org.eclipse.emf.teneo.hibernate.hbannotation.util.HibernateD efaultAnnotator.processClass(HibernateDefaultAnnotator.java: 178)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.pr ocessPackage(DefaultAnnotator.java:319)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.DefaultAnnotator.ma p(DefaultAnnotator.java:210)
>
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:128)
>
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:531)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:149)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
>
> at test.MainTest.createDatabase(MainTest.java:27)
> at test.MainTest.main(MainTest.java:19)
>
>
> With kind regards
>
> Daniel Gerlach


--

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: DataStore.initialize fails with eclipse.org/bpel - Model [message #609495 is a reply to message #93696] Tue, 21 August 2007 17:26 Go to previous message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Hi,

now i tried the dataStore.setPackages() with all dependencies of the
eclipse bpel.model-project, this is XSDPackage, WSDLPackage etc.

BPELPackage bpel = BPELPackage.eINSTANCE;
PartnerlinktypePackage partnerLink = PartnerlinktypePackage.eINSTANCE;
MessagepropertiesPackage messageProperties =
MessagepropertiesPackage.eINSTANCE;
WSDLPackage wsdlPackage = WSDLPackage.eINSTANCE;
XSDPackage xsdPackage = XSDPackage.eINSTANCE;
dataStore.setEPackages(new EPackage[] { bpel, partnerLink,
messageProperties, wsdlPackage, xsdPackage });

Now it works but i get a "duplicate class error" for
"ExtensibleElement.class" because it emerges in the BPELPackage and the
WSDLPackage. Any suggestions?

Exception in thread "main" org.hibernate.DuplicateMappingException:
Duplicate class/entity mapping ExtensibleElement
at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
at org.hibernate.cfg.HbmBinder.handleJoinedSubclass(HbmBinder.j ava:2214)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
at org.hibernate.cfg.Configuration.add(Configuration.java:669)
at org.hibernate.cfg.Configuration.addXML(Configuration.java:44 0)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:150)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
at test.MainTest.createDatabase(MainTest.java:32)
at test.MainTest.main(MainTest.java:24)


With kind regards

Daniel Gerlach
Re: DataStore.initialize fails with eclipse.org/bpel - Model [message #609496 is a reply to message #93772] Tue, 21 August 2007 17:34 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
In this case you should set the EntityNameStrategy to make the entityname unique. See here:
http://www.elver.org/hibernate/extensions.html
and then the section on the EntityNameStrategy extensionpoint.

gr. Martin

Daniel Gerlach wrote:
> Hi,
> now i tried the dataStore.setPackages() with all dependencies of the
> eclipse bpel.model-project, this is XSDPackage, WSDLPackage etc.
>
> BPELPackage bpel = BPELPackage.eINSTANCE;
> PartnerlinktypePackage partnerLink =
> PartnerlinktypePackage.eINSTANCE;
> MessagepropertiesPackage messageProperties =
> MessagepropertiesPackage.eINSTANCE;
> WSDLPackage wsdlPackage = WSDLPackage.eINSTANCE;
> XSDPackage xsdPackage = XSDPackage.eINSTANCE;
> dataStore.setEPackages(new EPackage[] { bpel, partnerLink,
> messageProperties, wsdlPackage, xsdPackage });
>
> Now it works but i get a "duplicate class error" for
> "ExtensibleElement.class" because it emerges in the BPELPackage and the
> WSDLPackage. Any suggestions?
>
> Exception in thread "main" org.hibernate.DuplicateMappingException:
> Duplicate class/entity mapping ExtensibleElement
> at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
> at
> org.hibernate.cfg.HbmBinder.handleJoinedSubclass(HbmBinder.j ava:2214)
> at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
> at org.hibernate.cfg.Configuration.add(Configuration.java:669)
> at org.hibernate.cfg.Configuration.addXML(Configuration.java:44 0)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:150)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:70)
>
> at test.MainTest.createDatabase(MainTest.java:32)
> at test.MainTest.main(MainTest.java:24)
>
>
> With kind regards
>
> Daniel Gerlach
>
>


--

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:DataStore.initialize fails with eclipse.org/bpel - Model
Next Topic:[Teneo] Illegal Argument Exception saving null object enumeration
Goto Forum:
  


Current Time: Sat Apr 20 06:29:35 GMT 2024

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

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

Back to the top