Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Could not load JET template loader: EMF+JET
Could not load JET template loader: EMF+JET [message #49585] Tue, 16 September 2008 04:28 Go to next message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
Hello,

I am developing an EMF/GMF-based model and wanted to use JET in order to
generate code from instances of the EMF model. Things are mostly working
but there is one problem I am having trouble with.

Right now I have implemented a EMFT plugin (following the IBM tutorial)
which can be called from other plugins in a runtime Eclipse environment
to transform a model file into generated output. But I cannot, in the
original development environment, use a right click > use as JET input.

After quite a few hours of debugging and investigating, I have
discovered the problem is that the plugin adds my generated model
package "org.openiaml.test.uml3" to "required plug-ins" in plugin.xml,
but when use as JET input is run, I get this entirely unhelpful error:

"Could not load JET template loader"

Which through debugging can be traced back to:

"Cannot load "org.eclipse.jet.compiled._jet_transformation" because
the bundle file:C:/foo/bar cannot be resolved."

Without adding the generated EMF package to the required plugins, the
generated code cannot find the import and does not run:

<%@jet imports="org.eclipse.jet.xpath.NodeSet
org.openiaml.test.uml3.model.*" %>
...
<%
Event event = (Event) ((NodeSet)
context.getVariable("event")).toArray()[0];
context.setVariable("to", ((Connection)
event.getConnection().get(0)).getTo());
%>
...

I have tried adding it to project references, imported packages and
build path with no success.

Can anybody provide some suggestions on what I can do to solve this
problem? It still runs fine in a runtime Eclipse environment but I would
like to run it also as an input to JET in my development environment.

I am using Eclipse 3.3/GMF 2.0.1/JET 0.8.2 because Eclipse 3.4/GMF 2.1
is not stable enough yet for me.

Cheers :)
Jevon
Re: Could not load JET template loader: EMF+JET [message #49794 is a reply to message #49585] Tue, 16 September 2008 18:28 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Jevon:

This is an intentional limitation of the JET launcher.

When you run a JET transformation that is in your workspace, JET does some
deep majic to dynamically (and temporarily) install the JET project as a
plug-in in your development environment. This is accomplished via the OSGi
framework.) Once the transformation finishes execution, the plug-in is
uninstalled again.

But, JET refuses to look for and install referenced plugins. This was out of
concern for platform stability, but also because of some technical
limitations of dynamic loading a plug-in as a directory rather than a JAR.
Anyhow, I'm not tempted, at this point, to revisit it.

So, that leaves you with two possibilities:

1) continue to test and run your JET transformation/templates in a runtime
workbench
2) install the plug-ins upon which JET depends into your development
environment.

Finally, while I can't comment on Eclipse 3.4/GMF 2.1 stability, I will
point out that JET 0.9.0 has been tested with Eclipse 3.3 - you should be
able to use it in your environment.

Paul


"Jevon Wright" <jevon@jevon.org> wrote in message
news:gancle$5pc$1@build.eclipse.org...
> Hello,
>
> I am developing an EMF/GMF-based model and wanted to use JET in order to
> generate code from instances of the EMF model. Things are mostly working
> but there is one problem I am having trouble with.
>
> Right now I have implemented a EMFT plugin (following the IBM tutorial)
> which can be called from other plugins in a runtime Eclipse environment to
> transform a model file into generated output. But I cannot, in the
> original development environment, use a right click > use as JET input.
>
> After quite a few hours of debugging and investigating, I have discovered
> the problem is that the plugin adds my generated model package
> "org.openiaml.test.uml3" to "required plug-ins" in plugin.xml, but when
> use as JET input is run, I get this entirely unhelpful error:
>
> "Could not load JET template loader"
>
> Which through debugging can be traced back to:
>
> "Cannot load "org.eclipse.jet.compiled._jet_transformation" because the
> bundle file:C:/foo/bar cannot be resolved."
>
> Without adding the generated EMF package to the required plugins, the
> generated code cannot find the import and does not run:
>
> <%@jet imports="org.eclipse.jet.xpath.NodeSet
> org.openiaml.test.uml3.model.*" %>
> ...
> <%
> Event event = (Event) ((NodeSet)
> context.getVariable("event")).toArray()[0];
> context.setVariable("to", ((Connection)
> event.getConnection().get(0)).getTo());
> %>
> ...
>
> I have tried adding it to project references, imported packages and build
> path with no success.
>
> Can anybody provide some suggestions on what I can do to solve this
> problem? It still runs fine in a runtime Eclipse environment but I would
> like to run it also as an input to JET in my development environment.
>
> I am using Eclipse 3.3/GMF 2.0.1/JET 0.8.2 because Eclipse 3.4/GMF 2.1 is
> not stable enough yet for me.
>
> Cheers :)
> Jevon
Previous Topic:Problem with JET editor
Next Topic:JET comments (redux)
Goto Forum:
  


Current Time: Wed Nov 26 11:48:56 GMT 2014

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

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