Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » MWE: Couldn't load resource under platform:/resource
MWE: Couldn't load resource under platform:/resource [message #816001] Thu, 08 March 2012 09:51 Go to next message
Daniel Engelhardt is currently offline Daniel EngelhardtFriend
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 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

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 #816772 is a reply to message #816418] Fri, 09 March 2012 08:41 Go to previous messageGo to next message
Daniel Engelhardt is currently offline Daniel EngelhardtFriend
Messages: 11
Registered: November 2010
Junior Member
Hello,

thank you for your quick reply.

I think my classpath is correct, but maybe I am mistaken:

1) the folder/project containing the ecore model and the source and bin files are listed as dependancies in the Manifest file of my MWE project. I tried to include related plugins as well (the editor and tests for example) but this did not have any effect.

2) After your suggestion, I tried to include certain folders in the classpath directly, i.e. via Properties -> Java Build Path -> Libraries and adding the external class folders explicitly. The external jar files containing the ecore models were correctly listed in there (as a result of point 1) I guess). Again, no effect there. Which folders do I have to include? Are the parent/project folders enough or do the src and bin files have to be included directly?

Should I maybe try to work with the MWE project and the Metamodel project in the same Eclipse instance? Would that make a difference?

(BTW: I was not able to do the debugging correctly. I started the second instance with -Xdebug and there I tried to configure the breakpoint exception properties for suspend, but the Eclipse instance never was suspended.)

Thank you again, and I am very sorry for my questions. I started working with Eclipse some time ago but I still get horribly lost in all the different layers ...

Best regards,
Daniel
Re: MWE: Couldn't load resource under platform:/resource [message #816806 is a reply to message #816772] Fri, 09 March 2012 09:28 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

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
Re: MWE: Couldn't load resource under platform:/resource [message #816850 is a reply to message #816806] Fri, 09 March 2012 10:36 Go to previous message
Daniel Engelhardt is currently offline Daniel EngelhardtFriend
Messages: 11
Registered: November 2010
Junior Member
Hello Karsten,

thank you for your help. After some more trial&error I introduced an ExtensionMap for a subpackage which made it work!
Previous Topic:[ACCELEO] Using OCL Invocation and Setting delegates
Next Topic:MWE: delay issue with mwe invoked from Eclipse' action
Goto Forum:
  


Current Time: Thu Apr 25 19:32:23 GMT 2024

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

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

Back to the top