Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Patch for <jet.compile> (<jet.compile2) gives null pointer exceptions
Patch for <jet.compile> (<jet.compile2) gives null pointer exceptions [message #490422] Thu, 08 October 2009 15:39 Go to next message
No real name is currently offline No real nameFriend
Messages: 14
Registered: September 2009
Junior Member
Since jet.compile did not work for me when the project was not inside the eclipse workspace, I downloaded the patch (https://bugs.eclipse.org/bugs/show_bug.cgi?id=210447#c1), built it as a separate jar (org.eclipse.jet.examples.ant_0.9.0.jar), and copied it to the eclipse plugins directory.

I updated build.xml to call jet.compile2 and ran it using the following java command:
C:\Build\Tools\com.accenture.tools.tabbed>java -Xms128m -Xmx1024m -XX:MaxPermSize=256m -jar C:\Opt\eclipse\plugins\org.eclipse.equin
ox.launcher_1.0.200.v20090520.jar -application org.eclipse.ant.core.antRunner -data C:\Build\Tools -f C:\Build\Tools\com.accenture.t
ools.tabbed\build.xml jet2_multiple_templates.

This is how my build.xml looks like:

<target name="jet-init">
<path id="Plug-in Dependencies.libraryclasspath">
<pathelement location=" ${eclipse.plugins.dir}/org.eclipse.text_3.5.0.v20090513-2000 .jar "/>
<pathelement location=" ${eclipse.plugins.dir}/org.eclipse.jet_1.0.1.v200909041702.j ar "/>
<pathelement location=" ${eclipse.plugins.dir}/org.eclipse.jet.core_1.1.101.v2009082 01022.jar "/>
<pathelement location=" ${eclipse.plugins.dir}/org.eclipse.emf.common_2.6.0.v2009092 11047.jar "/>
<pathelement location=" ${eclipse.plugins.dir}/org.eclipse.jet.source-0.8.0-v2007053 0.jar "/>
<pathelement location=" ${eclipse.plugins.dir}/org.eclipse.jet.examples.ant_0.9.0.ja r "/>
<pathelement location="${java.class.path}"/>
</path>

<path id="project.classpath">
<pathelement location="build" />
<pathelement location="build/" />
<path refid="Plug-in Dependencies.libraryclasspath" />
<fileset dir="${eclipse.plugins.dir}" includes="**/*.*"/>
</path>
<!--
<taskdef name="jet.compile" classname="org.eclipse.jet.ant.tasks.JETCompileTask">
<classpath refid="Plug-in Dependencies.libraryclasspath" />
<classpath refid="project.classpath" />
</taskdef>
-->
<taskdef name="jet.compile2" classname="org.eclipse.jet.internal.ant.JETCompile2">
<classpath refid="Plug-in Dependencies.libraryclasspath" />
<classpath refid="project.classpath" />
</taskdef>
</target>

<target name="jetc_multiple_templates" depends="jet-init">
<echo message="${basedir}"/>
<jet.compile2 projectDir="${basedir}" destdir="src">
<src dir="." includes="/templates/*.*"/>
</jet.compile2>

</target>

The first time I ran it, it was successful. It generated the .java files from the templates. Without making any changes, I cleaned up the project and ran the java command again. It gave me null pointer exceptions.

It did not work for me after that.

Any idea why this is happening?

Is this how we are supposed to apply this patch or should we integrate it with org.eclipse.jet.source project?

Or do I have to call jet.compile2 task in customBuildCallBacks.xml?

This is how jet.compile worked for me from within the workspace. jet.compile2 does not work for me from even within the workspace.

I did get the latest jet build but that did not help either.

Any help or suggestions will be appreciated.

Thanks!
Re: Patch for <jet.compile> (<jet.compile2) gives null pointer exceptions [message #490488 is a reply to message #490422] Thu, 08 October 2009 19:47 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 14
Registered: September 2009
Junior Member
With the new jet build (from yesterday) <jet.compile> works fine from within eclipse workspace.

Is there going to be a jet build any time soon which will let us use <jet.compile> from outside of the workspace too? This would have been a life saver.

The patch for this (<jet.compile2>) is not working for me - it gives null pointer exceptions both from within the workspace and from outside of the workspace.

Thanks!
Re: Patch for <jet.compile> (<jet.compile2) gives null pointer exceptions [message #490994 is a reply to message #490488] Mon, 12 October 2009 17:26 Go to previous message
No real name is currently offline No real nameFriend
Messages: 14
Registered: September 2009
Junior Member
I found that getProject() within jetCompile2 code execute method is the cause of these null pointer exceptions. When getProject() returns a valid value, <jet.compile2> works for me. At other times, getProject returns null. This is a known issue with ant :
https://issues.apache.org/bugzilla/show_bug.cgi?id=29052

Are there any work arounds available for this?

On another machine, getProject() does not fail as often as on my regular development machine. But even there, it generates only one out of the three files. I have two templates. IJETCompiler .compile is being called for both of them but generates only one file. Is there a way to put print statements in IJETCompiler.compile code?

Any help will be higjly appreciaed.

THanks!
Previous Topic:Xpand importing ecore model
Next Topic:[JET] OCL/Profiles
Goto Forum:
  


Current Time: Thu Dec 18 14:36:09 GMT 2014

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

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