Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup
ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073375] Wed, 24 July 2013 16:15 Go to next message
Richard Wood is currently offline Richard WoodFriend
Messages: 29
Registered: January 2010
Junior Member
Hello

I had the following error when running the Xtext generator workflow for the tutorial example in the Xtext documentation.

ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup

I'm using the itemis eclipse distribution eclipse-SDK-4.2.2-Xtext-2.4.1-win32.zip

The problem started as soon as I was referencing an ecore file from GenerateDomainmodel.mwe2 like this

loadedResource ="${runtimeProject}/my.ecore"

I fixed it by adding a new plugin reference to the project
org.eclipse.xtext.ecore

As the plugin dependencies get automatically created when setting up a new xtext project, this might be a bug with xtext.

Or is there a better way to do this?
Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073380 is a reply to message #1073375] Wed, 24 July 2013 16:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6544
Registered: July 2009
Senior Member
Hi did you have a look what the Xtext project from existing ecore
does generate. IMHO the dependency is not necessary for easy use
cases so the dependency would not be needed

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073733 is a reply to message #1073380] Thu, 25 July 2013 11:52 Go to previous messageGo to next message
Richard Wood is currently offline Richard WoodFriend
Messages: 29
Registered: January 2010
Junior Member
Thanks for the very fast reply Christian.

I tried the wizard which creates an xtext project based on an existing ecore model.
However this creates a complete grammar from that ecore model and imports the ecore model. This is the second approach besides generating an ecore file based on a manually written grammar.

What I want is to write a new grammar manually but referring to the concepts of a second existing ecore model. And when modeling I want to reference elements of an existing instance of that ecore model. Similar to the method for referencing existing Java types from a xtext grammar.

Do you have any tips how to do this?


Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073742 is a reply to message #1073733] Thu, 25 July 2013 12:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6544
Registered: July 2009
Senior Member
Hi why do you reference to the ecore. I'd keep the ecore
separate and use a although separate gen model to create the java
classes for it. Then I'd simply specify generatedepackage and gen
model in the stand alone setup at the header (have a look for the
xbasepackage in comments)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de

[Updated on: Thu, 25 July 2013 12:39]

Report message to a moderator

Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073784 is a reply to message #1073742] Thu, 25 July 2013 13:31 Go to previous messageGo to next message
Richard Wood is currently offline Richard WoodFriend
Messages: 29
Registered: January 2010
Junior Member
Thanks again for the prompt answer, Christian Wink

I'm already doing what you have suggested. I created an EMF project with the ecore model to get the genmodel. Then reference that genmodel from the mwe file of my xtext project in the standalone setup. Also described in chapter 6.2.2.
My grammar is now referring to the concepts from the ecore model.

However I'm not sure how to "read" an existing instance of the ecore model, so that it can be referenced when applying my grammar.

You described something similar in your blog.
http://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/

model test.use references model test.define

The difference to my setup is that I'm using ecore vanilla, instead of an xtext model for the second model. It's an XMI file, but can be read and edited when using the standard EMF Ecore editor, which can be generated from the genmodel.

How can I specify an existing ecore model instance as input for the modelling process? Ctrl space does not work even if the XMI file is in the same folder as the xtext model.

Any insights would be appreciated.
Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073792 is a reply to message #1073784] Thu, 25 July 2013 13:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6544
Registered: July 2009
Senior Member
Hi,

do you have already a genmodel and javaclasses for that project?

if yes: simply adop the StandaloneSetup
if no: create a new empty emf project
place the ecore to the model folder
createa new Genmodel from that ecore
create java code using the genmodel.
add Xtext Nature the project (rightklicvk -> configure)

Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073848 is a reply to message #1073792] Thu, 25 July 2013 16:04 Go to previous messageGo to next message
Richard Wood is currently offline Richard WoodFriend
Messages: 29
Registered: January 2010
Junior Member
Yes, I have the genmodel and generated java classes for my ecore model. I even generated the editor code too for creating an example model.
So I have abc.ecore and a file named test.abc which is an instance of that ecore model.

Thanks a lot for the Xtext nature tip. That solved one problem I had with not finding the ecore model when editing the xtext grammar.

Unfortunately I still cannot create a xtext model based on my grammar where I reference something from test.abc. Ctrl space does not show any elements from test.abc.

I wonder if test.abc and test.dmodel need to be in the same resourceset. Both files are in the same folder. Not sure how to combine them.

Some xtext grammar code below to showcase what I'm trying to do.

import "http:///abc.ecore" as abc

...
'mapped to' aaaClass=[abc::AAA]


Thank you for your help and patience so far, Christian.




Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1073851 is a reply to message #1073848] Thu, 25 July 2013 16:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6544
Registered: July 2009
Senior Member
Hi

did you write an iresourceserviceprovider
http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/
Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1074193 is a reply to message #1073851] Fri, 26 July 2013 08:56 Go to previous messageGo to next message
Richard Wood is currently offline Richard WoodFriend
Messages: 29
Registered: January 2010
Junior Member
Ah, the missing link Wink
Yes, I've come across that blog posting of yours before. But it seemed tedious.

OK I created those two plugins after some time and it works... Thanks again.

My assumption that any DSL based on ecore could be integrated without further code extensions was wrong. Or it was correct as long as the ecore instance is edited with Xtext, and not with another editor.

So you do need to reference the editor code for the ecore model as part of the iresourceserviceprovider. Even if you are not planning to edit the ecore model instance, and only referring to elements of it in the xtext model.

There is practically no DSL specific code in the iresourceserviceprovider. Could it be generated?

There is a iresourceserviceprovider for java code obviously.
Re: ClassNotFoundException: org.eclipse.xtext.ecore.ecoresupportstandalonesetup [message #1074195 is a reply to message #1074193] Fri, 26 July 2013 09:05 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6544
Registered: July 2009
Senior Member
Hi,

please note: .xyzdsl files work out of the box.
.abc with .abc has no Xtext editor defined needs a own resourceserviceprovider.

so your problem can not actually happen.
Previous Topic:XbaseScopeProvider in Xtext 2.4
Next Topic:[XBase] Extending XBase to support different call ids
Goto Forum:
  


Current Time: Fri Dec 19 04:43:39 GMT 2014

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

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