Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] - Problem with Java Application runner
[Acceleo] - Problem with Java Application runner [message #690841] Thu, 30 June 2011 10:02 Go to next message
Jesus  is currently offline Jesus Friend
Messages: 5
Registered: June 2011
Junior Member
Hi people.

I'm trying to run an Acceleo project as a Java Application. I think I'm following every step of the user guide (registering packages in registerPackages method) but the application throws this exception

Exception in thread "main" java.lang.RuntimeException: Cannot create a resource for 'file:/D:/workspace%20ISA%20Abductive/Transformations%20programatically/resources/basicTest/basiccsped.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:348)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:416)
	at es.us.isa.csp2xcsp.files.Xcsp_fm_valid.<init>(Xcsp_fm_valid.java:97)
	at es.us.isa.csp2xcsp.files.Xcsp_fm_valid.main(Xcsp_fm_valid.java:147)


The file extension is ".xmi", and then I think that I don't have to register any resource factory. However, if I register xmi factory

resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());


it doesn't work too.

Exception in thread "main" org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'xcsp_fm_valid' is a proxy.
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:507)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:175)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:154)
	at es.us.isa.csp2xcsp.files.Xcsp_fm_valid.doGenerate(Xcsp_fm_valid.java:203)
	at es.us.isa.csp2xcsp.files.Xcsp_fm_valid.main(Xcsp_fm_valid.java:165)


As an acceleo plug-in application, the project runs correctly...

Thanks in advance.
Jesús.
Re: [Acceleo] - Problem with Java Application runner [message #692460 is a reply to message #690841] Mon, 04 July 2011 13:39 Go to previous messageGo to next message
Jesus  is currently offline Jesus Friend
Messages: 5
Registered: June 2011
Junior Member
Hello again

I have tried using another constructor of the main class, the one what receives an EObject. After load my model, I receive the same last exception than in the first post:

Exception in thread "main" org.eclipse.acceleo.engine.AcceleoEvaluationException: The type of the first parameter of the main template named 'xcsp_fm_valid' is a proxy.
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:507)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:175)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:154)
	at es.us.isa.csp2xcsp.files.Xcsp_fm_valid.doGenerate(Xcsp_fm_valid.java:208)
	at es.us.isa.csp2xcsp.files.Xcsp_fm_valid.main(Xcsp_fm_valid.java:170)


Does anybody know what is happening?

Thanks in advance.
Jesús.
Re: [Acceleo] - Problem with Java Application runner [message #692523 is a reply to message #692460] Mon, 04 July 2011 16:38 Go to previous message
Jesus  is currently offline Jesus Friend
Messages: 5
Registered: June 2011
Junior Member
Fixed.

Right click on project/Properties/Acceleo Compiler/Resource Kind = xmi

Jesús.
Previous Topic:Text-to-Model transformation
Next Topic:[Acceleo 3.1.0] Module file (.mtl) is not built into a .java file
Goto Forum:
  


Current Time: Fri Apr 26 15:18:10 GMT 2024

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

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

Back to the top