Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » problem running jet.transform task
problem running jet.transform task [message #516774] Thu, 25 February 2010 06:47 Go to next message
Sarvesh  is currently offline Sarvesh Friend
Messages: 10
Registered: August 2009
Junior Member
hi,

I am pretty new to running ant headlessly, I have created jet plugin project. now I want to run transformation with xml file as a input. But I am getting error "Could not find resource "TestProject/custom.xml".

I am using Eclipse3.3 (Europa), I have created build file that looks like:

<project name="test" default="test" >
<target name="test">
<jet.transform transformid="com.example.jet.demo" source="TestProject/custom.xml"/>
</target>
</project>

I have created java project named TestProject that contains model xml ("custom.xml on project's root")
I am using command:
eclipse -data D:\build\Workspace -application org.eclipse.ant.core.antRunner nosplash -buildfile D:\build\build.xml

I have placed my TestProject into D:\build\Workspace directory. here's the exception that occurs..


Caused by: D:\build\build.xml:3: Could not find resource "TestProject/custom.xml".
at org.eclipse.jet.ant.tasks.JETTransformTask.execute(JETTransf ormTask.java:81)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:623)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:495)


Any idea, what could be wrong?

Thanks in advance!
-Sarvesh

[Updated on: Thu, 25 February 2010 06:51]

Report message to a moderator

Re: problem running jet.transform task [message #516906 is a reply to message #516774] Thu, 25 February 2010 09:06 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Sarvesh:

You are running your build in the workspace D:\build\Workspace. The
error message means that the projct TestProject cannot be found in that
workspace. You can confirm this by starting Eclipse (with a UI) on that
workspace. If you don't see TestProject, you can import it into the
workspace (File > Import ... General > Existing Projects into Workspace).

My guess is that you want to create C:\build\Workspace as part of your
headless build, and then run the JET transform. For this to work, you
need to import the referenced projects into that workspace, too.
Unfortunately, I do not know of any pre-defined Ant tasks that do this.
However, it should be fairly easy to create one. The key to importing:

1) You would need to pass the tag the location of the project in the
local files system.
2) The tag would then use
ResourcesPlugin.getWorkspace().loadProjectDescription() [1]
3) To then import the project, you would create an IProject handle
using: ResourcesPlugin.getWorkspace().getRoot().getProject() [2]. You'd
pass the value returned by IProjectDescription.getName().
4) Finally, use IProject.create(IProjectDescription,IProgressMonitor)
[3] to complete the import.

If you have never created a custom Ant task for Eclipse, see:
* Contributing tasks and types [4]
* Developing Ant tasks and types within Eclipse [5]

Links:
[1] loadProjectDescription -
(http://help.eclipse.org/help33/topic/org.eclipse.platform.d oc.isv/reference/api/org/eclipse/core/resources/IWorkspace.h tml#loadProjectDescription(org.eclipse.core.runtime.IPath)
[2]
http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/resources/IWorkspaceRoo t.html#getProject(java.lang.String)

[3]
http://help.eclipse.org/help33/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/core/resources/IProject.html #create (org.eclipse.core.resources.IProjectDescription,%20org.eclip se.core.runtime.IProgressMonitor)
[4]
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/ant_contributing_task.htm
[5]
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/ant_developing.htm
Re: problem running jet.transform task [message #517072 is a reply to message #516906] Fri, 26 February 2010 04:41 Go to previous message
Sarvesh  is currently offline Sarvesh Friend
Messages: 10
Registered: August 2009
Junior Member
Thank you very much Paul!

After importing the project manually it works.
Now I will create custom ant task to import the projects into workspace.

Thanks once again!
-Sarvesh
Previous Topic:XPand workflows and documentation?
Next Topic:Failed MweReader with deployed dsl
Goto Forum:
  


Current Time: Sat Oct 12 03:25:53 GMT 2024

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

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

Back to the top