我一直在尝试使用Acceleo。我使用Enterprise Architect来设计我的类,并将它们导出为XMI。
在Eclipse中,当我尝试使用Acceleo生成一个简单的类时,我收到以下错误。
有人可以告诉我我做错了什么吗?
我正在使用:
Acceleo版本:3.2.2.v20120807-0831
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl $ 1DiagnosticWrappedException:org.eclipse.emf.ecore.xmi.PackageNotFoundException:找不到包含uri“http://schema.omg.org/spec/XMI/2.1”的包。 (文件:/ C:/Users/Anton/git/magick/app.ui/app.ui.acceleo/Sample.xmi,3,76) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406) 在org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:361) 在org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:457) 在org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoLaunchOperation.run(AcceleoLaunchOperation.java:124) 在org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345) 在org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2327) 在org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoPluginLaunchingStrategy.launch(AcceleoPluginLaunchingStrategy.java:239) 在org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoPluginLaunchingStrategy.launch(AcceleoPluginLaunchingStrategy.java:141) 在org.eclipse.acceleo.internal.ide.ui.launching.AcceleoLaunchDelegate.launch(AcceleoLaunchDelegate.java:51) 在org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858) 在org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707) 在org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018) 在org.eclipse.debug.internal.ui.DebugUIPlugin $ 8.run(DebugUIPlugin.java:1222) 在org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) 引起:org.eclipse.emf.ecore.xmi.PackageNotFoundException:找不到包含uri'http://schema.omg.org/spec/XMI/2.1'的包。 (文件:/ C:/Users/Anton/git/magick/app.ui/app.ui.acceleo/Sample.xmi,3,76) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2599) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2429) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1306) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1475) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026) at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008) at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719) 在org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163) 在com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:506) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1303) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl $ FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) 在com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) 在com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) 在com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl $ JAXPSAXParser.parse(SAXParserImpl.java:568) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302) at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175) at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274) ......还有14个
答案 0 :(得分:0)
Acceleo找不到您声明的URI包。事实上,这样的配置文件(http://schema.omg.org/spec/XMI/2.1)在我看来并不是一个Acceleo注册的包URI,因为我也找不到它。在使用任何其他可用配置文件创建模块后,您是否手动编辑了它? 也许this link可能会帮助您解决一些问题。