Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [xtend] workflow error
[xtend] workflow error [message #532919] Tue, 11 May 2010 14:56 Go to next message
Henning  is currently offline Henning
Messages: 2
Registered: May 2010
Junior Member
I am trying to get a simple model to model transformation running but i get an exception in the worklow.

What is wrong with the following workflow? (path to ecore is correct)
<workflow>	
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
		<platformUri value=".." />
		<!--registerEcoreFile value="platform:/XXX.ecore" /-->
		<registerEcoreFile value="platform:/YYY.ecore" />
	</bean>

</workflow>

Exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
	at org.eclipse.emf.mwe.internal.core.ast.util.InjectorSimple.setValue(InjectorSimple.java:35)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitSimpleParamAST(VisitorCreator.java:203)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorBase.visit(VisitorBase.java:49)
	at org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase.accept(AbstractASTBase.java:44)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.createBean(VisitorCreator.java:157)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitComponentAST(VisitorCreator.java:118)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorBase.visit(VisitorBase.java:37)
	at org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase.accept(AbstractASTBase.java:44)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.createBean(VisitorCreator.java:157)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorCreator.visitComponentAST(VisitorCreator.java:118)
	at org.eclipse.emf.mwe.internal.core.ast.util.VisitorBase.visit(VisitorBase.java:37)
	at org.eclipse.emf.mwe.internal.core.ast.AbstractASTBase.accept(AbstractASTBase.java:44)
	at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.parseInitAndCreate(WorkflowFactory.java:74)
	at org.eclipse.emf.mwe.internal.core.ast.util.WorkflowFactory.parseInitAndCreate(WorkflowFactory.java:52)
	at org.eclipse.emf.mwe.core.WorkflowRunner.prepare(WorkflowRunner.java:332)
	at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.java:290)
	at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner.java:241)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
	at java.lang.String.substring(String.java:1937)
	at org.eclipse.emf.ecore.plugin.EcorePlugin.resolvePlatformResourcePath(EcorePlugin.java:133)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:452)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:301)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1254)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at org.eclipse.emf.mwe.utils.StandaloneSetup.addRegisterEcoreFile(StandaloneSetup.java:188)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.emf.mwe.internal.core.ast.util.InjectorSimple.setValue(InjectorSimple.java:33)
	... 16 more


thx for help
Re: [xtend] workflow error [message #533053 is a reply to message #532919] Wed, 12 May 2010 06:56 Go to previous messageGo to next message
Henning  is currently offline Henning
Messages: 2
Registered: May 2010
Junior Member
I found the error: the path was wrong. Confused
The value is an url and not a filepath.

Which is the correct way to use platformUri?
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value="c:/workspace/" />
<registerEcoreFile value="platform:modelProject/src/model/XXX.ecore" />
</bean>

=>java.net.MalformedURLException: unknown protocol: platform

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value="file://c:/workspace/" />
<registerEcoreFile value="platform:modelProject/src/model/XXX.ecore" />
</bean>

=>The platformUri location does not exist

[Updated on: Wed, 12 May 2010 07:21]

Report message to a moderator

Re: [xtend] workflow error [message #538567 is a reply to message #533053] Tue, 08 June 2010 02:03 Go to previous message
No real name is currently offline No real name
Messages: 1
Registered: June 2010
Junior Member
Try this:
<bean class="org.eclipse.mwe.emf.StandaloneSetup">
	<platformUri value=".." />
	<registerEcoreFile value="../your.package/src/model/yourModel.ecore"/>
</bean>


It worked for me.
Previous Topic:[ATL] How to make an ecore from XSD and its XML?
Next Topic:[ATL] How to use the Inter-model references
Goto Forum:
  


Current Time: Thu Oct 23 21:22:15 GMT 2014

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

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