Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » GMF mindmap example problem
GMF mindmap example problem [message #105723] Thu, 03 January 2008 11:00 Go to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Hello,
I have tried to repeat a tutorial which is described at
http://www.elver.org/hibernate/gmftutorial/tutorial1.html

the difference is that I use my own ecore model.

when I arrive to the step Running the diagram :
http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
when I right clic on my teneo.mindmap file, the action "initialise ....
diagram file" is not present in the context menu.

any one can tell me why?

thanks by advance
fred
Re: GMF mindmap example problem [message #105785 is a reply to message #105723] Thu, 03 January 2008 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------020608020704060300040802
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Fred,

My guess would be that you don't have GMF's Ecore Diagram Editor
*example *installed. Note that there is now an EMFT Ecore Tools
component (http://www.eclipse.org/modeling/emft/?project=ecoretools)
that's producing a diagram editor which is more than just an example.
Testing it and reporting problems will be very helpful...


fred wrote:
> Hello,
> I have tried to repeat a tutorial which is described at
> http://www.elver.org/hibernate/gmftutorial/tutorial1.html
>
> the difference is that I use my own ecore model.
>
> when I arrive to the step Running the diagram :
> http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
>
> when I right clic on my teneo.mindmap file, the action "initialise
> .... diagram file" is not present in the context menu.
>
> any one can tell me why?
>
> thanks by advance
> fred
>


--------------020608020704060300040802
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Fred,<br>
<br>
My guess would be that you don't have GMF's Ecore Diagram Editor <b>example
</b>installed.
Re: GMF mindmap example problem [message #105794 is a reply to message #105785] Thu, 03 January 2008 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

I've tried to install ecore tools but the problem persists.
which information can I give you to find the problem?

Or if it's possible to find other solution, my guess is to connect my gmf
diagram (which seems to work correctly) with a database using hibernate
(all work done with GMF have to be stored in database : objects,
relations, ...)

till now, I have done :
- created my exemple.ecore (here I have the context menu "initialize
ecore_diagram diagram file")
- generated the exemple.genmodel
|-> generate the model code
|-> generate the edit code
- generated the exemple.gmfgraph
- generated the exemple.gmftool
- generated the exemple.gmfgraph
- generated the exemple.gmfgen
|-> generate the diagram code

before the diagram code generation, I have added :
dependencies :
org.eclipse.emf.teneo
org.eclipse.emf.teneo.annotations
org.eclipse.emf.teneo.hibernate
org.eclipse.emf.teneo.hibernate.mapper

extensions :
org.eclipse.emf.ecore.extension_parser
class
" org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory "
type="mindmap"


now in my package explorer I have 2 projects :
- prototypage (it contains the model, the generate model code and the
generate edit code)
- prototypage.diagram (it contains the diagram code)

with teneo I have generated the hibernate.hbm.xml which seems to be fully
completed

to finished, I have created a new project called "teneo GMF test" in which
i have placed a directory called "original" containing the file
"teneo.mindmap"
when I right clic on this file, I don't have the context menu "initialise
mindmap_diagram diagram file" at the oposite of what is discribed in
tutorial here :
http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
Re: GMF mindmap example problem [message #105808 is a reply to message #105794] Thu, 03 January 2008 13:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Fred,

I assumed you were trying to initialize a diagram for the .ecore file.
Sorry.

I think that action should be coming from the generated wizard. But if
you used your own model, will the file extension it expects really be
mindmap? I'd expect prototypage is more likely the extension for your
model's resource and that likely the wizard is registered for that type
of file...


fred wrote:
> I've tried to install ecore tools but the problem persists.
> which information can I give you to find the problem?
>
> Or if it's possible to find other solution, my guess is to connect my
> gmf diagram (which seems to work correctly) with a database using
> hibernate (all work done with GMF have to be stored in database :
> objects, relations, ...)
>
> till now, I have done :
> - created my exemple.ecore (here I have the context menu "initialize
> ecore_diagram diagram file")
> - generated the exemple.genmodel
> |-> generate the model code
> |-> generate the edit code
> - generated the exemple.gmfgraph
> - generated the exemple.gmftool
> - generated the exemple.gmfgraph
> - generated the exemple.gmfgen
> |-> generate the diagram code
>
> before the diagram code generation, I have added :
> dependencies : org.eclipse.emf.teneo
> org.eclipse.emf.teneo.annotations
> org.eclipse.emf.teneo.hibernate
> org.eclipse.emf.teneo.hibernate.mapper
>
> extensions :
> org.eclipse.emf.ecore.extension_parser
> class
> " org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory "
> type="mindmap"
>
>
> now in my package explorer I have 2 projects :
> - prototypage (it contains the model, the generate model code and
> the generate edit code)
> - prototypage.diagram (it contains the diagram code)
>
> with teneo I have generated the hibernate.hbm.xml which seems to be
> fully completed
> to finished, I have created a new project called "teneo GMF test" in
> which i have placed a directory called "original" containing the file
> "teneo.mindmap"
> when I right clic on this file, I don't have the context menu
> "initialise mindmap_diagram diagram file" at the oposite of what is
> discribed in tutorial here :
> http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
>
>
>
>
Re: GMF mindmap example problem [message #105821 is a reply to message #105808] Thu, 03 January 2008 14:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

ok It's possible my extension wasn't correct.
It seems that it isn't Prototypage

where did this extension is defined?
I thought it was the type definied in extension emf.ecore.extension_parser
Re: GMF mindmap example problem [message #105833 is a reply to message #105821] Thu, 03 January 2008 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Fred,

Yes, that's what I'd expect (but if you've just got a model without a
specified resource type for the package you'll just get the default XMI
resource factory registered for the default extension and then there
won't be a plugin.xml registration for your extension). It's also
important to look at the wizard itself and see what's it's registered
against in the plugin.xml...


fred wrote:
> ok It's possible my extension wasn't correct. It seems that it isn't
> Prototypage
> where did this extension is defined?
> I thought it was the type definied in extension
> emf.ecore.extension_parser
>
Re: GMF mindmap example problem [message #105846 is a reply to message #105833] Thu, 03 January 2008 15:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

I don't really understand where to see...?

>if you've just got a model without a specified resource type for the package
>you'll just get the default XMI resource factory registered for the default
>extension and then there won't be a plugin.xml registration for your
>extension).
What should be verified?

>It's also important to look at the wizard itself
???

>and see what's it's registered against in the plugin.xml...
this is my plugin.xml where we can see the type "mindmap for the
ecore.extension_parser :

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
<copyright>
</copyright>

$Id$
-->

<plugin>

<extension
point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<factory
uri = "http://"
class = "DataModel.provider.DataModelItemProviderAdapterFactory"
supportedTypes =
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource" />
</extension>

<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://"
class = "DataModel.DataModelPackage"
genModel = "model/Exemple.genmodel" />
</extension>
<extension
point="org.eclipse.emf.ecore.extension_parser">
<parser

class=" org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory "
type="mindmap">
</parser>
</extension>

</plugin>
Re: GMF mindmap example problem [message #105859 is a reply to message #105821] Thu, 03 January 2008 16:00 Go to previous messageGo to next message
Jacques LESCOT is currently offline Jacques LESCOTFriend
Messages: 247
Registered: July 2009
Senior Member
In your *.gmfgen file, at the root element (GenEditorGenerator) you
should ensure that your "Domain File Extension" property is correctly
set as "mindmap" instead of "prototypage" as Ed suggested.
You can also modify the "Diagram File Extension" corresponding to the
extension of your diagram file.
For more informations about these properties :
http://wiki.eclipse.org/GMF_GenModel_Hints

fred a écrit :
> ok It's possible my extension wasn't correct. It seems that it isn't
> Prototypage
> where did this extension is defined?
> I thought it was the type definied in extension emf.ecore.extension_parser
>
Re: GMF mindmap example problem [message #105888 is a reply to message #105859] Thu, 03 January 2008 18:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

I have try all you're saying but I never arrived to make it good.

Thanks for your help but I really don't find the problem.
did anyone can give me an example of working project or can try to see the
mine?

I really need to make it function because it's for my job...
I can send It by mail or give my mail for someone send an example to me.

Thanks by advance

fred
Re: GMF mindmap example problem [message #105902 is a reply to message #105888] Thu, 03 January 2008 19:03 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fred,
Sorry to react so late on this. I need to look at the gmf integration again to check if it works
correctly with Teneo (see also the remark in the beginning of the tutorial on elver.org). I have
very little experience with gmf so it is difficult for me to answer your specific question.

You can search the newsgroup for teneo and gmf, this will show other gmf/teneo questions. For example:
http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg02457.html

Please also note this post with a link to an issue when storing the diagram itself:
http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.modeli ng.gmf/msg05667.html

I know that someone else stored the diagram as a blob in the db.

I need to look again at this integration anyway, if it helps you I can look at this early next week.

gr. Martin

fred wrote:
> I have try all you're saying but I never arrived to make it good.
>
> Thanks for your help but I really don't find the problem.
> did anyone can give me an example of working project or can try to see
> the mine?
>
> I really need to make it function because it's for my job...
> I can send It by mail or give my mail for someone send an example to me.
>
> Thanks by advance
>
> fred
>


--

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: GMF mindmap example problem [message #105930 is a reply to message #105902] Fri, 04 January 2008 09:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Hy everybody

I think my problem is different than what I expect.
I have restarted all my work and in spite of use my own ecore model, I use
the mindmap.ecore to try the real tutorial..

I think that there is somethink I haven't understood.
I succeded on realize an RCP but I failed in realize a plugin.

What did I have to do to make the plugin once I have generated the diagram
code?
I have 3 project in my workspace : mindmap, mindmap.edit and
mindmap.diagram.
but I haven't the mindmap diagram in the new project dialog list as
discribed in the tutorial :
> Create an empty project and invoke the New... dialog (Ctrl+N).
>Under 'Examples' you'll notice your new Mindmap Diagram.

anyone idea?
thanks by advance
fred
Re: GMF mindmap example problem [message #105958 is a reply to message #105930] Fri, 04 January 2008 11:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Fred,

Have a look in the plugin.xml for the *.diagram project. Look for the
wizards that are registered in it and try to determine for what file
extension it's registered. Maybe if you snip the wizard's registration
here someone will see what's going astray. Also, when you start up your
runtime workbench, you might want to use -consolelog and -debug as
arguments and have a very close look at the Error Log view in the
runtime workbench for error messages about plugins that aren't activated
for whatever reason. You might want to clear the error log view and run
it a second time to get a fresh batch of output for it...


fred wrote:
> Hy everybody
>
> I think my problem is different than what I expect.
> I have restarted all my work and in spite of use my own ecore model, I
> use the mindmap.ecore to try the real tutorial..
>
> I think that there is somethink I haven't understood.
> I succeded on realize an RCP but I failed in realize a plugin.
>
> What did I have to do to make the plugin once I have generated the
> diagram code?
> I have 3 project in my workspace : mindmap, mindmap.edit and
> mindmap.diagram.
> but I haven't the mindmap diagram in the new project dialog list as
> discribed in the tutorial :
>> Create an empty project and invoke the New... dialog (Ctrl+N). Under
>> 'Examples' you'll notice your new Mindmap Diagram.
>
> anyone idea?
> thanks by advance
> fred
>
Re: GMF mindmap example problem [message #105991 is a reply to message #105930] Fri, 04 January 2008 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

that's ok, thank's a lot
now I have my context menu on my "teneo.epy" file.
I don't really know what have changed but the context menu is present now

but now when I clic on the menu "initialize epydiag diagram file", nothing
happend...
no exception, no wizard, ...
any idea?
Re: GMF mindmap example problem [message #105999 is a reply to message #105991] Fri, 04 January 2008 11:41 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Does the error or problem view show something?

gr. Martin

fred wrote:
> that's ok, thank's a lot
> now I have my context menu on my "teneo.epy" file.
> I don't really know what have changed but the context menu is present now
>
> but now when I clic on the menu "initialize epydiag diagram file",
> nothing happend...
> no exception, no wizard, ...
> any idea?
>


--

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: GMF mindmap example problem [message #106012 is a reply to message #105999] Fri, 04 January 2008 12:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Yes, an eror occured :

Message : Unhandled event loop exception
plug-in : org.eclipse.ui

exception stack trace :
java.lang.NoClassDefFoundError: org/hibernate/property/PropertyAccessor
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.<init >(HibernateResource.java:123)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory.createResource(HibernateResourceFactory.java:36)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:418)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCr eateResource(ResourceSetImpl.java:240)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:392)
at
DataModel.diagram.part.ExempleInitDiagramFileAction.run(Exem pleInitDiagramFileAction.java:76)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:256)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Re: GMF mindmap example problem [message #106026 is a reply to message #106012] Fri, 04 January 2008 12:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

for more information about the exception
It appears when I launch "initialize epydiag diagram file" on my file
"teneo.epy"

teneo.epy content :
name=Exemple
nsuri=http://
dbname=XXXXX
dburl=jdbc:oracle:thin//xxxxxxx.xxxxxx.xx:1521:FVA001
dbdialect=org.hibernate.dialect.OracleDialect
dbuser=XXXXXXX
dbpassword=XXXXXXX
dbdriver=oracle.jdbc.driver.OracleDriver




the XXXXXX is just to mask the real values
Re: GMF mindmap example problem [message #106035 is a reply to message #106026] Fri, 04 January 2008 12:42 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Did you place the hibernate jars in a separate plugin and set the buddypolicy to dependent?
And added the hibernate plugin it in the model/editor plugins?

gr. Martin

fred wrote:
> for more information about the exception
> It appears when I launch "initialize epydiag diagram file" on my file
> "teneo.epy"
>
> teneo.epy content :
> name=Exemple
> nsuri=http://
> dbname=XXXXX
> dburl=jdbc:oracle:thin//xxxxxxx.xxxxxx.xx:1521:FVA001
> dbdialect=org.hibernate.dialect.OracleDialect
> dbuser=XXXXXXX
> dbpassword=XXXXXXX
> dbdriver=oracle.jdbc.driver.OracleDriver
>
>
>
>
> the XXXXXX is just to mask the real values
>


--

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: GMF mindmap example problem [message #106129 is a reply to message #106035] Fri, 04 January 2008 16:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

- the first time, I have added all library at the model project properties
(java build path --> library)

- now I have removed all those library from there, I have created a new
plugin project from existing jar (I called it hibernateplug), I have added
all hibernate jar to this plugin and in the manifest I have added :
> Eclipse-BuddyPolicy: dependent
then I have added the plugin hibernateplug in the model project properties
(java build path --> projects)

I have also added the hibernate plugin in the model plugins dependencies

But I still have the same error when I launch the "initialize epydiag file
diagram" on my teneo.epy file :

Message : Unhandled event loop exception
plug-in : org.eclipse.ui

exception stack trace :
java.lang.NoClassDefFoundError: org/hibernate/property/PropertyAccessor
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.<init >(HibernateResource.java:123)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory.createResource(HibernateResourceFactory.java:36)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:418)
at ...
Re: GMF mindmap example problem [message #106142 is a reply to message #106129] Fri, 04 January 2008 16:44 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
You should only specify the dependencies in the model plugin dependencies and not in the project
properties.

Did you set the dependency in the model plugin dependency on reexport=true? (right click on the
dependency to set this).

gr. Martin

fred wrote:
> - the first time, I have added all library at the model project
> properties (java build path --> library)
>
> - now I have removed all those library from there, I have created a new
> plugin project from existing jar (I called it hibernateplug), I have
> added all hibernate jar to this plugin and in the manifest I have added :
>> Eclipse-BuddyPolicy: dependent
> then I have added the plugin hibernateplug in the model project
> properties (java build path --> projects)
>
> I have also added the hibernate plugin in the model plugins dependencies
>
> But I still have the same error when I launch the "initialize epydiag
> file diagram" on my teneo.epy file :
>
> Message : Unhandled event loop exception
> plug-in : org.eclipse.ui
>
> exception stack trace :
> java.lang.NoClassDefFoundError: org/hibernate/property/PropertyAccessor
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.<init >(HibernateResource.java:123)
>
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory.createResource(HibernateResourceFactory.java:36)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:418)
>
> at ...
>


--

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: GMF mindmap example problem [message #106314 is a reply to message #106142] Mon, 07 January 2008 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Ok I think my problem is related with the hibernate libraries.

It is specified in the tutorial (as you said) that the hibernate libraries
should be installed in a separated plugin
I've downloaded the hibernate zip file called hibernate-3.2.5.ga.zip and
unzipped in a separated folder.
what did I have to do to make it reconized by eclipse as a separated
plugin? (perhaps waht I've done is not what should be done...)

Thank's by advance for your help
Re: GMF mindmap example problem [message #106326 is a reply to message #106314] Mon, 07 January 2008 11:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
1) In eclipse, do new-project
2) in the plugin development submenu choose plugin from existing jar files
select the jar files from the hibernate zip file (hibernate3.jar and the ones in the lib
subdirectory, you don't need them all but to be save just select them all)
3) in the next step name the project, uncheck the unzip jar archives (not necessary but for me it is
better to have the jars packed)
4) finish the wizard, the hibernate plugin should now be created
5) in the manifest.mf of the hibernate plugin set the eclipse buddy policy to dependent (see here:
http://www.elver.org/hibernate/installation.html#Hibernate+L ibraries)
6) in the model project, add the hibernate plugin project as a dependency in the manifest.mf
(dependencies tab), in this tab, right click on the hibernate plugin dependency, select properties
and check 'reexport this dependency'

gr. Martin

fred wrote:
> Ok I think my problem is related with the hibernate libraries.
>
> It is specified in the tutorial (as you said) that the hibernate
> libraries should be installed in a separated plugin
> I've downloaded the hibernate zip file called hibernate-3.2.5.ga.zip and
> unzipped in a separated folder.
> what did I have to do to make it reconized by eclipse as a separated
> plugin? (perhaps waht I've done is not what should be done...)
>
> Thank's by advance for your help
>


--

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: GMF mindmap example problem [message #106394 is a reply to message #106326] Mon, 07 January 2008 15:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

thanks a lot, it's ok for this part.

I've resolved some little problems but now I connect to the database and
tables are created.

But a new problem occurs (it would have been too easy :p )
just after having created the tables, a new exception occured.
The file teneo.mindmap_diagram is not created and the diagram application
is not started.
in the console, I see this (it's just the last lines) :

2281 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
completion
2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively
releasing JDBC connection
2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC
connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets:
0, globally: 0)]
2281 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider
- returning connection to pool, pool size: 1
2281 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
completion

in the Error log I see this :
Unhandled event loop exception
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBounds Exception:
index=0, size=0
at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 35)
at
DataModel.diagram.part.ExempleInitDiagramFileAction.run(Exem pleInitDiagramFileAction.java:77)
Re: GMF mindmap example problem [message #106559 is a reply to message #106394] Tue, 08 January 2008 05:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I need to look at this in more detail to see what goes wrong here. Do you use a small test model? If
so can you send it to me? I will have time this evening or tomorrow to look at this further.

gr. Martin

fred wrote:
> thanks a lot, it's ok for this part.
>
> I've resolved some little problems but now I connect to the database and
> tables are created.
>
> But a new problem occurs (it would have been too easy :p )
> just after having created the tables, a new exception occured.
> The file teneo.mindmap_diagram is not created and the diagram
> application is not started.
> in the console, I see this (it's just the last lines) :
>
> 2281 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
> completion
> 2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively
> releasing JDBC connection
> 2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC
> connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets:
> 0, globally: 0)]
> 2281 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - returning
> connection to pool, pool size: 1
> 2281 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
> completion
>
> in the Error log I see this :
> Unhandled event loop exception
> org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBounds Exception:
> index=0, size=0
> at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 35)
> at
> DataModel.diagram.part.ExempleInitDiagramFileAction.run(Exem pleInitDiagramFileAction.java:77)
>
>
>


--

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: GMF mindmap example problem [message #106573 is a reply to message #106559] Tue, 08 January 2008 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

ok my model is very small, I can give it to you!
thank's a lot for your help

you want I'll give you my model : the ecore file only?
or the other files too (genmodel, gmfmap, gmfgraph, gmftool, gmfgen)?
I send all this to you by mail?
Re: GMF mindmap example problem [message #106587 is a reply to message #106573] Tue, 08 January 2008 17:17 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
You can send it to me by email. The ecore file would be enough, I can generate the other files from
there (afaik).

gr. Martin

fred wrote:
> ok my model is very small, I can give it to you! thank's a lot for your
> help
>
> you want I'll give you my model : the ecore file only? or the other
> files too (genmodel, gmfmap, gmfgraph, gmftool, gmfgen)?
> I send all this to you by mail?
>
>


--

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: GMF mindmap example problem [message #106600 is a reply to message #106587] Tue, 08 January 2008 18:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

I'll send you my model when i'll had you mail ;-)
thanks for your help :)

There is one point I haven't done before : I'haven't added the code
specified here :
http://elver.org/hibernate/gmftutorial/tutorial2.html#Ensure +that+the+resource+has+at+least+one+root+object

Now it'is done. my code is like that :

public void run(IAction action) {
// Added for Teneo tutorial
// This part is only required to ensure that the resource at least has one
root element
// This is only for demo purposes.
try {
ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(domainModelURI,true);
if (resource.getContents().size() == 0) {
Tournoi map = DataModelFactory.eINSTANCE.createTournoi();
// map.setTitle("GMF - Teneo");
resource.getContents().add(map);
resource.save(Collections.EMPTY_MAP);
}
resource.unload();
} catch (IOException ex) {
ExempleDiagramEditorPlugin
.getInstance()
.logError("Unable to load resource: " + domainModelURI.toString(),
ex); //$NON-NLS-1$
}
// Added for Teneo tutorial


TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
.createEditingDomain();
ResourceSet resourceSet = editingDomain.getResourceSet();
EObject diagramRoot = null;
try {
/************/
Resource resource = resourceSet.getResource(domainModelURI, true);
/************/
diagramRoot = (EObject) resource.getContents().get(0);
} catch (WrappedException ex) {
DataModel.diagram.part.ExempleDiagramEditorPlugin.getInstanc e()
.logError("Unable to load resource: " + domainModelURI, ex);
//$NON-NLS-1$
}
if (diagramRoot == null) {
MessageDialog.openError(getShell(),
DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogTitle,
DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogMessage);
return;
}
Wizard wizard = new DataModel.diagram.part.ExempleNewDiagramFileWizard(
domainModelURI, diagramRoot, editingDomain);
wizard
.setWindowTitle(NLS
.bind(
DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileWizardTitle,
DataModel.diagram.edit.parts.TournoiEditPart.MODEL_ID));
DataModel.diagram.part.ExempleDiagramEditorUtil.runWizard(ge tShell(),
wizard, "InitDiagramFile"); //$NON-NLS-1$
}

a new error occured :
>java.lang.IllegalStateException: Cannot modify resource set without a write
transaction
>at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:322)
>at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:284)
...


it occured when executing code between /************/ and /************/

I don't know if it can give to you an idea to find the problem :-/
Re: GMF mindmap example problem [message #106618 is a reply to message #106600] Tue, 08 January 2008 19:00 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
It is: mtaal@elver.org.

For the issue you mention below, can you check out this thread and see if it helps to solve your issue:
http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg02447.html

Can you let me know if this helped?

gr. Martin

fred wrote:
> I'll send you my model when i'll had you mail ;-)
> thanks for your help :)
>
> There is one point I haven't done before : I'haven't added the code
> specified here :
> http://elver.org/hibernate/gmftutorial/tutorial2.html#Ensure +that+the+resource+has+at+least+one+root+object
>
>
> Now it'is done. my code is like that :
> public void run(IAction action) {
> // Added for Teneo tutorial
> // This part is only required to ensure that the resource at least has
> one root element
> // This is only for demo purposes.
> try {
> ResourceSet rs = new ResourceSetImpl();
> Resource resource = rs.getResource(domainModelURI,true);
> if (resource.getContents().size() == 0) {
> Tournoi map = DataModelFactory.eINSTANCE.createTournoi();
> // map.setTitle("GMF - Teneo");
> resource.getContents().add(map);
> resource.save(Collections.EMPTY_MAP);
> }
> resource.unload();
> } catch (IOException ex) {
> ExempleDiagramEditorPlugin
> .getInstance()
> .logError("Unable to load resource: " + domainModelURI.toString(),
> ex); //$NON-NLS-1$
> }
> // Added for Teneo tutorial
>
>
> TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
> .createEditingDomain();
> ResourceSet resourceSet = editingDomain.getResourceSet();
> EObject diagramRoot = null;
> try {
> /************/
> Resource resource = resourceSet.getResource(domainModelURI, true);
> /************/
> diagramRoot = (EObject) resource.getContents().get(0);
> } catch (WrappedException ex) {
> DataModel.diagram.part.ExempleDiagramEditorPlugin.getInstanc e()
> .logError("Unable to load resource: " + domainModelURI, ex);
> //$NON-NLS-1$
> }
> if (diagramRoot == null) {
> MessageDialog.openError(getShell(),
> DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogTitle,
>
> DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogMessage);
>
> return;
> }
> Wizard wizard = new DataModel.diagram.part.ExempleNewDiagramFileWizard(
> domainModelURI, diagramRoot, editingDomain);
> wizard
> .setWindowTitle(NLS
> .bind(
> DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileWizardTitle,
>
> DataModel.diagram.edit.parts.TournoiEditPart.MODEL_ID));
> DataModel.diagram.part.ExempleDiagramEditorUtil.runWizard(ge tShell(),
> wizard, "InitDiagramFile"); //$NON-NLS-1$
> }
>
> a new error occured :
>> java.lang.IllegalStateException: Cannot modify resource set without a
>> write
> transaction
>> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:322)
>
>> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:284)
>
> ...
>
>
> it occured when executing code between /************/ and /************/
>
> I don't know if it can give to you an idea to find the problem :-/
>
>
>


--

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: GMF mindmap example problem [message #613069 is a reply to message #105723] Thu, 03 January 2008 12:23 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31548
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020608020704060300040802
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Fred,

My guess would be that you don't have GMF's Ecore Diagram Editor
*example *installed. Note that there is now an EMFT Ecore Tools
component (http://www.eclipse.org/modeling/emft/?project=ecoretools)
that's producing a diagram editor which is more than just an example.
Testing it and reporting problems will be very helpful...


fred wrote:
> Hello,
> I have tried to repeat a tutorial which is described at
> http://www.elver.org/hibernate/gmftutorial/tutorial1.html
>
> the difference is that I use my own ecore model.
>
> when I arrive to the step Running the diagram :
> http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
>
> when I right clic on my teneo.mindmap file, the action "initialise
> .... diagram file" is not present in the context menu.
>
> any one can tell me why?
>
> thanks by advance
> fred
>


--------------020608020704060300040802
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Fred,<br>
<br>
My guess would be that you don't have GMF's Ecore Diagram Editor <b>example
</b>installed.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF mindmap example problem [message #613070 is a reply to message #105785] Thu, 03 January 2008 13:40 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
I've tried to install ecore tools but the problem persists.
which information can I give you to find the problem?

Or if it's possible to find other solution, my guess is to connect my gmf
diagram (which seems to work correctly) with a database using hibernate
(all work done with GMF have to be stored in database : objects,
relations, ...)

till now, I have done :
- created my exemple.ecore (here I have the context menu "initialize
ecore_diagram diagram file")
- generated the exemple.genmodel
|-> generate the model code
|-> generate the edit code
- generated the exemple.gmfgraph
- generated the exemple.gmftool
- generated the exemple.gmfgraph
- generated the exemple.gmfgen
|-> generate the diagram code

before the diagram code generation, I have added :
dependencies :
org.eclipse.emf.teneo
org.eclipse.emf.teneo.annotations
org.eclipse.emf.teneo.hibernate
org.eclipse.emf.teneo.hibernate.mapper

extensions :
org.eclipse.emf.ecore.extension_parser
class
" org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory "
type="mindmap"


now in my package explorer I have 2 projects :
- prototypage (it contains the model, the generate model code and the
generate edit code)
- prototypage.diagram (it contains the diagram code)

with teneo I have generated the hibernate.hbm.xml which seems to be fully
completed

to finished, I have created a new project called "teneo GMF test" in which
i have placed a directory called "original" containing the file
"teneo.mindmap"
when I right clic on this file, I don't have the context menu "initialise
mindmap_diagram diagram file" at the oposite of what is discribed in
tutorial here :
http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
Re: GMF mindmap example problem [message #613071 is a reply to message #105794] Thu, 03 January 2008 13:56 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31548
Registered: July 2009
Senior Member
Fred,

I assumed you were trying to initialize a diagram for the .ecore file.
Sorry.

I think that action should be coming from the generated wizard. But if
you used your own model, will the file extension it expects really be
mindmap? I'd expect prototypage is more likely the extension for your
model's resource and that likely the wizard is registered for that type
of file...


fred wrote:
> I've tried to install ecore tools but the problem persists.
> which information can I give you to find the problem?
>
> Or if it's possible to find other solution, my guess is to connect my
> gmf diagram (which seems to work correctly) with a database using
> hibernate (all work done with GMF have to be stored in database :
> objects, relations, ...)
>
> till now, I have done :
> - created my exemple.ecore (here I have the context menu "initialize
> ecore_diagram diagram file")
> - generated the exemple.genmodel
> |-> generate the model code
> |-> generate the edit code
> - generated the exemple.gmfgraph
> - generated the exemple.gmftool
> - generated the exemple.gmfgraph
> - generated the exemple.gmfgen
> |-> generate the diagram code
>
> before the diagram code generation, I have added :
> dependencies : org.eclipse.emf.teneo
> org.eclipse.emf.teneo.annotations
> org.eclipse.emf.teneo.hibernate
> org.eclipse.emf.teneo.hibernate.mapper
>
> extensions :
> org.eclipse.emf.ecore.extension_parser
> class
> " org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory "
> type="mindmap"
>
>
> now in my package explorer I have 2 projects :
> - prototypage (it contains the model, the generate model code and
> the generate edit code)
> - prototypage.diagram (it contains the diagram code)
>
> with teneo I have generated the hibernate.hbm.xml which seems to be
> fully completed
> to finished, I have created a new project called "teneo GMF test" in
> which i have placed a directory called "original" containing the file
> "teneo.mindmap"
> when I right clic on this file, I don't have the context menu
> "initialise mindmap_diagram diagram file" at the oposite of what is
> discribed in tutorial here :
> http://www.elver.org/hibernate/gmftutorial/tutorial3.html#Ru nning+the+diagram
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF mindmap example problem [message #613072 is a reply to message #105808] Thu, 03 January 2008 14:02 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
ok It's possible my extension wasn't correct.
It seems that it isn't Prototypage

where did this extension is defined?
I thought it was the type definied in extension emf.ecore.extension_parser
Re: GMF mindmap example problem [message #613073 is a reply to message #105821] Thu, 03 January 2008 14:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31548
Registered: July 2009
Senior Member
Fred,

Yes, that's what I'd expect (but if you've just got a model without a
specified resource type for the package you'll just get the default XMI
resource factory registered for the default extension and then there
won't be a plugin.xml registration for your extension). It's also
important to look at the wizard itself and see what's it's registered
against in the plugin.xml...


fred wrote:
> ok It's possible my extension wasn't correct. It seems that it isn't
> Prototypage
> where did this extension is defined?
> I thought it was the type definied in extension
> emf.ecore.extension_parser
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF mindmap example problem [message #613074 is a reply to message #105833] Thu, 03 January 2008 15:59 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
I don't really understand where to see...?

>if you've just got a model without a specified resource type for the package
>you'll just get the default XMI resource factory registered for the default
>extension and then there won't be a plugin.xml registration for your
>extension).
What should be verified?

>It's also important to look at the wizard itself
???

>and see what's it's registered against in the plugin.xml...
this is my plugin.xml where we can see the type "mindmap for the
ecore.extension_parser :

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
<copyright>
</copyright>

$Id$
-->

<plugin>

<extension
point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<factory
uri = "http://"
class = "DataModel.provider.DataModelItemProviderAdapterFactory"
supportedTypes =
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
org.eclipse.emf.edit.provider.ITreeItemContentProvider
org.eclipse.emf.edit.provider.IItemLabelProvider
org.eclipse.emf.edit.provider.IItemPropertySource" />
</extension>

<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://"
class = "DataModel.DataModelPackage"
genModel = "model/Exemple.genmodel" />
</extension>
<extension
point="org.eclipse.emf.ecore.extension_parser">
<parser

class=" org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory "
type="mindmap">
</parser>
</extension>

</plugin>
Re: GMF mindmap example problem [message #613075 is a reply to message #105821] Thu, 03 January 2008 16:00 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOTFriend
Messages: 247
Registered: July 2009
Senior Member
In your *.gmfgen file, at the root element (GenEditorGenerator) you
should ensure that your "Domain File Extension" property is correctly
set as "mindmap" instead of "prototypage" as Ed suggested.
You can also modify the "Diagram File Extension" corresponding to the
extension of your diagram file.
For more informations about these properties :
http://wiki.eclipse.org/GMF_GenModel_Hints

fred a écrit :
> ok It's possible my extension wasn't correct. It seems that it isn't
> Prototypage
> where did this extension is defined?
> I thought it was the type definied in extension emf.ecore.extension_parser
>
Re: GMF mindmap example problem [message #613077 is a reply to message #105859] Thu, 03 January 2008 18:36 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
I have try all you're saying but I never arrived to make it good.

Thanks for your help but I really don't find the problem.
did anyone can give me an example of working project or can try to see the
mine?

I really need to make it function because it's for my job...
I can send It by mail or give my mail for someone send an example to me.

Thanks by advance

fred
Re: GMF mindmap example problem [message #613078 is a reply to message #105888] Thu, 03 January 2008 19:03 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fred,
Sorry to react so late on this. I need to look at the gmf integration again to check if it works
correctly with Teneo (see also the remark in the beginning of the tutorial on elver.org). I have
very little experience with gmf so it is difficult for me to answer your specific question.

You can search the newsgroup for teneo and gmf, this will show other gmf/teneo questions. For example:
http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg02457.html

Please also note this post with a link to an issue when storing the diagram itself:
http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.modeli ng.gmf/msg05667.html

I know that someone else stored the diagram as a blob in the db.

I need to look again at this integration anyway, if it helps you I can look at this early next week.

gr. Martin

fred wrote:
> I have try all you're saying but I never arrived to make it good.
>
> Thanks for your help but I really don't find the problem.
> did anyone can give me an example of working project or can try to see
> the mine?
>
> I really need to make it function because it's for my job...
> I can send It by mail or give my mail for someone send an example to me.
>
> Thanks by advance
>
> fred
>


--

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: GMF mindmap example problem [message #613882 is a reply to message #105902] Fri, 04 January 2008 09:01 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
Hy everybody

I think my problem is different than what I expect.
I have restarted all my work and in spite of use my own ecore model, I use
the mindmap.ecore to try the real tutorial..

I think that there is somethink I haven't understood.
I succeded on realize an RCP but I failed in realize a plugin.

What did I have to do to make the plugin once I have generated the diagram
code?
I have 3 project in my workspace : mindmap, mindmap.edit and
mindmap.diagram.
but I haven't the mindmap diagram in the new project dialog list as
discribed in the tutorial :
> Create an empty project and invoke the New... dialog (Ctrl+N).
>Under 'Examples' you'll notice your new Mindmap Diagram.

anyone idea?
thanks by advance
fred
Re: GMF mindmap example problem [message #613887 is a reply to message #105930] Fri, 04 January 2008 11:28 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31548
Registered: July 2009
Senior Member
Fred,

Have a look in the plugin.xml for the *.diagram project. Look for the
wizards that are registered in it and try to determine for what file
extension it's registered. Maybe if you snip the wizard's registration
here someone will see what's going astray. Also, when you start up your
runtime workbench, you might want to use -consolelog and -debug as
arguments and have a very close look at the Error Log view in the
runtime workbench for error messages about plugins that aren't activated
for whatever reason. You might want to clear the error log view and run
it a second time to get a fresh batch of output for it...


fred wrote:
> Hy everybody
>
> I think my problem is different than what I expect.
> I have restarted all my work and in spite of use my own ecore model, I
> use the mindmap.ecore to try the real tutorial..
>
> I think that there is somethink I haven't understood.
> I succeded on realize an RCP but I failed in realize a plugin.
>
> What did I have to do to make the plugin once I have generated the
> diagram code?
> I have 3 project in my workspace : mindmap, mindmap.edit and
> mindmap.diagram.
> but I haven't the mindmap diagram in the new project dialog list as
> discribed in the tutorial :
>> Create an empty project and invoke the New... dialog (Ctrl+N). Under
>> 'Examples' you'll notice your new Mindmap Diagram.
>
> anyone idea?
> thanks by advance
> fred
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF mindmap example problem [message #613891 is a reply to message #105930] Fri, 04 January 2008 11:33 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
that's ok, thank's a lot
now I have my context menu on my "teneo.epy" file.
I don't really know what have changed but the context menu is present now

but now when I clic on the menu "initialize epydiag diagram file", nothing
happend...
no exception, no wizard, ...
any idea?
Re: GMF mindmap example problem [message #613892 is a reply to message #105991] Fri, 04 January 2008 11:41 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Does the error or problem view show something?

gr. Martin

fred wrote:
> that's ok, thank's a lot
> now I have my context menu on my "teneo.epy" file.
> I don't really know what have changed but the context menu is present now
>
> but now when I clic on the menu "initialize epydiag diagram file",
> nothing happend...
> no exception, no wizard, ...
> any idea?
>


--

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: GMF mindmap example problem [message #613894 is a reply to message #105999] Fri, 04 January 2008 12:15 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
Yes, an eror occured :

Message : Unhandled event loop exception
plug-in : org.eclipse.ui

exception stack trace :
java.lang.NoClassDefFoundError: org/hibernate/property/PropertyAccessor
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.<init >(HibernateResource.java:123)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory.createResource(HibernateResourceFactory.java:36)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:418)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandCr eateResource(ResourceSetImpl.java:240)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:392)
at
DataModel.diagram.part.ExempleInitDiagramFileAction.run(Exem pleInitDiagramFileAction.java:76)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:256)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Re: GMF mindmap example problem [message #613896 is a reply to message #106012] Fri, 04 January 2008 12:21 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
for more information about the exception
It appears when I launch "initialize epydiag diagram file" on my file
"teneo.epy"

teneo.epy content :
name=Exemple
nsuri=http://
dbname=XXXXX
dburl=jdbc:oracle:thin//xxxxxxx.xxxxxx.xx:1521:FVA001
dbdialect=org.hibernate.dialect.OracleDialect
dbuser=XXXXXXX
dbpassword=XXXXXXX
dbdriver=oracle.jdbc.driver.OracleDriver




the XXXXXX is just to mask the real values
Re: GMF mindmap example problem [message #613898 is a reply to message #106026] Fri, 04 January 2008 12:42 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Did you place the hibernate jars in a separate plugin and set the buddypolicy to dependent?
And added the hibernate plugin it in the model/editor plugins?

gr. Martin

fred wrote:
> for more information about the exception
> It appears when I launch "initialize epydiag diagram file" on my file
> "teneo.epy"
>
> teneo.epy content :
> name=Exemple
> nsuri=http://
> dbname=XXXXX
> dburl=jdbc:oracle:thin//xxxxxxx.xxxxxx.xx:1521:FVA001
> dbdialect=org.hibernate.dialect.OracleDialect
> dbuser=XXXXXXX
> dbpassword=XXXXXXX
> dbdriver=oracle.jdbc.driver.OracleDriver
>
>
>
>
> the XXXXXX is just to mask the real values
>


--

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: GMF mindmap example problem [message #613913 is a reply to message #106035] Fri, 04 January 2008 16:24 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
- the first time, I have added all library at the model project properties
(java build path --> library)

- now I have removed all those library from there, I have created a new
plugin project from existing jar (I called it hibernateplug), I have added
all hibernate jar to this plugin and in the manifest I have added :
> Eclipse-BuddyPolicy: dependent
then I have added the plugin hibernateplug in the model project properties
(java build path --> projects)

I have also added the hibernate plugin in the model plugins dependencies

But I still have the same error when I launch the "initialize epydiag file
diagram" on my teneo.epy file :

Message : Unhandled event loop exception
plug-in : org.eclipse.ui

exception stack trace :
java.lang.NoClassDefFoundError: org/hibernate/property/PropertyAccessor
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.<init >(HibernateResource.java:123)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory.createResource(HibernateResourceFactory.java:36)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:418)
at ...
Re: GMF mindmap example problem [message #613915 is a reply to message #106129] Fri, 04 January 2008 16:44 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
You should only specify the dependencies in the model plugin dependencies and not in the project
properties.

Did you set the dependency in the model plugin dependency on reexport=true? (right click on the
dependency to set this).

gr. Martin

fred wrote:
> - the first time, I have added all library at the model project
> properties (java build path --> library)
>
> - now I have removed all those library from there, I have created a new
> plugin project from existing jar (I called it hibernateplug), I have
> added all hibernate jar to this plugin and in the manifest I have added :
>> Eclipse-BuddyPolicy: dependent
> then I have added the plugin hibernateplug in the model project
> properties (java build path --> projects)
>
> I have also added the hibernate plugin in the model plugins dependencies
>
> But I still have the same error when I launch the "initialize epydiag
> file diagram" on my teneo.epy file :
>
> Message : Unhandled event loop exception
> plug-in : org.eclipse.ui
>
> exception stack trace :
> java.lang.NoClassDefFoundError: org/hibernate/property/PropertyAccessor
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.<init >(HibernateResource.java:123)
>
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResourceFa ctory.createResource(HibernateResourceFactory.java:36)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createRe source(ResourceSetImpl.java:418)
>
> at ...
>


--

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: GMF mindmap example problem [message #613937 is a reply to message #106142] Mon, 07 January 2008 10:18 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
Ok I think my problem is related with the hibernate libraries.

It is specified in the tutorial (as you said) that the hibernate libraries
should be installed in a separated plugin
I've downloaded the hibernate zip file called hibernate-3.2.5.ga.zip and
unzipped in a separated folder.
what did I have to do to make it reconized by eclipse as a separated
plugin? (perhaps waht I've done is not what should be done...)

Thank's by advance for your help
Re: GMF mindmap example problem [message #613939 is a reply to message #106314] Mon, 07 January 2008 11:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
1) In eclipse, do new-project
2) in the plugin development submenu choose plugin from existing jar files
select the jar files from the hibernate zip file (hibernate3.jar and the ones in the lib
subdirectory, you don't need them all but to be save just select them all)
3) in the next step name the project, uncheck the unzip jar archives (not necessary but for me it is
better to have the jars packed)
4) finish the wizard, the hibernate plugin should now be created
5) in the manifest.mf of the hibernate plugin set the eclipse buddy policy to dependent (see here:
http://www.elver.org/hibernate/installation.html#Hibernate+L ibraries)
6) in the model project, add the hibernate plugin project as a dependency in the manifest.mf
(dependencies tab), in this tab, right click on the hibernate plugin dependency, select properties
and check 'reexport this dependency'

gr. Martin

fred wrote:
> Ok I think my problem is related with the hibernate libraries.
>
> It is specified in the tutorial (as you said) that the hibernate
> libraries should be installed in a separated plugin
> I've downloaded the hibernate zip file called hibernate-3.2.5.ga.zip and
> unzipped in a separated folder.
> what did I have to do to make it reconized by eclipse as a separated
> plugin? (perhaps waht I've done is not what should be done...)
>
> Thank's by advance for your help
>


--

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: GMF mindmap example problem [message #613952 is a reply to message #106326] Mon, 07 January 2008 15:51 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
thanks a lot, it's ok for this part.

I've resolved some little problems but now I connect to the database and
tables are created.

But a new problem occurs (it would have been too easy :p )
just after having created the tables, a new exception occured.
The file teneo.mindmap_diagram is not created and the diagram application
is not started.
in the console, I see this (it's just the last lines) :

2281 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
completion
2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively
releasing JDBC connection
2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC
connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets:
0, globally: 0)]
2281 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider
- returning connection to pool, pool size: 1
2281 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
completion

in the Error log I see this :
Unhandled event loop exception
org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBounds Exception:
index=0, size=0
at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 35)
at
DataModel.diagram.part.ExempleInitDiagramFileAction.run(Exem pleInitDiagramFileAction.java:77)
Re: GMF mindmap example problem [message #613966 is a reply to message #106394] Tue, 08 January 2008 05:48 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I need to look at this in more detail to see what goes wrong here. Do you use a small test model? If
so can you send it to me? I will have time this evening or tomorrow to look at this further.

gr. Martin

fred wrote:
> thanks a lot, it's ok for this part.
>
> I've resolved some little problems but now I connect to the database and
> tables are created.
>
> But a new problem occurs (it would have been too easy :p )
> just after having created the tables, a new exception occured.
> The file teneo.mindmap_diagram is not created and the diagram
> application is not started.
> in the console, I see this (it's just the last lines) :
>
> 2281 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
> completion
> 2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively
> releasing JDBC connection
> 2281 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC
> connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets:
> 0, globally: 0)]
> 2281 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - returning
> connection to pool, pool size: 1
> 2281 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
> completion
>
> in the Error log I see this :
> Unhandled event loop exception
> org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBounds Exception:
> index=0, size=0
> at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 35)
> at
> DataModel.diagram.part.ExempleInitDiagramFileAction.run(Exem pleInitDiagramFileAction.java:77)
>
>
>


--

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: GMF mindmap example problem [message #613967 is a reply to message #106559] Tue, 08 January 2008 09:31 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
ok my model is very small, I can give it to you!
thank's a lot for your help

you want I'll give you my model : the ecore file only?
or the other files too (genmodel, gmfmap, gmfgraph, gmftool, gmfgen)?
I send all this to you by mail?
Re: GMF mindmap example problem [message #613968 is a reply to message #106573] Tue, 08 January 2008 17:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
You can send it to me by email. The ecore file would be enough, I can generate the other files from
there (afaik).

gr. Martin

fred wrote:
> ok my model is very small, I can give it to you! thank's a lot for your
> help
>
> you want I'll give you my model : the ecore file only? or the other
> files too (genmodel, gmfmap, gmfgraph, gmftool, gmfgen)?
> I send all this to you by mail?
>
>


--

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: GMF mindmap example problem [message #613969 is a reply to message #106587] Tue, 08 January 2008 18:39 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
I'll send you my model when i'll had you mail ;-)
thanks for your help :)

There is one point I haven't done before : I'haven't added the code
specified here :
http://elver.org/hibernate/gmftutorial/tutorial2.html#Ensure +that+the+resource+has+at+least+one+root+object

Now it'is done. my code is like that :

public void run(IAction action) {
// Added for Teneo tutorial
// This part is only required to ensure that the resource at least has one
root element
// This is only for demo purposes.
try {
ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(domainModelURI,true);
if (resource.getContents().size() == 0) {
Tournoi map = DataModelFactory.eINSTANCE.createTournoi();
// map.setTitle("GMF - Teneo");
resource.getContents().add(map);
resource.save(Collections.EMPTY_MAP);
}
resource.unload();
} catch (IOException ex) {
ExempleDiagramEditorPlugin
.getInstance()
.logError("Unable to load resource: " + domainModelURI.toString(),
ex); //$NON-NLS-1$
}
// Added for Teneo tutorial


TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
.createEditingDomain();
ResourceSet resourceSet = editingDomain.getResourceSet();
EObject diagramRoot = null;
try {
/************/
Resource resource = resourceSet.getResource(domainModelURI, true);
/************/
diagramRoot = (EObject) resource.getContents().get(0);
} catch (WrappedException ex) {
DataModel.diagram.part.ExempleDiagramEditorPlugin.getInstanc e()
.logError("Unable to load resource: " + domainModelURI, ex);
//$NON-NLS-1$
}
if (diagramRoot == null) {
MessageDialog.openError(getShell(),
DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogTitle,
DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogMessage);
return;
}
Wizard wizard = new DataModel.diagram.part.ExempleNewDiagramFileWizard(
domainModelURI, diagramRoot, editingDomain);
wizard
.setWindowTitle(NLS
.bind(
DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileWizardTitle,
DataModel.diagram.edit.parts.TournoiEditPart.MODEL_ID));
DataModel.diagram.part.ExempleDiagramEditorUtil.runWizard(ge tShell(),
wizard, "InitDiagramFile"); //$NON-NLS-1$
}

a new error occured :
>java.lang.IllegalStateException: Cannot modify resource set without a write
transaction
>at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:322)
>at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:284)
...


it occured when executing code between /************/ and /************/

I don't know if it can give to you an idea to find the problem :-/
Re: GMF mindmap example problem [message #613970 is a reply to message #106600] Tue, 08 January 2008 19:00 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
It is: mtaal@elver.org.

For the issue you mention below, can you check out this thread and see if it helps to solve your issue:
http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg02447.html

Can you let me know if this helped?

gr. Martin

fred wrote:
> I'll send you my model when i'll had you mail ;-)
> thanks for your help :)
>
> There is one point I haven't done before : I'haven't added the code
> specified here :
> http://elver.org/hibernate/gmftutorial/tutorial2.html#Ensure +that+the+resource+has+at+least+one+root+object
>
>
> Now it'is done. my code is like that :
> public void run(IAction action) {
> // Added for Teneo tutorial
> // This part is only required to ensure that the resource at least has
> one root element
> // This is only for demo purposes.
> try {
> ResourceSet rs = new ResourceSetImpl();
> Resource resource = rs.getResource(domainModelURI,true);
> if (resource.getContents().size() == 0) {
> Tournoi map = DataModelFactory.eINSTANCE.createTournoi();
> // map.setTitle("GMF - Teneo");
> resource.getContents().add(map);
> resource.save(Collections.EMPTY_MAP);
> }
> resource.unload();
> } catch (IOException ex) {
> ExempleDiagramEditorPlugin
> .getInstance()
> .logError("Unable to load resource: " + domainModelURI.toString(),
> ex); //$NON-NLS-1$
> }
> // Added for Teneo tutorial
>
>
> TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE
> .createEditingDomain();
> ResourceSet resourceSet = editingDomain.getResourceSet();
> EObject diagramRoot = null;
> try {
> /************/
> Resource resource = resourceSet.getResource(domainModelURI, true);
> /************/
> diagramRoot = (EObject) resource.getContents().get(0);
> } catch (WrappedException ex) {
> DataModel.diagram.part.ExempleDiagramEditorPlugin.getInstanc e()
> .logError("Unable to load resource: " + domainModelURI, ex);
> //$NON-NLS-1$
> }
> if (diagramRoot == null) {
> MessageDialog.openError(getShell(),
> DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogTitle,
>
> DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileResourceErrorDialogMessage);
>
> return;
> }
> Wizard wizard = new DataModel.diagram.part.ExempleNewDiagramFileWizard(
> domainModelURI, diagramRoot, editingDomain);
> wizard
> .setWindowTitle(NLS
> .bind(
> DataModel.diagram.part.Messages.ExempleInitDiagramFileAction _InitDiagramFileWizardTitle,
>
> DataModel.diagram.edit.parts.TournoiEditPart.MODEL_ID));
> DataModel.diagram.part.ExempleDiagramEditorUtil.runWizard(ge tShell(),
> wizard, "InitDiagramFile"); //$NON-NLS-1$
> }
>
> a new error occured :
>> java.lang.IllegalStateException: Cannot modify resource set without a
>> write
> transaction
>> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ssertWriting(TransactionChangeRecorder.java:322)
>
>> at
> org.eclipse.emf.transaction.impl.TransactionChangeRecorder.a ppendNotification(TransactionChangeRecorder.java:284)
>
> ...
>
>
> it occured when executing code between /************/ and /************/
>
> I don't know if it can give to you an idea to find the problem :-/
>
>
>


--

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:[Announce] EMFT SEARCH 0.7.0 I200801071957 is available
Next Topic:[CDO][0.8.0] Give more informations to StoreWriter
Goto Forum:
  


Current Time: Sun Oct 25 23:24:31 GMT 2020

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

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

Back to the top