Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Problem loading model after updating to latest version of JET
Problem loading model after updating to latest version of JET [message #54387] Tue, 16 December 2008 14:52 Go to next message
Mark Wood is currently offline Mark Wood
Messages: 8
Registered: July 2009
Junior Member
Hello,

Earlier today I was playing with custom JET functions and had to update to
the latest version JET in order to get something to work. I'm currently
using version 0.9.1. Anyway, I now have the problem that my JET project
has stopped working.

Basically JET doesn't seem to be able to load the model I am telling it
to. My main.jet file allows the generation of files that use templates
that don't require any interaction with my model. However, those that do
require the model are not generated e.g.

<java:package name="webgen.dao.hibernate.persistentbeans">
<c:iterate select="//namedElements[self::Entity]" var="entityCursor">
<c:setVariable var="entityName" select="$entityCursor/@name" />
<c:log>Entity Name:- <c:get select="$entityName" /></c:log>
<java:class name="{$entityName}"
template="/jetwebsitegenerator/templates/java/persistentbean.java.jet " />
</c:iterate>
</java:package>

The c:log statement in the c:iterate statement is never executed (despite
there being Entities in the model to process. The trace says:

templates/main.jet(29,4): <c:iterate
select="//namedElements[self::Entity]" var="entityCursor">
Trace: loop initialized
templates/main.jet(29,4): <c:iterate
select="//namedElements[self::Entity]" var="entityCursor">
Trace: finished loop

Clearly it reads the statement but just isn't iterating over the model
elements as it should.

I have spent around 4 hours now looking at this problem and trying to fix
it. I have checked and double checked my plugin.xml which contains the
following code:

...
<extension
id=""
name=""
point="org.eclipse.jet.transform">
<transform
modelExtension="webgen"
modelLoader="org.eclipse.jet.emf"
startTemplate="templates/main.jet"

templateLoaderClass="jettestproject.compiled._jet_transformation ">
<description></description>
...

The only warning I have about plugin.xml is:
"Referenced class 'jettestproject.compiled._jet_transformation' in
attribute 'templateLoaderClass' is not on the plug-in classpath".

However, the templates are not the problem, it seems to be the actual
model itself that just isn't being loaded. N.B. The _jet_transformation
class definitely does exist in the jet2java folder.

I've tried cleaning and re-building the project many times. I just can't
see what the problem could be.

Does anyone have any idea what I might be able to try?

Thanks,

Mark
Re: Problem loading model after updating to latest version of JET [message #54416 is a reply to message #54387] Wed, 17 December 2008 04:24 Go to previous message
Mark Wood is currently offline Mark Wood
Messages: 8
Registered: July 2009
Junior Member
Actually, nevermind. I managed to solve the problem.

After posting the message I noticed the Announce on the newsgroup for the
very latest version of JET. This morning I updated to that version and
wrote exactly the same code I wrote yesterday but this time it works.
Mysterious...

Thanks,

Mark
Previous Topic:Use of JET setVariable to store commonly used XPath expressions
Next Topic:Comprehensive list of rules for JET classpath
Goto Forum:
  


Current Time: Tue Jul 29 00:39:21 EDT 2014

Powered by FUDForum. Page generated in 0.07930 seconds