MWE: Couldn't load resource under platform:/resource [message #816001] |
Thu, 08 March 2012 09:51  |
Daniel Engelhardt Messages: 11 Registered: November 2010 |
Junior Member |
|
|
Hello,
I am trying to write some M2T code using Xpand and the MWE setup. Unfortunately, I have big problems loading the input model, but I do not understand why.
First, my workflow file:
<?xml version="1.0"?>
<workflow>
<property name="model" value="test/models/My.test"/>
<property name="src-gen" value="src-gen/benchmarking" />
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".." />
<registerGeneratedEPackage value="org.test.test2.TestPackage" />
<!-- <registerEcoreFile value="platform:/resource/test/test.ecore" /> -->
</bean>
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="platform:/resource/${model}" />
<modelSlot value="model" />
</component>
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value="platform:/resource/${src-gen}" />
</component>
<!-- Now start the generator component -->
<component class="org.eclipse.xpand2.Generator">
<fileEncoding value="ISO-8859-1"/>
<metaModel id="mm_emf" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />
<expand value="program::main FOR model"/>
<outlet path="${src-gen}" />
<outlet name="TO_SOURCE_DIRECTORY" path="${src-gen}/src" />
<outlet name="TO_INCLUDE_DIRECTORY" path="${src-gen}/inc" />
</component>
</workflow>
When trying to run it, I get:
0 INFO WorkflowEngine - --------------------------------------------------------------------------------------
0 INFO WorkflowEngine - EMF Modeling Workflow Engine 1.1.1, Build v201108020506
0 INFO WorkflowEngine - (c) 2005-2009 openarchitectureware.org and contributors
0 INFO WorkflowEngine - --------------------------------------------------------------------------------------
0 INFO WorkflowEngine - running workflow: D:/runtime-Eclipse/test/generate.mwe
0 INFO WorkflowEngine -
329 INFO StandaloneSetup - Registering platform uri 'D:\runtime-Eclipse'
861 INFO StandaloneSetup - Adding generated EPackage 'org.genivi.most.MostPackage'
955 INFO CompositeComponent - Reader: Loading model from platform:/resource/test/models/My.test
955 ERROR WorkflowEngine - Workflow interrupted. Reason: Couldn't load resource under platform:/resource/test/models/My.test : org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Function' is not found or is abstract. (platform:/resource/test/models/My.test, 2, 145)
(Function is the root element of My.test)
Okay, obviously there is something wrong with the Meta Model, but what exactly?
If I validate the Model My.test (right click, validate) all is fine. If I double click on it, the correct editor opens.
I created the MetaModel and the editors etc. in the first Eclipse instance and run the MWE script in a new Eclipse environment derived from the first one.
What do i have to do? I tried to reference the ecore form My.test directly using schemaLocation="D:\workspace1\testenv\test.ecore" and also used the correct xmlns="http:SLASHSLASHwww.testDOTorg/test" line, which correspods to the line from the meta model editor.
I run the MWE directly using the "Run as" function and use Eclipse Indigo (SDK: 3.7.1).
What am I doing wrong and how can I correct it? Where should I look first?
Best regards,
Daniel
[Updated on: Thu, 08 March 2012 11:48] Report message to a moderator
|
|
|
Re: MWE: Couldn't load resource under platform:/resource [message #816418 is a reply to message #816001] |
Thu, 08 March 2012 20:57   |
|
Since you get a ClassNotFoundException it looks for me that your classpath is not correct. Can you confirm that the class "Function" is on the classpath? You could also set an exception breakpoint on the org.eclipse.emf.ecore.xmi.ClassNotFoundException to suspend on the exception. Don't forget to set the "Java debug" option in the launch configuration then.
Regards,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
Re: MWE: Couldn't load resource under platform:/resource [message #816806 is a reply to message #816772] |
Fri, 09 March 2012 09:28   |
|
Listing the project as dependency is usually sufficient. Anyway, we have to figure out why you get the ClassNotFoundException. You don't need to set -Xdebug to run in debug mode. Open Run / Debug configurations, select the workflow and check the option "Java Debug", that's all.
Can you confirm that the Class "Function" exists as Java class? You are using the generated EPackage registration, so I guess it is in this package, right? No subpackage?
Regards,
~Karsten
Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.02576 seconds