Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364314 - Regression : ResourceFactories using standalone launcher
Summary: Regression : ResourceFactories using standalone launcher
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 critical
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 07:51 EST by Cedric Brun CLA
Modified: 2015-05-27 08:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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