JETEmitter failing to build with Custom Templates [message #651038] |
Thu, 27 January 2011 14:34 |
Rob Mising name Messages: 118 Registered: July 2010 |
Senior Member |
|
|
Hi,
I've started using templates and I have just started getting the intermittent bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=274868
I'm stuck on 2.4.2 at the moment (long story - but out of my control), please can anyone suggest a way that I can work around this (without hacking the EMF packages)?
To clarify, at the moment we do the generation using:
Generator generator = new Generator();
generator.setInput(genModel);
diagnostic = generator.generate(genModel,
GenBaseGeneratorAdapter.MODEL_PROJECT_TYPE,
BasicMonitor
.toMonitor(new org.eclipse.core.runtime.NullProgressMonitor()));
Thanks
Rob
[Updated on: Fri, 28 January 2011 15:09] Report message to a moderator
|
|
|
Re: JETEmitter failing to build with Custom Templates [message #651256 is a reply to message #651038] |
Fri, 28 January 2011 15:21 |
Rob Mising name Messages: 118 Registered: July 2010 |
Senior Member |
|
|
This one is driving me crazy, what I originally thought was the previously mentioned bug may not actually be that bug - just showing the same error.
The error I am getting is along the lines of:
Quote: | org.eclipse.emf.codegen.jet.JETException: ClassNotFoundException: org.eclipse.emf.codegen.ecore.templates.model.ValidatorClass _
|
I have been looking at this with the debugger and it appeas in JETEmitter.java (EclipseHelper.initialize) it appears to be generating each of the files:
.JETEmitters\src\org\eclipse\emf\codegen\ecore\templates\model\ValidatorClass_.java
Which seems to be working, and then tries to build them, this is where the problem occurs, it seems to assume that they are built immediately, however this is not the case, it is as if they have been put onto a queue to wait to be built. Then later in the code:
Class<?> theClass =
theClassLoader.loadClass
((packageName.length() == 0 ? "" : packageName + ".") + jetCompiler.getSkeleton().getClassName());
The attempt to load the classes fail, as they haven't been built yet. This means everything fails - then after the failure, they seem to suddenly build:
.JETEmitters\bin\org\eclipse\emf\codegen\ecore\templates\model\ValidatorClass_.class
It may be worth noting that I have auto-build on, and the call to request the building of the EMF project using the templates is being made from a seperate project that has been kicked off by an auto-build itself.
What are peoples thoughts on the fact that the class files are not being generated due to them being put on the back of the build queue which will not be processed until the "current build" operation is completed?
Any suggestions would be great!, Thanks, Rob
|
|
|
Re: JETEmitter failing to build with Custom Templates [message #651368 is a reply to message #651256] |
Sun, 30 January 2011 00:20 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Rob,
You're trying to generate during the middle of an on-going auto build?
Rob wrote:
> This one is driving me crazy, what I originally thought was the
> previously mentioned bug may not actually be that bug - just showing
> the same error.
>
> The error I am getting is along the lines of:
>
> Quote:
>> org.eclipse.emf.codegen.jet.JETException: ClassNotFoundException:
>> org.eclipse.emf.codegen.ecore.templates.model.ValidatorClass _
>
>
> I have been looking at this with the debugger and it appeas in
> JETEmitter.java (EclipseHelper.initialize) it appears to be generating
> each of the files:
>
> JETEmitters\src\org\eclipse\emf\codegen\ecore\templates\mode l\ValidatorClass_.java
>
>
> Which seems to be working, and then tries to build them, this is where
> the problem occurs, it seems to assume that they are built
> immediately, however this is not the case, it is as if they have been
> put onto a queue to wait to be built. Then later in the code:
>
> Class<?> theClass = theClassLoader.loadClass
> ((packageName.length() == 0 ? "" : packageName + ".") +
> jetCompiler.getSkeleton().getClassName());
>
>
> The attempt to load the classes fail, as they haven't been built yet.
> This means everything fails - then after the failure, they seem to
> suddenly build:
>
> JETEmitters\bin\org\eclipse\emf\codegen\ecore\templates\mode l\ValidatorClass_.class
>
>
> It may be worth noting that I have auto-build on, and the call to
> request the building of the EMF project using the templates is being
> made from a seperate project that has been kicked off by an auto-build
> itself.
>
> What are peoples thoughts on the fact that the class files are not
> being generated due to them being put on the back of the build queue
> which will not be processed until the "current build" operation is
> completed?
>
> Any suggestions would be great!, Thanks, Rob
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
Re: JETEmitter failing to build with Custom Templates [message #651985 is a reply to message #651969] |
Wed, 02 February 2011 10:41 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Rob,
I doubt I'd find time and no one else is likely to look into it...
Rob wrote:
> Thanks for your help Ed,
>
> I have now managed to get it working by having a new separate project
> that contains the pre-compiled templates and them reference them from
> the GenModel with "platform:/resource/..."
>
> Do you think that this concurrent build problem for templates will be
> a permanent restriction? Or is there a chance it will be resolved in a
> later release?
>
> Thanks, Rob
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04019 seconds