Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] MWE2 Workflow fails with package uri not found
[Xpand] MWE2 Workflow fails with package uri not found [message #1311456] Wed, 23 April 2014 20:25 Go to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 30
Registered: May 2011
Member
Hi, I am new to Xpand and falling at the first hurdle :(

I have modified the example MWE and MWE2 workflows to try my own model
and both fail with something like:

80 ERROR Mwe2Launcher - Problems running workflow
xpand.example.Generator: Couldn't load resource under
platform:/resource/com.test.xpand/src/Test.xmi :
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
'http://my.test.com/1.0' not found.
(platform:/resource/com.test.xpand/src/Test.xmi, 2, 180)

In my Test.xmi file there is a reference to the http://my.test.com/1.0 uri:

xmlns:com.test="http://my.test.com/1.0"

In the manifest.mf for my Xpand generator project I have added my EMF
project as a dependancy:

Require-Bundle: org.eclipse.jdt.core;bundle-version="3.5.0",
org.eclipse.xtend.profiler;resolution:=optional,
...,
com.test.emf;bundle-version="1.0.0"


And within the plugin.xml of the EMF project the following extension
point uses this URI:

<extension point="org.eclipse.emf.ecore.generated_package">
<!-- @generated TEST -->
<package
uri="http://my.test.com/1.0"
class="com.test.TestPackage"
genModel="model/Test.genmodel"/>
</extension>

Thanks to any one who can help me figure out what I am missing from my
setup?

Nigel
Re: [Xpand] MWE2 Workflow fails with package uri not found [message #1311543 is a reply to message #1311456] Wed, 23 April 2014 21:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6302
Registered: July 2009
Senior Member
How does the MWe file look like. The package registration should be
the , usually in the standalonesetup
Re: [Xpand] MWE2 Workflow fails with package uri not found [message #1311606 is a reply to message #1311543] Wed, 23 April 2014 22:26 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 30
Registered: May 2011
Member
Hi Christian,

thanks for helping, my MWE file looks like the following:

<?xml version="1.0"?>
<workflow>
<property name="jad" value="com.test.xpand/src/Test.xmi" />
<property name="src-gen" value="src-gen" />

<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value="../"/>
</bean>

<!-- instantiate metamodel -->
<bean id="mm_emf"
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />

<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="platform:/resource/${jad}" />
<modelSlot value="jad" />
</component>

<!-- Clear output directory -->
<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
<directory value="${src-gen}"/>
</component>

<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="mm_emf"/>
<expand
value="template::JADTemplate::main FOR jaf" />
<outlet path="${src-gen}" />
<resourceManager class
="org.eclipse.xtend.expression.ResourceManagerDefaultImpl">
<fileEncoding value="UTF-8"/>
</resourceManager>
</component>
</workflow>

It is based on the example file.


On 23/04/2014 14:39, Christian Dietrich wrote:
> How does the MWe file look like. The package registration should be the
> , usually in the standalonesetup
Re: [Xpand] MWE2 Workflow fails with package uri not found [message #1311721 is a reply to message #1311606] Thu, 24 April 2014 00:01 Go to previous messageGo to next message
Nigel Daniels is currently offline Nigel Daniels
Messages: 30
Registered: May 2011
Member
Hi Christian,

thanks for the suggestion about registering the package in the
standalone set up... a bit more research in this area showed me that I
was missing the following:

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value="../"/>
<registerEcoreFile
value="platform:/resource/com.test.emf/model/Test.ecore" />
</bean>

Thanks!

On 23/04/2014 15:26, Nigel Daniels wrote:
> Hi Christian,
>
> thanks for helping, my MWE file looks like the following:
>
> <?xml version="1.0"?>
> <workflow>
> <property name="jad" value="com.test.xpand/src/Test.xmi" />
> <property name="src-gen" value="src-gen" />
>
> <!-- set up EMF for standalone execution -->
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
> <platformUri value="../"/>
> </bean>
>
> <!-- instantiate metamodel -->
> <bean id="mm_emf"
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />
>
> <!-- load model and store it in slot 'model' -->
> <component class="org.eclipse.emf.mwe.utils.Reader">
> <uri value="platform:/resource/${jad}" />
> <modelSlot value="jad" />
> </component>
>
> <!-- Clear output directory -->
> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
> <directory value="${src-gen}"/>
> </component>
>
> <!-- generate code -->
> <component class="org.eclipse.xpand2.Generator">
> <metaModel idRef="mm_emf"/>
> <expand
> value="template::JADTemplate::main FOR jaf" />
> <outlet path="${src-gen}" />
> <resourceManager class
> ="org.eclipse.xtend.expression.ResourceManagerDefaultImpl">
> <fileEncoding value="UTF-8"/>
> </resourceManager>
> </component>
> </workflow>
>
> It is based on the example file.
>
>
> On 23/04/2014 14:39, Christian Dietrich wrote:
>> How does the MWe file look like. The package registration should be the
>> , usually in the standalonesetup
>
Re: [Xpand] MWE2 Workflow fails with package uri not found [message #1312194 is a reply to message #1311606] Thu, 24 April 2014 06:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

If you install the MWE2 language feature you get a nice Xtext editor for
MWE and don't have to work within <>'s.

Regards

Ed Willink

On 23/04/2014 23:26, Nigel Daniels wrote:
> Hi Christian,
>
> thanks for helping, my MWE file looks like the following:
>
> <?xml version="1.0"?>
> <workflow>
> <property name="jad" value="com.test.xpand/src/Test.xmi" />
> <property name="src-gen" value="src-gen" />
>
> <!-- set up EMF for standalone execution -->
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
> <platformUri value="../"/>
> </bean>
>
> <!-- instantiate metamodel -->
> <bean id="mm_emf"
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />
>
> <!-- load model and store it in slot 'model' -->
> <component class="org.eclipse.emf.mwe.utils.Reader">
> <uri value="platform:/resource/${jad}" />
> <modelSlot value="jad" />
> </component>
>
> <!-- Clear output directory -->
> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
> <directory value="${src-gen}"/>
> </component>
>
> <!-- generate code -->
> <component class="org.eclipse.xpand2.Generator">
> <metaModel idRef="mm_emf"/>
> <expand
> value="template::JADTemplate::main FOR jaf" />
> <outlet path="${src-gen}" />
> <resourceManager class
> ="org.eclipse.xtend.expression.ResourceManagerDefaultImpl">
> <fileEncoding value="UTF-8"/>
> </resourceManager>
> </component>
> </workflow>
>
> It is based on the example file.
>
>
> On 23/04/2014 14:39, Christian Dietrich wrote:
>> How does the MWe file look like. The package registration should be the
>> , usually in the standalonesetup
>
Re: [Xpand] MWE2 Workflow fails with package uri not found [message #1313550 is a reply to message #1312194] Thu, 24 April 2014 23:37 Go to previous message
Nigel Daniels is currently offline Nigel Daniels
Messages: 30
Registered: May 2011
Member
Hi Ed,

I've installed the MWE2 plugins and they have made my MWE files easier
to read but my Xpand file is now showing as having errors everywhere? Is
there a validator being triggered that should not be?

BTW I also found if I try and uninstall these plugins my eclipse hangs
on restart trying to load org.eclipse.xtext.ui.shared. I guess they pull
out a dependency they should not :(

Any advice on the former part welcome, as the editor makes life a lot
simpler.

Nigel

On 23/04/2014 23:26, Ed Willink wrote:
> Hi
>
> If you install the MWE2 language feature you get a nice Xtext editor for
> MWE and don't have to work within <>'s.
>
> Regards
>
> Ed Willink
>
> On 23/04/2014 23:26, Nigel Daniels wrote:
>> Hi Christian,
>>
>> thanks for helping, my MWE file looks like the following:
>>
>> <?xml version="1.0"?>
>> <workflow>
>> <property name="jad" value="com.test.xpand/src/Test.xmi" />
>> <property name="src-gen" value="src-gen" />
>>
>> <!-- set up EMF for standalone execution -->
>> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
>> <platformUri value="../"/>
>> </bean>
>>
>> <!-- instantiate metamodel -->
>> <bean id="mm_emf"
>> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />
>>
>> <!-- load model and store it in slot 'model' -->
>> <component class="org.eclipse.emf.mwe.utils.Reader">
>> <uri value="platform:/resource/${jad}" />
>> <modelSlot value="jad" />
>> </component>
>>
>> <!-- Clear output directory -->
>> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner">
>> <directory value="${src-gen}"/>
>> </component>
>>
>> <!-- generate code -->
>> <component class="org.eclipse.xpand2.Generator">
>> <metaModel idRef="mm_emf"/>
>> <expand
>> value="template::JADTemplate::main FOR jaf" />
>> <outlet path="${src-gen}" />
>> <resourceManager class
>> ="org.eclipse.xtend.expression.ResourceManagerDefaultImpl">
>> <fileEncoding value="UTF-8"/>
>> </resourceManager>
>> </component>
>> </workflow>
>>
>> It is based on the example file.
>>
>>
>> On 23/04/2014 14:39, Christian Dietrich wrote:
>>> How does the MWe file look like. The package registration should be the
>>> , usually in the standalonesetup
>>
>
Previous Topic:Exporting an Acceleo 3.0 generator as an Eclipse Plugin
Next Topic:[Xpand] Programmatic tutorial?
Goto Forum:
  


Current Time: Fri Sep 19 12:07:20 GMT 2014

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

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