Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360934 - Cannot execute imported binary template
Summary: Cannot execute imported binary template
Status: CLOSED DUPLICATE of bug 360926
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows Vista
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-14 05:30 EDT by Ed Willink CLA
Modified: 2016-04-06 09:08 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-10-14 05:30:05 EDT
If a binary template is imported for execution the proxy URI resolution gives

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.

which fails to propagate to the user.

This appears to be a not-unsurprising corrolary of the design decision to support binary/XMI formatting without using EMF's capabilities. In my experience, using a custom ResourceSet to vary EMF behaviour has an endless stream of unforeseen consequences whenever alternative demands are placed on EMF. If the ResourceSet reeally must be modified, then use an Adapter.

If the binary/XMI treatment of a resource is resolved after examining its content rather than by restrictive program context expectations, an arbitrary mix of binary/XMI formats should cause no problems.
Comment 1 Stephane Begaudeau CLA 2011-10-14 11:06:39 EDT
Our custom resource set (AcceleoResourceSet) is just a convenience used to set a proxy resource factory registry on top of the regular EMF resource factory registry to handle the two available content type for an Acceleo module.


>>>If the binary/XMI treatment of a resource is resolved after examining its
>>>content rather than by restrictive program context expectations, an arbitrary
>>>mix of binary/XMI formats should cause no problems.

Each time an ".emtl" file is loaded in this resource set, we are looking at its content with a content describer thanks to our resource factory rsgistry. We do not care about the properties registered in the project while loading ".emtl" files since the loading can occur with an exported Acceleo project without its preferences for example out of Eclipse.

Do you have the full stack trace of your problem?
Comment 2 Ed Willink CLA 2011-10-14 13:19:09 EDT
(In reply to comment #1)
> >>>If the binary/XMI treatment of a resource is resolved after examining its
> >>>content rather than by restrictive program context expectations, an arbitrary
> >>>mix of binary/XMI formats should cause no problems.

> Each time an ".emtl" file is loaded in this resource set, we are looking at its
> content with a content describer thanks to our resource factory rsgistry. We do
> not care about the properties registered in the project while loading ".emtl"
> files since the loading can occur with an exported Acceleo project without its
> preferences for example out of Eclipse.

I don't follow. If you don't need the ResourceSet, because it all works from the content/extension registration why provide one? UML doesn't provide one even though it has many complex *.uml/*.cmof ... pathmaps and urimaps to get right.
 
> Do you have the full stack trace of your problem?

org.eclipse.acceleo.engine.AcceleoEvaluationException: Error while resolving module dependencies.
	at org.eclipse.acceleo.engine.internal.environment.AcceleoEvaluationEnvironment.getAllCandidateNamesakes(AcceleoEvaluationEnvironment.java:541)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoEvaluationEnvironment.getAllCandidates(AcceleoEvaluationEnvironment.java:309)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.prepareInvocation(AcceleoEvaluationVisitor.java:1548)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoTemplateInvocation(AcceleoEvaluationVisitor.java:910)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1715)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1009)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoTemplate(AcceleoEvaluationVisitor.java:877)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1679)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1009)
	at org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(QueryImpl.java:152)
	at org.eclipse.ocl.ecore.QueryImpl.evaluate(QueryImpl.java:62)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.doEvaluate(AcceleoEngine.java:360)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.evaluate(AcceleoEngine.java:141)
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerateTemplate(AcceleoService.java:869)
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:575)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:193)
	at org.eclipse.qvtd.build.utilities.QVTVisitorCodeGenerator.invokeInternal(QVTVisitorCodeGenerator.java:100)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:97)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)

[The problem is reproducible by changing the org.eclipse.ocl.examples.build project to binary, then running org.eclipse.qvtd.build's GenerateQVTVisitors.mwe2 launch. - the plugin exports should be on the OCL bug/349962 branch soon, and the QVTd master branch.]
Comment 3 Laurent Goubet CLA 2016-04-06 09:08:17 EDT
This is now a pure duplicate of bug 360926, but with xmi serialization instead of the xmi one : works in eclipse, not in standalone.

*** This bug has been marked as a duplicate of bug 360926 ***