Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » UML2OWL transformation gives error
UML2OWL transformation gives error [message #93539] Tue, 28 October 2008 21:22 Go to next message
Rocky Dunlap is currently offline Rocky Dunlap
Messages: 12
Registered: July 2009
Junior Member
A bit of background:

I have downloaded and installed the Eclipse Modeling Tools distribution of
Eclipse, which includes ATL 2.0.1.

Then, I downloaded the UML to OWL transformation from here:
http://www.eclipse.org/m2m/atl/atlTransformations/#UML2OWL

My goal is to go from UML to an OWL file (the XML representation). This
is a two step process using the UML to OWL transformation. The first
transformation takes the UML (in XMI format) to an OWL ecore model. The
second transformation takes the OWL ecore into the OWL XML representation.
I am testing this using the Museum example that comes with the UML to OWL
transformation.

I am able to transform the Museum.uml file to Museum-OWL.ecore file--or at
least it does not give me any error messages. When I look at the .ecore
file everything seems okay, although I'm not sure what kind of errors I
would look for. It is certainly well-formed XML and appears to be a valid
ecore model.

Then, I attempt to do the transform from Museum-OWL.ecore to Museum.owl.
I am doing this by creating a "Run Configuration" in Eclipse. The
metamodels are:

Source: /UML2OWL/OWL/OWL.ecore
Target: /UML2OWL/AMMACore/XML.ecore

However, when I run the transformation, I get the following stack trace.
Can anyone help?



SEVERE: -1
java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 37)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFra gmentSegment(BasicEObjectImpl.java:536)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:775)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:751)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1125)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:345)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:246)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.loadModel(Atl RegularVM.java:230)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.getSourceMode ls(AtlRegularVM.java:148)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:304)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:764)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:880)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1083)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
SEVERE: null
java.lang.NullPointerException
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.getSourceMode ls(AtlRegularVM.java:150)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:304)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:764)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:880)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1083)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: UML2OWL transformation gives error [message #93626 is a reply to message #93539] Wed, 29 October 2008 09:54 Go to previous messageGo to next message
Guillaume Hillairet is currently offline Guillaume Hillairet
Messages: 83
Registered: July 2009
Member
Hello,

The version of UML2OWL available on the ATL use case is not up to date.
Try this version instead
http://perso.univ-lr.fr/ghillair/projects/UML2OWL.zip.

Regards,
Guillaume.

Rocky Dunlap wrote:

> A bit of background:

> I have downloaded and installed the Eclipse Modeling Tools distribution of
> Eclipse, which includes ATL 2.0.1.

> Then, I downloaded the UML to OWL transformation from here:
> http://www.eclipse.org/m2m/atl/atlTransformations/#UML2OWL

> My goal is to go from UML to an OWL file (the XML representation). This
> is a two step process using the UML to OWL transformation. The first
> transformation takes the UML (in XMI format) to an OWL ecore model. The
> second transformation takes the OWL ecore into the OWL XML representation.
> I am testing this using the Museum example that comes with the UML to OWL
> transformation.

> I am able to transform the Museum.uml file to Museum-OWL.ecore file--or at
> least it does not give me any error messages. When I look at the .ecore
> file everything seems okay, although I'm not sure what kind of errors I
> would look for. It is certainly well-formed XML and appears to be a valid
> ecore model.

> Then, I attempt to do the transform from Museum-OWL.ecore to Museum.owl.
> I am doing this by creating a "Run Configuration" in Eclipse. The
> metamodels are:

> Source: /UML2OWL/OWL/OWL.ecore
> Target: /UML2OWL/AMMACore/XML.ecore

> However, when I run the transformation, I get the following stack trace.
> Can anyone help?



> SEVERE: -1
> java.lang.ArrayIndexOutOfBoundsException: -1
> at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:5 37)
> at
>
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFra gmentSegment(BasicEObjectImpl.java:536)
> at
>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:775)
> at
>
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:751)
> at
>
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1125)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
> at
>
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
> Source)
> at
>
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
>
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
>
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
> at
>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
> at
>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
> at
>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at
>
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.loadASMEMFMo del(ASMEMFModel.java:345)
> at
>
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.loadModel(AtlE MFModelHandler.java:246)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.loadModel(Atl RegularVM.java:230)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.getSourceMode ls(AtlRegularVM.java:148)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:304)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
> at
>
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:764)
> at
>
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
> at
>
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:880)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1083)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> SEVERE: null
> java.lang.NullPointerException
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.getSourceMode ls(AtlRegularVM.java:150)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:304)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
> at
>
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
> at
>
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:764)
> at
>
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
> at
>
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:880)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1083)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: UML2OWL transformation gives error [message #93837 is a reply to message #93626] Wed, 29 October 2008 14:59 Go to previous messageGo to next message
Rocky Dunlap is currently offline Rocky Dunlap
Messages: 12
Registered: July 2009
Junior Member
Hi Guillaume,

Thanks for the update. A couple of questions:

1. You did not include an OWL2XML.atl file, although there is an
OWL2XML.asm file. I'm not sure if I can run a launch configuration
without the .atl file?

2. According to the ATL documentation I have read (some of which appears
to be out of date) it says that compilation will happen automatically when
an .atl file is saved (a .asm file will be generated). For some reason
that is not happening for me. Any ideas why? Is there a way I can kick
off the compilation manually?

Thanks,
Rocky

Guillaume Hillairet wrote:

> Hello,

> The version of UML2OWL available on the ATL use case is not up to date.
> Try this version instead
> http://perso.univ-lr.fr/ghillair/projects/UML2OWL.zip.

> Regards,
> Guillaume.
Re: UML2OWL transformation gives error [message #93867 is a reply to message #93837] Wed, 29 October 2008 17:19 Go to previous messageGo to next message
Guillaume Hillairet is currently offline Guillaume Hillairet
Messages: 83
Registered: July 2009
Member
Hi,

comments below,

Rocky Dunlap wrote:

> Hi Guillaume,

> Thanks for the update. A couple of questions:

> 1. You did not include an OWL2XML.atl file, although there is an
> OWL2XML.asm file. I'm not sure if I can run a launch configuration
> without the .atl file?

The presence of the .atl file is not necessary since there is an .asm
file. As you can see in the build.xml, this is the .asm that is called and
not the .atl. And I think you can also use the launch configuration with
an .asm file (if not i will add the .atl file to the project), but i
recommend you to use the ant script.

> 2. According to the ATL documentation I have read (some of which appears
> to be out of date) it says that compilation will happen automatically when
> an .atl file is saved (a .asm file will be generated). For some reason
> that is not happening for me. Any ideas why? Is there a way I can kick
> off the compilation manually?

This problem is surely due to the .project file. Try creating a new
UML2OWL project in your workspace. Then copy metamodels, transformations
files and build.xml in this new project. So the compilation process should
work fine again.

> Thanks,
> Rocky

> Guillaume Hillairet wrote:

>> Hello,

>> The version of UML2OWL available on the ATL use case is not up to date.
>> Try this version instead
>> http://perso.univ-lr.fr/ghillair/projects/UML2OWL.zip.

>> Regards,
>> Guillaume.
Re: UML2OWL transformation gives error [message #93880 is a reply to message #93867] Wed, 29 October 2008 19:15 Go to previous messageGo to next message
Rocky Dunlap is currently offline Rocky Dunlap
Messages: 12
Registered: July 2009
Junior Member
> The presence of the .atl file is not necessary since there is an .asm
> file. As you can see in the build.xml, this is the .asm that is called and
> not the .atl. And I think you can also use the launch configuration with
> an .asm file (if not i will add the .atl file to the project), but i
> recommend you to use the ant script.

If possible, I would appreciate having the .atl file so I can see the
rules. In addition to doing the transform, I have some research motives
on the side, so seeing the rules would be beneficial.

As far as I can see, the launch configuration only allows .atl files.
When I attempt to use build.xml, ant gives me the following error. I have
selected "Run in the same JRE as the workspace."

Buildfile: C:\Documents and Settings\Rocky\workspace-atl2\UML2OWL\build.xml

loadModels:

BUILD FAILED
C:\Documents and Settings\Rocky\workspace-atl2\UML2OWL\build.xml:34:
Problem: failed to create task or type am3.loadModel
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken
place.



> This problem is surely due to the .project file. Try creating a new
> UML2OWL project in your workspace. Then copy metamodels, transformations
> files and build.xml in this new project. So the compilation process should
> work fine again.

Great! The issue was the .project file as you suggested. Compilation is
working fine now.
Re: UML2OWL transformation gives error [message #94441 is a reply to message #93880] Tue, 04 November 2008 10:35 Go to previous messageGo to next message
Guillaume Hillairet is currently offline Guillaume Hillairet
Messages: 83
Registered: July 2009
Member
Hi Rocky,

I've updated the UML2OWL project
(http://perso.univ-lr.fr/ghillair/projects/UML2OWL.zip), so now there is a
new version for the OWL metamodel, update in UML2OWL.atl file and i've
added the OWL2XML.atl file.
Concerning you're problem with the build.xml, you need to install AM3 for
ATL developers (see http://wiki.eclipse.org/AM3/How_Install_AM3_From_SVN)
so you can use specific am3 ant actions. You also need AM3 for the
serialization of the XML model (created by OWL2XML.atl) into a plain xml
file (owl/xml format).

Best Regards,
Guillaume.

Rocky Dunlap wrote:

>> The presence of the .atl file is not necessary since there is an .asm
>> file. As you can see in the build.xml, this is the .asm that is called and
>> not the .atl. And I think you can also use the launch configuration with
>> an .asm file (if not i will add the .atl file to the project), but i
>> recommend you to use the ant script.

> If possible, I would appreciate having the .atl file so I can see the
> rules. In addition to doing the transform, I have some research motives
> on the side, so seeing the rules would be beneficial.

> As far as I can see, the launch configuration only allows .atl files.
> When I attempt to use build.xml, ant gives me the following error. I have
> selected "Run in the same JRE as the workspace."

> Buildfile: C:Documents and SettingsRockyworkspace-atl2UML2OWLbuild.xml

> loadModels:

> BUILD FAILED
> C:Documents and SettingsRockyworkspace-atl2UML2OWLbuild.xml:34:
> Problem: failed to create task or type am3.loadModel
> Cause: The name is undefined.
> Action: Check the spelling.
> Action: Check that any custom tasks/types have been declared.
> Action: Check that any <presetdef>/<macrodef> declarations have taken
> place.



>> This problem is surely due to the .project file. Try creating a new
>> UML2OWL project in your workspace. Then copy metamodels, transformations
>> files and build.xml in this new project. So the compilation process should
>> work fine again.

> Great! The issue was the .project file as you suggested. Compilation is
> working fine now.
Re: UML2OWL transformation gives error [message #100415 is a reply to message #94441] Thu, 19 February 2009 19:56 Go to previous messageGo to next message
SarahMc is currently offline SarahMc
Messages: 2
Registered: July 2009
Junior Member
I have the same error, when I run build.xml I get this:

Buildfile: E:\ATLBundle-20080109\eclipse\workspace\Tester_UML2OWL\build .xml
loadModels:

BUILD FAILED
E:\ATLBundle-20080109\eclipse\workspace\Tester_UML2OWL\build .xml:34:
Problem: failed to create task or type am3.loadModel
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken
place.

I did what you suggest to Dunlap, I create a new project in the workspace
in which I move models and meta models and atl files but it still gives me
the same error, how can I solve this?
Thanks.
Re: UML2OWL transformation gives error [message #100468 is a reply to message #100415] Fri, 20 February 2009 14:55 Go to previous messageGo to next message
Ronan B is currently offline Ronan B
Messages: 247
Registered: July 2009
Senior Member
Hey,
I think you either don't have AM3 installed or there is an incompatibility
in your setup. Can you see the AM3 perspective? If not then the plugins
are not installed correctly. You should note a number of people have had
problems with the latest version of the AM3 plugins so maybe look at the
older ones also available on the AM3 site/SVN.
Cheers,
Ronan
Re: UML2OWL transformation gives error [message #100590 is a reply to message #100468] Tue, 24 February 2009 19:28 Go to previous messageGo to next message
SarahMc is currently offline SarahMc
Messages: 2
Registered: July 2009
Junior Member
Hi,
Thank you Ronan for your reply.Yes I see the AM3 perspective, the problem
was in the launch configuration of the build.xml file, now it works, the
owl file is generated but I have this error:

BUILD FAILED
E:\ATLBundle-20080109\eclipse\workspace\UML2OWL\build.xml:34 : Model named
UML has already been loaded.

Can someone explain me why? Thanks.
Re: UML2OWL transformation gives error [message #100932 is a reply to message #100590] Mon, 02 March 2009 16:33 Go to previous messageGo to next message
Ronan B is currently offline Ronan B
Messages: 247
Registered: July 2009
Senior Member
Yes, you are loading the same model twice in your ANT build script.
Re: UML2OWL transformation gives error [message #535169 is a reply to message #93539] Fri, 21 May 2010 13:24 Go to previous message
Redhouane  is currently offline Redhouane
Messages: 1
Registered: May 2010
Junior Member
hi
I meet the same problem as you SarahMc,
you had said that the problem
was in the launch configuration of the build.xml file, how to regulate it svp? Crying or Very Sad
Previous Topic:1..* transformation in QVT
Next Topic:Metamodel migration, how to ?
Goto Forum:
  


Current Time: Tue Oct 21 00:30:36 GMT 2014

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

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