Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found
icon5.gif  [Acceleo] Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found [message #537174] Tue, 01 June 2010 10:45 Go to next message
Lima is currently offline Lima
Messages: 2
Registered: June 2010
Junior Member
Hello guys, I'm beginning my studies in m2t transformations and when I try to do a transformation from a model (based on a metamodel that I've created), I keep getting this error message:

Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found. (file:/C:/Users/Lima/workspace/AAceleo/example01.uml, 3, 75)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:346)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:311)
	at AAceleo.files.Generate.<init>(Generate.java:83)
	at AAceleo.files.Generate.main(Generate.java:125)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found. (file:/C:/Users/Lailson/workspace/AAceleo/example01.uml, 3, 75)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2590)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2421)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1299)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1468)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1019)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:87)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1001)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:712)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:169)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.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(XMLResourceImpl.java:180)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1494)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1282)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
	... 5 more


What can I do to make Acceleo recognize this package (http://www.eclipse.org/uml2/3.0.0/UML)? I tried having a "uml.ecore" file inside my project whith that same URI but the problem persists Sad.
Re: [Acceleo] Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found [message #537234 is a reply to message #537174] Tue, 01 June 2010 11:57 Go to previous messageGo to next message
Stephane Bouchet is currently offline Stephane Bouchet
Messages: 254
Registered: July 2009
Senior Member
Hi Lima,


it means your uml model ( /C:/Users/Lima/workspace/AAceleo/example01.uml
) use the uml2 3.0.0 metamodel, and acceleo ( thru emf ) cannot find the
metamodel in eclipse.

did you use a modeling tool inside eclipse to create your model ?



Lima a écrit :
> Hello guys, I'm beginning my studies in m2t transformations and when I
> try to do a transformation from a model (based on a metamodel that I've
> created), I keep getting this error message:
>
>
> 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/3.0.0/UML' not found.
> (file:/C:/Users/Lima/workspace/AAceleo/example01.uml, 3, 75)
> 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
> org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils. java:346)
> at
> org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator. initialize(AbstractAcceleoGenerator.java:311)
>
> at AAceleo.files.Generate.<init>(Generate.java:83)
> at AAceleo.files.Generate.main(Generate.java:125)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found.
> (file:/C:/Users/Lailson/workspace/AAceleo/example01.uml, 3, 75)
> 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:87)
>
> 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(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(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:1494)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>
> 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)
>
> ... 5 more
>
>
> What can I do to make Acceleo recognize this package
> (http://www.eclipse.org/uml2/3.0.0/UML)? I tried having a "uml.ecore"
> file inside my project whith that same URI but the problem persists :(.


--
Cheers,

Stéphane Bouchet, OBEO
Re: [Acceleo] Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found [message #537257 is a reply to message #537174] Tue, 01 June 2010 13:14 Go to previous messageGo to next message
Lima is currently offline Lima
Messages: 2
Registered: June 2010
Junior Member
Thannks for you quick answer Stephane,

I made the model using the Magic Draw tool and used the "export xmi" option there. It's odd because when we create a new Acceleo project, the uml2 3.0.0 metamodel appears in the list of metamodels so I thought that Acceleo should be able to identify this metamodel in eclipse. Do you know what can I do to make Acceleo find this metamodel?
Re: [Acceleo] Package with uri 'http://www.eclipse.org/uml2/3.0.0/UML' not found [message #537358 is a reply to message #537257] Wed, 02 June 2010 03:41 Go to previous message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1623
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010802060102070500020107
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Lima,

The issue lies in how you launch your generation. When launching it
standalone, you need to register the metamodel manually (see explanation
on
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
). We allow for these registrations in the generated java class (method
"registerPackages(ResourceSet)".

This only applies when you launch your generation as a standalone
application (if you use the Acceleo Launch configuration, it is
represented as the "Java Application" choice in the "Runner" combo box
at the bottom). If you instead select "Acceleo Plug-in application", you
shouldn't have this problem.

Laurent Goubet
Obeo

Lima wrote:
> Thannks for you quick answer Stephane,
>
> I made the model using the Magic Draw tool and used the "export xmi"
> option there. It's odd because when we create a new Acceleo project, the
> uml2 3.0.0 metamodel appears in the list of metamodels so I thought that
> Acceleo should be able to identify this metamodel in eclipse. Do you
> know what can I do to make Acceleo find this metamodel?


--------------010802060102070500020107
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------010802060102070500020107--
Previous Topic:[Xpand/Xtend 1.0 RC1] problem when calling a Java method from Xtend in an Xpand template
Next Topic:[Xtend] test on infinity value
Goto Forum:
  


Current Time: Wed Aug 20 16:33:39 EDT 2014

Powered by FUDForum. Page generated in 0.12478 seconds