Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MOFScript » call transformation from Java API
call transformation from Java API [message #520163] Thu, 11 March 2010 12:16 Go to next message
yeliu is currently offline yeliu
Messages: 145
Registered: July 2009
Senior Member
Hello,
I tried running the TestAPI.java found in the user guide.
The execution is suspended at the line: Resource resource = rSet.getResource(uri, true);
throwing the following exceptions:
-----------------
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/uml2/2.1.0/UML' not found. (file:/home/yeliu/workspace/MOFScriptApp/Architectural_Descr iption.uml, 2, 177)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at TestAPI.execute(TestAPI.java:65)
at TestAPI.test(TestAPI.java:98)
at TestAPI.main(TestAPI.java:120)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/uml2/2.1.0/UML' not found. (file:/home/yeliu/workspace/MOFScriptApp/Architectural_Descr iption.uml, 2, 177)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:83)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(AbstractSAXParser.java:501)
at

--------------------
I inserted a print statement right after :
URI uri = URI.createFileURI(sourceModelFile.getAbsolutePath());
and get the following URI printed.
file:/home/yeliu/workspace/MOFScriptApp/Architectural_Descri ption.uml
The input model of the transformation is :http://www.eclipse.org/uml2/3.0.0/UML.
Any one can help with this ?
Thanks a lot!


M


Re: call transformation from Java API [message #520443 is a reply to message #520163] Fri, 12 March 2010 07:18 Go to previous messageGo to next message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hello,

the exception says uml2/2.1.0/UML not found, you say that your input is
3.0.0.

What does the input model in your transformation say, http//.........?

Cheers,
G
Re: call transformation from Java API [message #520444 is a reply to message #520443] Fri, 12 March 2010 12:22 Go to previous messageGo to next message
yeliu is currently offline yeliu
Messages: 145
Registered: July 2009
Senior Member
Hello,
The header of the input model which we wanna transform is the following:
---------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_dcOv4OiaEd6gMtZRCjS81g" name="Metamodel">
------------------

The input metamodel to the transformation now is uml:"http://www.eclipse.org/uml2/3.0.0/UML". It was uml="http://www.eclipse.org/uml2/2.1.0/UML before, but then there are parsing errors. The parsing errors are gone after change it to uml2/3.0.0.
We are very confused.



M
Re: call transformation from Java API [message #520502 is a reply to message #520444] Fri, 12 March 2010 16:19 Go to previous messageGo to next message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
And what org.eclipse...uml...jars are you adding to your classpath?

The versions are supposed to match....

If you are not able to make this work, you will have to send me the model,
transformation and the java code so I can take a detailed look.

/G
Re: call transformation from Java API [message #520761 is a reply to message #520502] Mon, 15 March 2010 09:06 Go to previous messageGo to next message
yeliu is currently offline yeliu
Messages: 145
Registered: July 2009
Senior Member
Hello,
The UML related library(uml2.common, uml2.uml) I added in the path are:
-----------------
UML_CP=$EH/org.eclipse.uml2.common_1.5.0.v200905041045.jar:$ EH/org.eclipse.uml2.uml_3.0.1.v200908281330.jar
-----------------
these are available ones I can find on my computer, I wanted to attach these files, but couldn't find the specific attachment button in this forum.
Is any other way to send them to you?








M


Re: call transformation from Java API [message #589813 is a reply to message #520502] Mon, 15 March 2010 09:06 Go to previous message
yeliu is currently offline yeliu
Messages: 145
Registered: July 2009
Senior Member
Hello,
The UML related library(uml2.common, uml2.uml) I added in the path are:
-----------------
UML_CP=$EH/org.eclipse.uml2.common_1.5.0.v200905041045.jar:$ EH/org.eclipse.uml2.uml_3.0.1.v200908281330.jar
-----------------
these are available ones I can find on my computer, I wanted to attach these files, but couldn't find the specific attachment button in this forum.
Is any other way to send them to you?








M
Previous Topic:call transformation from Java API
Next Topic:transform uml2 2.1.0
Goto Forum:
  


Current Time: Wed Oct 22 09:39:59 GMT 2014

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

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