Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364314

Summary: Regression : ResourceFactories using standalone launcher
Product: [Modeling] Acceleo Reporter: Cedric Brun <cedric.brun>
Component: CoreAssignee: Project Inbox <acceleo-inbox>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: stephane.begaudeau
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Cedric Brun CLA 2011-11-21 07:51:51 EST
When I launch my generator as a standalone launcher, since 3.2 I get :

Exception in thread "main" java.lang.RuntimeException: Cannot create a resource for 'file:/home/cedric/spaces/compare/compare/doc/features.xmi'; a registered resource factory is needed
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:394)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:358)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:451)
	at fr.obeo.dsl.version.common.Generate.<init>(Generate.java:90)
	at fr.obeo.dsl.version.common.Generate.main(Generate.java:137)


My resource is just a plain old XMI. Looking in the code, the method :

org.eclipse.acceleo.common.utils.ModelUtils.ensureResourceFactoryPresent(ResourceSet)

now only register the XMI resource factory using content types and no more using file extensions. I'm pretty sure the platform will not be able to give the content type in a standalone environement. You should probably update the code so that it register XMI both for the content types and file extension.
Comment 1 Stephane Begaudeau CLA 2012-03-13 06:31:33 EDT
"I'm pretty sure the platform will not be able to give the content type in a standalone environement"

Content type description is available in stand alone, but it needs to be registered manually and the description needs the extension of a file and we only register it for "emtl" files (xmi/binary). I've fixed the problem on master and R3_2_maintenance and I've added a unit test in our stand alone tests.
Comment 2 Laurent Goubet CLA 2015-05-27 08:55:28 EDT
Closing resolved bugs