Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Emfatic text from Ecore
Emfatic text from Ecore [message #725696] Thu, 15 September 2011 14:31 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I would like to generate Emfatic(the text displayed by OCLinEcore Editor) text from Ecore file in standalone application for view.


Any suggesions?

Regards,
Re: Emfatic text from Ecore [message #725797 is a reply to message #725696] Thu, 15 September 2011 19:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

Emfatic is different to OCLinEcore.

You've asked almost the same question on at least three newsgroups;
ignoring OCL and Xtext that are the relevant ones.

Please think before you spam.

Regards

Ed Willink



On 15/09/2011 15:31, ModelGeek wrote:
> Hi,
>
> I would like to generate Emfatic(the text displayed by OCLinEcore
> Editor) text from Ecore file in standalone application for view.
>
> Any suggesions?
>
> Regards,
Re: Emfatic text from Ecore [message #725914 is a reply to message #725797] Fri, 16 September 2011 07:34 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Sorry for spaming... i will be careful next time!

Just want a hint generating text from Ecore like it is generated in OCLinEcore editor.

Re: Emfatic text from Ecore [message #726211 is a reply to message #725914] Fri, 16 September 2011 19:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
On 16/09/2011 08:34, ModelGeek wrote:
> Sorry for spaming... i will be careful next time!
>
> Just want a hint generating text from Ecore like it is generated in
> OCLinEcore editor.
>
>
If you only want text. Load the OCLinEcore file and extract the text
from the Document.

Regards

Ed Willink
Re: Emfatic text from Ecore [message #726515 is a reply to message #726211] Sun, 18 September 2011 12:30 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Thanks for help!

Can you please tell me where i can find the documentation which can help me to load OCLinEcore file or is there any example available?

Warmest Regards,
Re: Emfatic text from Ecore [message #726696 is a reply to message #726515] Mon, 19 September 2011 09:47 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
I have created .oclinecore file from ecore resource and i am able to save .oclinecore file as well. But when i open oclinecore in notepad then it contains xml stuff

<packages name="temp" prefix="ABC" uri="http://www.eclipse.org/mdt/ocl/oclinecore/tutorial">
<classifiers xsi:type="oclinEcoreCST:OCLinEcoreClassCS" name="BehaviorElement">
<annotations xsi:type="oclinEcoreCST:AnnotationCS" stringSource="http://www.eclipse.org/emf/2002/Ecore">
<details idName="constraint">
<value>mostOneType</value>
</details>


but i would like to get

Class BehaviorElement {
attribute 1
attribute 2
}

The same text which apears when user opens ecore model in OCLinEcore Editor...
I just want to get the text...


please guide me

Warmest Regards,
Re: Emfatic text from Ecore [message #727070 is a reply to message #726696] Tue, 20 September 2011 10:57 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

i am still waiting for help!

Ecore2OCLinEcore oCLinEcore = Ecore2OCLinEcore.importDocument(resourceSet, resource);

i can load the Ecore2OCLinEcore and i can also save the resource but as i have mentioned in my previous message the file just contains XML
i want to have the same text as it appears in OCLinEcore editor and i just want text. I do not want any UI features.

is there any example or documentation available for Ecore2OCLinEcore ?

Please help!

Warmest Regards
Re: Emfatic text from Ecore [message #727108 is a reply to message #727070] Tue, 20 September 2011 12:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Hi,

how do you create the oclinecore file?
can you share a testcase that reproduces the problem?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727115 is a reply to message #727108] Tue, 20 September 2011 12:43 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

here is the code


Ecore2OCLinEcore oCLinEcore = Ecore2OCLinEcore.importDocument(resourceSet, resource);
OCLinEcoreDocumentCS document = oCLinEcore.getDocument();
document.eResource().save(null);

Regards,
Re: Emfatic text from Ecore [message #727129 is a reply to message #727115] Tue, 20 September 2011 13:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
HI,

i can't find these classes in the current ocl code.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727133 is a reply to message #727129] Tue, 20 September 2011 13:29 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

they are avaiable in

org.eclipse.ocl.examples.xtext.base_3.0XXX.jar
org.eclipse.ocl.examples.xtext.oclinecore_3.0XXX.jar
org.eclipse.ocl.examples.xtext.oclinecore.ui_3.0XXX.jar

[Updated on: Tue, 20 September 2011 13:37]

Report message to a moderator

Re: Emfatic text from Ecore [message #727134 is a reply to message #727133] Tue, 20 September 2011 13:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Hi had a look into the source code, the Ecore2OCLinEcore was delete 7 month ago.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727135 is a reply to message #727134] Tue, 20 September 2011 13:38 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Ok

Can you please help how to generate OCLinEcore text from my ecore in standalone application? I donot want any UI features of OCLinEcore editor. i just want to generat the same sort of text from my ecore in standalone application.

Warmest Regards,

[Updated on: Tue, 20 September 2011 13:42]

Report message to a moderator

Re: Emfatic text from Ecore [message #727136 is a reply to message #727135] Tue, 20 September 2011 13:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Hi, i have no idea what OCLinEcore does,
but generally in xtext you create a resource with the extension, save it and it will work out of the box:

(pseudo code)

Injector i = new MyDslStandaloneSetup().createInjectorandDo ....
ResourceSet rs = i.getInstance(ResourceSet.class);
Resource r = rs.createResource(URI.createURI("....mydsl"))
r.getContents.add(modelRoot)
r.save(null);

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727191 is a reply to message #727136] Tue, 20 September 2011 15:24 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

i think this code is usable when user wants to have DSL.
As this code is mentioned in Xtext docs to be used for loading already save models.

But i need some kind of generator to generate Text from my existing Ecore model.

If you open any ecore file in Eclipse and open file OCLinEcore editor you will see some text. It means that generator resource implementation already exists. I just want to reuse that for text only, No UI required.
Re: Emfatic text from Ecore [message #727215 is a reply to message #727191] Tue, 20 September 2011 16:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Maybe digging into Ecore2Pivot and Pivot2CS helps



Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727225 is a reply to message #727215] Tue, 20 September 2011 16:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
@Ed,

is there no easy way to call this m2ms standalone?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727231 is a reply to message #727225] Tue, 20 September 2011 16:46 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
P.S.:


package org.xtext.example.mydsl;

import java.io.IOException;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.ocl.examples.xtext.oclinecore.OCLinEcoreStandaloneSetup;
import org.eclipse.ocl.examples.xtext.oclinecore.oclinEcoreCST.OCLinEcoreDocumentCS;
import org.eclipse.ocl.examples.xtext.oclinecore.resource.Ecore2OCLinEcore;

public class Main {

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
OCLinEcoreStandaloneSetup.doSetup();
ResourceSet rs = new ResourceSetImpl();
Resource r = rs.getResource(URI.createFileURI("../org.xtext.example.mydsl/src-gen/org/xtext/example/mydsl/MyDsl.ecore"), true);
System.out.println(r.getContents().get(0));
OCLinEcoreDocumentCS doc = Ecore2OCLinEcore.importFromEcore(rs, "alias", r);
Resource r2 = rs.createResource(URI.createURI("test.oclinecore"));
r2.getContents().add(doc);
r2.save(null);
}

}


works in Helios.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727395 is a reply to message #727231] Wed, 21 September 2011 07:31 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I using the similar code but it still saves the oclinecore file with xml stuff not human readable language.. my code is given below
here i am saving a resource and trying to convert into oclinecore resource.
Here modelPackage is instance of my EPackage.
OCLinEcoreStandaloneSetup.doSetup();
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new EcoreResourceFactoryImpl());
Resource resource = resourceSet.createResource(uri1);
resource.getContents().add(modelPackage);
resource.save(Collections.EMPTY_MAP);
OCLinEcoreDocumentCS document = Ecore2OCLinEcore.importFromEcore(resourceSet, "alias", resource);
Resource r2 = resourceSet.createResource(uri1.trimFileExtension().appendFileExtension("oclinecore"));
r2.getContents().add(document);
r2.save(null);
}

please help me finding out what i am doing wrong.

Warmest Regards,
Re: Emfatic text from Ecore [message #727402 is a reply to message #727395] Wed, 21 September 2011 07:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new EcoreResourceFactoryImpl());
is a damn bad idea.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727453 is a reply to message #727402] Wed, 21 September 2011 10:55 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
if i use resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
then i get the following exception: at line OCLinEcoreDocumentCS document = Ecore2OCLinEcore.importFromEcore(resourceSet, "alias", resource);

Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting method, org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'EClassifier' is not found or is abstract. (classpath:/org/eclipse/ocl/examples/xtext/oclinecore/OCLinEcore.xmi, 18, 123)
at org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService.setGrammar(AbstractDeclarativeValueConverterService.java:50)
while locating org.eclipse.ocl.examples.xtext.oclinecore.services.OCLinEcoreValueConverterService
while locating org.eclipse.xtext.conversion.IValueConverterService


do you know why it is like that?

thanks for helping me
Re: Emfatic text from Ecore [message #727456 is a reply to message #727453] Wed, 21 September 2011 11:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Put a factory for xmi too

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727458 is a reply to message #727456] Wed, 21 September 2011 11:10 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

i have added
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl ());

but still the same exception
Re: Emfatic text from Ecore [message #727461 is a reply to message #727458] Wed, 21 September 2011 11:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Why do you do this stuff at all. My main shows it will work without

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727465 is a reply to message #727461] Wed, 21 September 2011 11:24 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I need to create Ecore file first so i can create oclinecore file from ecore. Is there any method for creating oclinecore file from instance of EPacakge?

In your main method you are loading an exitsing ecore file, but i my case i donot have any ecore, i have instance of EPacakge with all Eclass instances so i need to have an ecore file and then convert that to oclinecore file...

I am extremely thankful to you for your help!

Warmest Regards,
Re: Emfatic text from Ecore [message #727467 is a reply to message #727465] Wed, 21 September 2011 11:32 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Can you share a main class as well

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727471 is a reply to message #727467] Wed, 21 September 2011 11:58 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
public static void main(String args[]) {
URI uri1 = URI.createFileURI("C:\\Users\\KhurramS\\Desktop\\ulrik\\test3.ecore");
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
Resource resource = resourceSet.getResource(uri1, true);
try {
OCLinEcoreStandaloneSetup.doSetup();
OCLinEcoreDocumentCS document = Ecore2OCLinEcore.importFromEcore(resourceSet, "alias", resource);
Resource r2 = resourceSet.createResource(uri1.trimFileExtension().appendFileExtension("oclinecore"), OCLinEcoreCSTPackage.eCONTENT_TYPE);
r2.getContents().add(document);
r2.save(null);


} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}


i get exception : OCLinEcoreDocumentCS document = Ecore2OCLinEcore.importFromEcore(resourceSet, "alias", resource);
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'xmi' not found. (file:/C:/Users/KhurramS/Desktop/ulrik/test3.ecore, 5, 80)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)

}
  • Attachment: test3.ecore
    (Size: 1.40KB, Downloaded 252 times)

[Updated on: Wed, 21 September 2011 11:59]

Report message to a moderator

Re: Emfatic text from Ecore [message #727473 is a reply to message #727471] Wed, 21 September 2011 12:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
Strange things you do:

package org.xtext.example.mydsl;

import java.io.IOException;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.ocl.examples.xtext.oclinecore.OCLinEcoreStandaloneSetup;
import org.eclipse.ocl.examples.xtext.oclinecore.oclinEcoreCST.OCLinEcoreDocumentCS;
import org.eclipse.ocl.examples.xtext.oclinecore.resource.Ecore2OCLinEcore;

public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		EPackage p = EcoreFactory.eINSTANCE.createEPackage();
		p.setName("test");
		p.setNsPrefix("test");
		p.setNsURI("http://www.example.com/test");
		EClass c = EcoreFactory.eINSTANCE.createEClass();
		c.setName("Dummy");
		p.getEClassifiers().add(c);
		
		OCLinEcoreStandaloneSetup.doSetup();
		ResourceSet rs = new ResourceSetImpl();
		Resource r = rs.createResource(URI.createURI("dummy.ecore"));
		r.getContents().add(p);
		//Resource r = rs.getResource(URI.createFileURI("../org.xtext.example.mydsl/src-gen/org/xtext/example/mydsl/MyDsl.ecore"), true);
		System.out.println(r.getContents().get(0));
		OCLinEcoreDocumentCS doc = Ecore2OCLinEcore.importFromEcore(rs, "alias", r);
		Resource r2 = rs.createResource(URI.createURI("test.oclinecore"));
		r2.getContents().add(doc);
		r2.save(null);
	}

}



works for me


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727478 is a reply to message #727473] Wed, 21 September 2011 12:13 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

may be i m missing some jars in my class path, can you tell me which jars you have included in your class path?

Regards,
Re: Emfatic text from Ecore [message #727480 is a reply to message #727478] Wed, 21 September 2011 12:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14729
Registered: July 2009
Senior Member
I just took an xtext project and added the ocl stuff.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Emfatic text from Ecore [message #727490 is a reply to message #727480] Wed, 21 September 2011 12:43 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
hi,

I have checked my class path but i am still getting following exception from your main method, Do you have any idea why is this happening?

Exception in thread "main" com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting method, org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'EClassifier' is not found or is abstract. (classpath:/org/eclipse/ocl/examples/xtext/oclinecore/OCLinEcore.xmi, 18, 123)
at org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService.setGrammar(AbstractDeclarativeValueConverterService.java:50)
while locating org.eclipse.ocl.examples.xtext.oclinecore.services.OCLinEcoreValueConverterService
while locating org.eclipse.xtext.conversion.IValueConverterService
for field at org.eclipse.xtext.linking.impl.LinkingHelper.valueConverter(LinkingHelper.java:25)
while locating org.eclipse.xtext.linking.impl.LinkingHelper
for field at org.eclipse.xtext.parsetree.reconstr.impl.CrossReferenceSerializer.linkingHelper(CrossReferenceSerializer.java:33)
while locating org.eclipse.ocl.examples.xtext.oclinecore.services.OCLinEcoreCrossReferenceSerializer
while locating org.eclipse.xtext.parsetree.reconstr.ITokenSerializer$ICrossReferenceSerializer
for field at org.eclipse.xtext.parsetree.reconstr.impl.AbstractParseTreeConstructor.crossRefSerializer(AbstractParseTreeConstructor.java:58)
while locating org.eclipse.ocl.examples.xtext.oclinecore.parseTreeConstruction.OCLinEcoreParsetreeConstructor
while locating org.eclipse.xtext.parsetree.reconstr.IParseTreeConstructor
for parameter 0 at org.eclipse.xtext.parsetree.reconstr.Serializer.<init>(Serializer.java:38)
while locating org.eclipse.xtext.parsetree.reconstr.Serializer
for field at org.eclipse.xtext.resource.XtextResource.serializer(XtextResource.java:349)
while locating org.eclipse.xtext.linking.lazy.LazyLinkingResource
while locating org.eclipse.xtext.resource.XtextResource
Caused by: org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'EClassifier' is not found or is abstract. (classpath:/org/eclipse/ocl/examples/xtext/oclinecore/OCLinEcore.xmi, 18, 123)
at org.eclipse.xtext.parser.BaseEPackageAccess.loadResource(BaseEPackageAccess.java:57)
at org.eclipse.xtext.parser.BaseEPackageAccess.loadGrammarFile(BaseEPackageAccess.java:44)
at org.eclipse.xtext.service.GrammarProvider.getGrammar(GrammarProvider.java:49)
at org.eclipse.ocl.examples.xtext.oclinecore.services.OCLinEcoreGrammarAccess.getGrammar(OCLinEcoreGrammarAccess.java:3525)
at org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService.setGrammar(AbstractDeclarativeValueConverterService.java:50)
at $org.eclipse.xtext.conversion.impl.AbstractDeclarativeValueConverterService$$FastClassByGuice$$7fdb40ee.invoke(<generated>)
at com.google.inject.internal.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at com.google.inject.SingleMethodInjector$1.invoke(SingleMethodInjector.java:59)
at com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:91)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
at org.eclipse.xtext.resource.XtextResourceFactory.createResource(XtextResourceFactory.java:19)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:425)
at org.eclipse.ocl.examples.xtext.oclinecore.resource.Ecore2OCLinEcore.importResource(Ecore2OCLinEcore.java:822)
at org.eclipse.ocl.examples.xtext.oclinecore.resource.Ecore2OCLinEcore.getDocument(Ecore2OCLinEcore.java:815)
at org.eclipse.ocl.examples.xtext.oclinecore.resource.Ecore2OCLinEcore.importFromEcore(Ecore2OCLinEcore.java:119)
at abstractmodeller.model.prm.ECoreGenerator.main(ECoreGenerator.java:921)
Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'EClassifier' is not found or is abstract. (classpath:/org/eclipse/ocl/examples/xtext/oclinecore/OCLinEcore.xmi, 18, 123)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
at org.eclipse.xtext.resource.SynchronizedXtextResourceSet.getResource(SynchronizedXtextResourceSet.java:23)
at org.eclipse.xtext.parser.BaseEPackageAccess.loadResource(BaseEPackageAccess.java:52)
... 44 more
Caused by: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'EClassifier' is not found or is abstract. (classpath:/org/eclipse/ocl/examples/xtext/oclinecore/OCLinEcore.xmi, 18, 123)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2244)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2368)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFeatureType(XMLHandler.java:2163)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2035)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:134)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1840)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1023)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:87)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:712)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:169)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
Re: Emfatic text from Ecore [message #727497 is a reply to message #727490] Wed, 21 September 2011 13:12 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
I forgot to tell i am working in Netbeans. But when i run the main method in eclipse environment then there is no error and every thing works fine, but when i run Netbeans then the ealier mentioned exception comes.

Any hint why it is happening?

I will be very greatful for your help!
Re: OCLinEcore text from Ecore (was Emfatic text from Ecore) [message #727507 is a reply to message #727490] Wed, 21 September 2011 13:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

Christian has provided you with a 100% working Java file, that should be
easy to wrap up into a plugin project. Are you using precisely
Christian's code? If not, try doing so. If so, ZIP your entire project
so that we can see what strange things you have managed to do.

Regards

Ed Willink


On 21/09/2011 13:43, ModelGeek wrote:
> hi,
>
> I have checked my class path but i am still getting following
> exception from your main method, Do you have any idea why is this
> happening?
>
Re: OCLinEcore text from Ecore (was Emfatic text from Ecore) [message #727508 is a reply to message #727497] Wed, 21 September 2011 13:23 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

Ah; the critical detail. NetBeans.

It's probably an OSGI problem. I don't understand the OSGI magic that
underlies Eclipse 3.x, but it works and sorts out classpaths. Quite
probably NetBeans is different, either at the platform level or at the
Guice integration level. I doubt that you will find many Eclipse users
who are familiar with NetBeans. Try the NetBeans user groups.

Regards

Ed Willink

On 21/09/2011 14:12, ModelGeek wrote:
> I forgot to tell i am working in Netbeans. But when i run the main
> method in eclipse environment then there is no error and every thing
> works fine, but when i run Netbeans then the ealier mentioned
> exception comes.
>
> Any hint why it is happening?
>
> I will be very greatful for your help!
Re: OCLinEcore text from Ecore (was Emfatic text from Ecore) [message #727510 is a reply to message #727490] Wed, 21 September 2011 13:14 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

Christian has provided you with a 100% working Java file, that should be
easy to wrap up into a plugin project. Are you using precisely
Christian's code? If not, try doing so. If so, ZIP your entire project
so that we can see what strange things you have managed to do.

Regards

Ed Willink


On 21/09/2011 13:43, ModelGeek wrote:
> hi,
>
> I have checked my class path but i am still getting following
> exception from your main method, Do you have any idea why is this
> happening?
>
Re: OCLinEcore text from Ecore (was Emfatic text from Ecore) [message #727511 is a reply to message #727497] Wed, 21 September 2011 13:23 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

Ah; the critical detail. NetBeans.

It's probably an OSGI problem. I don't understand the OSGI magic that
underlies Eclipse 3.x, but it works and sorts out classpaths. Quite
probably NetBeans is different, either at the platform level or at the
Guice integration level. I doubt that you will find many Eclipse users
who are familiar with NetBeans. Try the NetBeans user groups.

Regards

Ed Willink

On 21/09/2011 14:12, ModelGeek wrote:
> I forgot to tell i am working in Netbeans. But when i run the main
> method in eclipse environment then there is no error and every thing
> works fine, but when i run Netbeans then the ealier mentioned
> exception comes.
>
> Any hint why it is happening?
>
> I will be very greatful for your help!
Previous Topic:[acceleo] how to call a template method from inside a java method
Next Topic:[Acceleo 3.1] [i/] statement is not compiling
Goto Forum:
  


Current Time: Sat Nov 09 00:44:14 GMT 2024

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

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

Back to the top