|
|
|
|
| Re: [Acceleo] Modules recompilation [message #542198 is a reply to message #542176] |
Thu, 24 June 2010 04:37   |
Laurent Goubet Messages: 1545 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------000101040409050406080701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Hi,
This error is due to missing URI mappings and package registrations (all
of these are normally taken care of by Eclipse, yet you are in standalone).
Namely, you need to add the URI mappings for our libraries (this is the
source of the exception you copy/pasted here) :
URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlstdlib.ecore",
" platform:/plugin/org.eclipse.acceleo.model/model/mtlstdlib.e core ");
URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlnonstdlib.ecore",
" platform:/plugin/org.eclipse.acceleo.model/model/mtlnonstdli b.ecore ");
and afterwards, you'll most likely have exceptions of type "package with
URI '*' not found. Take a look at
http://eclipsemde.blogspot.com/2010/06/package-with-uri-not- found.html
for explanations on the source and solution of these if you encounter them.
Laurent Goubet
Obeo
koïta Aboubakar wrote:
> Hi,
>
> Thank you for your answers.
>
> Laurent, I get dirty hands, for sure :), but my goal is to make the
> whole process of generation outside Eclipse.
>
> On this point precisely, I have a problem compiling modules. I get the
> following error by launching AcceleoCompiler (with ant and standalone
> execution):
>
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
> java.net.UnknownHostException: www.eclipse.org
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>
> at
> org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils. java:346)
> at
> org.eclipse.acceleo.common.utils.AcceleoStandardLibrary.<init >(AcceleoStandardLibrary.java:194)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.getAcceleoStandardLibrary(AcceleoEnvironment. java:252)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.addAdditionalOperations(AcceleoEnvironment.ja va:386)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment. <init>(AcceleoEnvironment.java:101)
>
> at
> org.eclipse.acceleo.internal.compatibility.parser.ast.ocl.en vironment.AcceleoEnvironmentGalileo. <init>(AcceleoEnvironmentGalileo.java:85)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironmentFactory.loadEnvironment(AcceleoEnvironmentFact ory.java:61)
>
> at org.eclipse.ocl.OCL.<init>(OCL.java:127)
> at org.eclipse.ocl.ecore.OCL.<init>(OCL.java:90)
> at org.eclipse.ocl.ecore.OCL.newInstance(OCL.java:151)
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.init(O CLParser.java:132)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.<init >(OCLParser.java:122)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ASTFactory.initOCL(A STFactory.java:133)
>
> at
> org.eclipse.acceleo.internal.parser.ast.CST2ASTConverter.cre ateAST(CST2ASTConverter.java:127)
>
> at
> org.eclipse.acceleo.parser.AcceleoSourceBuffer.createAST(Acc eleoSourceBuffer.java:298)
>
> at
> org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser .java:159)
> at
> north.eqdml.dependencies.AcceleoCompiler.execute(AcceleoComp iler.java:191)
> at
> north.eqdml.AcceleoCompilerTest.executeTest(AcceleoCompilerT est.java:22)
--------------000101040409050406080701
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------000101040409050406080701--
|
|
|
| Re: [Acceleo] Modules recompilation [message #542201 is a reply to message #542198] |
Thu, 24 June 2010 04:50   |
Laurent Goubet Messages: 1545 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070304020004080203090204
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Sorry, my bad. The URI Mappings to register of course aren't
"platform:/plugin" as those URIs are eclipse specific and absolutely not
standalone.
Sebastien Roy faced the same problems as you, and managed to single out
the URI mappings and diverse registrations to the following few (Java
code) :
-----8<-----
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "ecore",
new EcoreResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "emtl",
new EMtlResourceFactoryImpl());
// Uncomment if you need to use UML
//
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml",
UMLResource.Factory.INSTANCE);
// Uncomment if you need to use UML
// EPackage.Registry.INSTANCE.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
// Uncomment if you need to use an UML model created with an old version
of MDT/UML
//
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/uml2/2.1.0/UML",
UMLPackage.eINSTANCE);
CodeSource acceleoModel =
MtlPackage.class.getProtectionDomain().getCodeSource();
if (acceleoModel != null) {
String libraryLocation = acceleoModel.getLocation().toString();
if (libraryLocation.endsWith(".jar")) {
libraryLocation = "jar:" + libraryLocation + '!';
}
URIConverter.URI_MAP.put(URI.createURI("http://www.eclipse.org/acceleo/mtl/3.0/mtlstdlib.ecore"),
URI.createURI(libraryLocation + "/model/mtlstdlib.ecore"));
URIConverter.URI_MAP.put(URI.createURI("http://www.eclipse.org/acceleo/mtl/3.0/mtlnonstdlib.ecore"),
URI.createURI(libraryLocation + "/model/mtlnonstdlib.ecore"));
} else {
System.err.println("Coudln't retrieve location of plugin
'org.eclipse.acceleo.model'.");
}
----->8-----
Thanks to Sebastien Roy for sharing his solution :).
Laurent Goubet
Obeo
Laurent Goubet wrote:
> Hi,
>
> This error is due to missing URI mappings and package registrations (all
> of these are normally taken care of by Eclipse, yet you are in standalone).
>
> Namely, you need to add the URI mappings for our libraries (this is the
> source of the exception you copy/pasted here) :
> URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlstdlib.ecore",
> " platform:/plugin/org.eclipse.acceleo.model/model/mtlstdlib.e core ");
> URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlnonstdlib.ecore",
> " platform:/plugin/org.eclipse.acceleo.model/model/mtlnonstdli b.ecore ");
>
> and afterwards, you'll most likely have exceptions of type "package with
> URI '*' not found. Take a look at
> http://eclipsemde.blogspot.com/2010/06/package-with-uri-not- found.html
> for explanations on the source and solution of these if you encounter them.
>
> Laurent Goubet
> Obeo
>
> koïta Aboubakar wrote:
>> Hi,
>>
>> Thank you for your answers.
>>
>> Laurent, I get dirty hands, for sure :), but my goal is to make the
>> whole process of generation outside Eclipse.
>>
>> On this point precisely, I have a problem compiling modules. I get the
>> following error by launching AcceleoCompiler (with ant and standalone
>> execution):
>>
>>
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>> java.net.UnknownHostException: www.eclipse.org
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>
>> at
>> org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils. java:346)
>> at
>> org.eclipse.acceleo.common.utils.AcceleoStandardLibrary.<init >(AcceleoStandardLibrary.java:194)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.getAcceleoStandardLibrary(AcceleoEnvironment. java:252)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.addAdditionalOperations(AcceleoEnvironment.ja va:386)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment. <init>(AcceleoEnvironment.java:101)
>>
>> at
>> org.eclipse.acceleo.internal.compatibility.parser.ast.ocl.en vironment.AcceleoEnvironmentGalileo. <init>(AcceleoEnvironmentGalileo.java:85)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironmentFactory.loadEnvironment(AcceleoEnvironmentFact ory.java:61)
>>
>> at org.eclipse.ocl.OCL.<init>(OCL.java:127)
>> at org.eclipse.ocl.ecore.OCL.<init>(OCL.java:90)
>> at org.eclipse.ocl.ecore.OCL.newInstance(OCL.java:151)
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.init(O CLParser.java:132)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.<init >(OCLParser.java:122)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ASTFactory.initOCL(A STFactory.java:133)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.CST2ASTConverter.cre ateAST(CST2ASTConverter.java:127)
>>
>> at
>> org.eclipse.acceleo.parser.AcceleoSourceBuffer.createAST(Acc eleoSourceBuffer.java:298)
>>
>> at
>> org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser .java:159)
>> at
>> north.eqdml.dependencies.AcceleoCompiler.execute(AcceleoComp iler.java:191)
>>
>> at
>> north.eqdml.AcceleoCompilerTest.executeTest(AcceleoCompilerT est.java:22)
>
--------------070304020004080203090204
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070304020004080203090204--
|
|
|
|
|
|
|
|
|
|
|
| Re: [Acceleo] Modules recompilation [message #544175 is a reply to message #543974] |
Thu, 01 July 2010 18:02   |
Koïta Aboubakar Messages: 3 Registered: June 2010 |
Junior Member |
|
|
Hello Sebastien,
Your problem is now clear to me. If your goal is to put the compiled project dependencies into the Acceleo compiler plugin's classpath, I suggest you to follow these steps at Acceleo compiler launching:
- retrieive the paths of all compiled project dependencies and stock them,
- stock the plugin dependencies path also ,
- Launch a external JVM process to run Acceleo Compiler process. For this JVM classpath, you will give all you want, in all case the compiled project and the compiled dependencies.
( Remarks that the Maven Compiler Plugin should certainly perform a similar process for compile our projects ).
I dont guaranted you that my suggestion will work, but I can assure you that a I done a elementary manipluation of POM of the compiled project in my plugin with succes.
Aboubakar
[Updated on: Thu, 01 July 2010 18:03] Report message to a moderator
|
|
|
|
|
|
|
| Re: [Acceleo] Modules recompilation [message #548558 is a reply to message #548537] |
Thu, 22 July 2010 06:57  |
Sebastien Roy Messages: 49 Registered: November 2009 |
Member |
|
|
Hello Aboubakar,
The exec-maven-plugin works perfectly : I can use it to launch the MtlCompiler with all project dependencies present in the classpath.
However, when I remove the copy of my dependencies, the AcceleoCompiler is not able to find them into the classpath.
I am very disapointed !!!
Now the answer to the problem has to be brought by Acceleo team...
|
|
|
Powered by
FUDForum. Page generated in 0.02147 seconds