Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Problems with webApp MoDisco model and ATL transformation
Problems with webApp MoDisco model and ATL transformation [message #869376] Thu, 03 May 2012 06:03 Go to next message
Victor Pavon is currently offline Victor Pavon
Messages: 36
Registered: April 2012
Location: Spain
Member
Hi,

I'm tried use ATL to transform for m2m transformation, the source model is a webapp MoDisco metamodel, when I run the transformation occour the error:

Error loading platform:/resource/JSP&StrutsConfig2StrutsViewController/inputModel/web.xml_webapp.xmi: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (platform:/resource/JSP&StrutsConfig2StrutsViewController/inputModel/web.xml_webapp.xmi, 2, 25)

What am I doing wrong?

Thank you for your help.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Problems with webApp MoDisco model and ATL transformation [message #869561 is a reply to message #869376] Thu, 03 May 2012 11:41 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 588
Registered: July 2009
Senior Member
Hello,

It seems that the metamodel URI indicated in your model file is "null".
It should rather be the URI used by MoDisco to register the WebApp metamodel in the EMF Registry.
Did you obtain your model using the corresponding MoDisco discoverer?
And also, did you correctly set the metamodel in the ATL launch configuration for your transformation?

Regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Problems with webApp MoDisco model and ATL transformation [message #869773 is a reply to message #869561] Fri, 04 May 2012 05:35 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 36
Registered: April 2012
Location: Spain
Member
Hi Hugo,

The file input is a web.xml (version 2.3) [2.3_dtd_web.xml] which structure is defined in a *.dtd file. After execute webapp discoverer over this file I compare the input *.xml file and the output file [2.3_dtd_web.xml_webapp.xmi], the content of the files are the same the only differences between output and input is:
- Comment on output file are deleted
- White line on output file are deteled
- And the most important change that maybe is the cause of the error in ATL the <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" is deleted.

Mainly in the output file there isn`t any URI that reference the model and this is the cause of the problem that I talked in my first post. To solve this problem I delete de DOCTYPE definition and I add a reference to .*xsd file that defined the schema of web.xml version 2.3 [2.3_xsd_web.xml]. After execute the discoverer I obtain a new output file [2.3_xsd_web.xml_webapp.xmi], this file is a little bit different that input file and if I use this file as ATL input, the error that indicated null URI disappear. But I obtain another error:

Error loading platform:/resource/JSP&StrutsConfig2StrutsViewController/inputModel/web.xml_webapp.xmi: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'web-app' is not found or is abstract. (platform:/resource/JSP&StrutsConfig2StrutsViewController/inputModel/web.xml_webapp.xmi, 2, 80)

I look into the 2.3_xsd_web.xml_webapp.xmi and I see that for example the element web-app appear in this file like web-app but in the metamodel this is name as WebAppType and the same occur with the other element. If I change this names by the class or feature names this errors disappear and I can execute ATL rules without problems.

My question now is how can I automated this process to obtain a model that work fine with ATL without edit it manually.

Thank you for your help.
Regard.

P. D. I attach all samples file that I use.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Problems with webApp MoDisco model and ATL transformation [message #869830 is a reply to message #869773] Fri, 04 May 2012 08:55 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 588
Registered: July 2009
Senior Member
Hi Victor,

I guess your problem really comes from the WebApp model discoverer.
Actually, it has already been identified and reported by https://bugs.eclipse.org/bugs/show_bug.cgi?id=353314
This bug will be fixed at some point by the development team.
In the meantime, you have to edit your model (manually or via a program) to add the missing data.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Problems with webApp MoDisco model and ATL transformation [message #869930 is a reply to message #869830] Fri, 04 May 2012 16:55 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 36
Registered: April 2012
Location: Spain
Member
Hi Hugo,

I find a solution that can be useful to ovoid the problem with ATL. A resume what MoDisco WebApp do is load the *.xml file in a XMLResource and later save this file without doing nothing with resource. The solution I found is:
1. create a new XMIResource
2. obtain the root element of model load from XMLResource
3. add the root element obtain in the second step to the XMIResource
4. save the XMIResource instead of XMLResource.

The output file is an *.xml file that the file obtain with MoDisco, the main difference is that is defined a DocumentRoot element where is showed that file is *.xmi Mainly the output file is the same that input file the main difference is that is defined a DocumentRoot element. On the other hand I see that when the input file uses *dtd to define its structure is inserted some unused text at the begening.

I attach some sample files that I uses at input and the ouput in my strut-config discoverer, which works like WebApp discover.

Best Regard,
Víctor


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Problems with webApp MoDisco model and ATL transformation [message #870648 is a reply to message #869930] Wed, 09 May 2012 04:19 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 588
Registered: July 2009
Senior Member
Hi Victor,

Thanks for your solution!
Actually, the DocumentRoot element is automatically added by EMF when loading the XMLResource but it is not conceptually part of the model.
You can avoid its creation by setting the following load option to true: XMLResource.OPTION_SUPPRESS_DOCUMENT_ROOT.
The StrutsConfig element then becomes the root element of your model.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Problems with webApp MoDisco model and ATL transformation [message #872173 is a reply to message #870648] Tue, 15 May 2012 11:40 Go to previous message
Victor Pavon is currently offline Victor Pavon
Messages: 36
Registered: April 2012
Location: Spain
Member
Hi Hugo,

thank you very much for your advice!!

If I set the load option XMLResource.OPTION_SUPPRESS_DOCUMENT_ROOT to true. The problem that I found with file that use *.dtd to define its structure disappear. Now the discover works fine.

Best regards, Victor


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.

[Updated on: Tue, 15 May 2012 11:40]

Report message to a moderator

Previous Topic:Prohibited package name: java
Next Topic:KDM Method Invocation
Goto Forum:
  


Current Time: Fri Apr 18 06:55:52 EDT 2014

Powered by FUDForum. Page generated in 0.02753 seconds