Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET] Resource-tags related exceptions when running "headless" transform
[JET] Resource-tags related exceptions when running "headless" transform [message #31226] Wed, 15 August 2007 21:53 Go to next message
Florian Georg is currently offline Florian GeorgFriend
Messages: 27
Registered: July 2009
Junior Member
I need to run a JET tarnsformation "headless", e.g. without the eclipse
UI popping up.
Therefore, I have defined a org.eclipse.core.runtime.applications
extension as a simple main entry point:
=================
public class TransformationPlatformRunnable implements IPlatformRunnable {
public Object run(Object args) throws Exception {
TransformationRunner runner = new TransformationRunner();
runner.executeTransform();

return EXIT_OK;
}
}
=================

The code is using the transformation API from the Rational Software
Architect, which internally delegates to a final JET transform.
Because of this, I'm not directly starting the JET transformation:

=================
[...]
IPath path = new Path(filePath); // some RSA transformation config file
IFile file = ResourcesPlugin.getWorkspace().getRoot()
.getFileForLocation(path);
try {
ITransformConfig config = TransformConfigUtil
.loadConfiguration(file);
// This internally delegates to the JET transform
IStatus status = controller.execute(config, null, false, true, null);
} catch (Exception e) {
System.out.println("Failed transform execution");
}
=================


The JET transformation itself goes over the intermediate model and calls
a bunch of ws:project and ws:file tags:

=================
[...]
<c:iterate select="$eJB/serviceinterface" var="serviceinterface">
<%-- actions for $serviceinterface --%>
<%-- Begin: custom actions for $serviceinterface (1) --%>
<%-- End: custom actions for $serviceinterface (1) --%>

<ws:project name="{$serviceinterface/@name}"/>
<ws:folder path="{$serviceinterface/@name}/bin"/>
<ws:folder path="{$serviceinterface/@name}/src"/>
<ws:file path="{$serviceinterface/@name}/.classpath" replace="true"
template="templates/eJB/classpath.jet"/>
<ws:file path="{$serviceinterface/@name}/.project" replace="true"
template="templates/eJB/project.jet"/>
<ws:file
path=" {$serviceinterface/@srcBasePath}/{$serviceinterface/@shortNa meItf}.java "
replace="true" template="templates/serviceInterface/ServiceItf.java.jet"/ >

[...]

=================


The transformation works fine from the runtime workbench UI, but since I
try to invoke it "headless" using the above mentioned application entry
point, there are these exceptions logged (in the .log file), and no
output files are generated:

================================
!MESSAGE org.eclipse.core.internal.resources.ResourceException: The
project description file (.project) for CIF_Detail_1_0 is missing. This
file contains important information about the project. The project will
not function properly until this file is restored.
!STACK 0
org.eclipse.jet.taglib.JET2TagException:
org.eclipse.core.internal.resources.ResourceException: The project
description file (.project) for CIF_Detail_1_0 is missing. This file
contains important information about the project. The project will not
function properly until this file is restored.
at
org.eclipse.jet.taglib.workspace.ActionsUtil.createProject(A ctionsUtil.java:519)
at
org.eclipse.jet.internal.taglib.workspace.WsProjectAction.pe rformAction(WsProjectAction.java:91)
at
org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$3. run(WorkspaceContextExtender.java:238)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
[...]
Caused by: org.eclipse.core.internal.resources.ResourceException: The
project description file (.project) for CIF_Detail_1_0 is missing. This
file contains important information about the project. The project will
not function properly until this file is restored.
at
org.eclipse.core.internal.localstore.FileSystemResourceManag er.read(FileSystemResourceManager.java:656)
at
org.eclipse.core.internal.resources.SaveManager.restoreMetaI nfo(SaveManager.java:765)
at
org.eclipse.core.internal.resources.SaveManager.restore(Save Manager.java:672)
at org.eclipse.core.internal.resources.Project.open(Project.jav a:845)
at org.eclipse.core.internal.resources.Project.open(Project.jav a:883)
at
org.eclipse.jet.taglib.workspace.ActionsUtil.createProject(A ctionsUtil.java:505)
[...]
!SUBENTRY 1 com.csg.prototype.rsa.m2m.jet 4 1 2007-08-15 23:34:32.093
!MESSAGE Resource /CIF_Detail_1_0 is not open.
!STACK 0
org.eclipse.jet.taglib.JET2TagException: Resource /CIF_Detail_1_0 is not
open.
at
org.eclipse.jet.taglib.workspace.ActionsUtil.ensureFolderExi sts(ActionsUtil.java:244)
at
org.eclipse.jet.internal.taglib.workspace.WsFolderAction.per formAction(WsFolderAction.java:76)
at
org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$3. run(WorkspaceContextExtender.java:238)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at
org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$2. run(WorkspaceContextExtender.java:227)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1737)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1719)
at
org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$Co ntextData.commit(WorkspaceContextExtender.java:215)
at
org.eclipse.jet.transform.TransformContextExtender.commit(Tr ansformContextExtender.java:215)
at org.eclipse.jet.JET2Platform$4.run(JET2Platform.java:437)
at
org.eclipse.jet.internal.runtime.JETBundleManager.run(JETBun dleManager.java:336)
at org.eclipse.jet.JET2Platform.runTransform(JET2Platform.java: 398)
at org.eclipse.jet.JET2Platform.runTransformOnObject(JET2Platfo rm.java:501)
at com.ibm.xtools.transform.authoring.JETRule.createTarget(JETR ule.java:53)
[...]
Caused by: org.eclipse.core.internal.resources.ResourceException:
Resource /CIF_Detail_1_0 is not open.
at
org.eclipse.core.internal.resources.Project.checkAccessible( Project.java:145)
at
org.eclipse.core.internal.resources.Folder.assertCreateRequi rements(Folder.java:32)
at org.eclipse.core.internal.resources.Folder.create(Folder.jav a:88)
at org.eclipse.core.internal.resources.Folder.create(Folder.jav a:118)
at
org.eclipse.jet.taglib.workspace.ActionsUtil.ensureFolderExi sts(ActionsUtil.java:240)
... 50 more
[...]
================================




Any ideas what is going wrong with the resources in that case?

Any help would be appreciated.... thanks in advance.

regards,
Florian
Re: [JET] Resource-tags related exceptions when running "headless" transform [message #31540 is a reply to message #31226] Mon, 27 August 2007 13:56 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Florian:

The problem seems to come down to the project CIF_Detail_1_0 not being open.
Is this project created by the JET transform? Or did it exist before? The
JET ws:project tag does not attempt to open an existing project (perhaps it
should).

Paul

"Florian Georg" <florian.georg@ch.ibm.com> wrote in message
news:f9vshg$tc9$1@build.eclipse.org...
>I need to run a JET tarnsformation "headless", e.g. without the eclipse UI
>popping up.
> Therefore, I have defined a org.eclipse.core.runtime.applications
> extension as a simple main entry point:
> =================
> public class TransformationPlatformRunnable implements IPlatformRunnable {
> public Object run(Object args) throws Exception {
> TransformationRunner runner = new TransformationRunner();
> runner.executeTransform();
>
> return EXIT_OK;
> }
> }
> =================
>
> The code is using the transformation API from the Rational Software
> Architect, which internally delegates to a final JET transform.
> Because of this, I'm not directly starting the JET transformation:
>
> =================
> [...] IPath path = new Path(filePath); // some RSA transformation config
> file
> IFile file = ResourcesPlugin.getWorkspace().getRoot()
> .getFileForLocation(path);
> try {
> ITransformConfig config = TransformConfigUtil
> .loadConfiguration(file);
> // This internally delegates to the JET transform
> IStatus status = controller.execute(config, null, false, true, null);
> } catch (Exception e) {
> System.out.println("Failed transform execution");
> }
> =================
>
>
> The JET transformation itself goes over the intermediate model and calls
> a bunch of ws:project and ws:file tags:
>
> =================
> [...]
> <c:iterate select="$eJB/serviceinterface" var="serviceinterface">
> <%-- actions for $serviceinterface --%>
> <%-- Begin: custom actions for $serviceinterface (1) --%>
> <%-- End: custom actions for $serviceinterface (1) --%>
>
> <ws:project name="{$serviceinterface/@name}"/>
> <ws:folder path="{$serviceinterface/@name}/bin"/>
> <ws:folder path="{$serviceinterface/@name}/src"/>
> <ws:file path="{$serviceinterface/@name}/.classpath" replace="true"
> template="templates/eJB/classpath.jet"/>
> <ws:file path="{$serviceinterface/@name}/.project" replace="true"
> template="templates/eJB/project.jet"/>
> <ws:file
> path=" {$serviceinterface/@srcBasePath}/{$serviceinterface/@shortNa meItf}.java "
> replace="true" template="templates/serviceInterface/ServiceItf.java.jet"/ >
>
> [...]
>
> =================
>
>
> The transformation works fine from the runtime workbench UI, but since I
> try to invoke it "headless" using the above mentioned application entry
> point, there are these exceptions logged (in the .log file), and no output
> files are generated:
>
> ================================
> !MESSAGE org.eclipse.core.internal.resources.ResourceException: The
> project description file (.project) for CIF_Detail_1_0 is missing. This
> file contains important information about the project. The project will
> not function properly until this file is restored.
> !STACK 0
> org.eclipse.jet.taglib.JET2TagException:
> org.eclipse.core.internal.resources.ResourceException: The project
> description file (.project) for CIF_Detail_1_0 is missing. This file
> contains important information about the project. The project will not
> function properly until this file is restored.
> at
> org.eclipse.jet.taglib.workspace.ActionsUtil.createProject(A ctionsUtil.java:519)
> at
> org.eclipse.jet.internal.taglib.workspace.WsProjectAction.pe rformAction(WsProjectAction.java:91)
> at
> org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$3. run(WorkspaceContextExtender.java:238)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:843)
> [...]
> Caused by: org.eclipse.core.internal.resources.ResourceException: The
> project description file (.project) for CIF_Detail_1_0 is missing. This
> file contains important information about the project. The project will
> not function properly until this file is restored.
> at
> org.eclipse.core.internal.localstore.FileSystemResourceManag er.read(FileSystemResourceManager.java:656)
> at
> org.eclipse.core.internal.resources.SaveManager.restoreMetaI nfo(SaveManager.java:765)
> at
> org.eclipse.core.internal.resources.SaveManager.restore(Save Manager.java:672)
> at org.eclipse.core.internal.resources.Project.open(Project.jav a:845)
> at org.eclipse.core.internal.resources.Project.open(Project.jav a:883)
> at
> org.eclipse.jet.taglib.workspace.ActionsUtil.createProject(A ctionsUtil.java:505)
> [...]
> !SUBENTRY 1 com.csg.prototype.rsa.m2m.jet 4 1 2007-08-15 23:34:32.093
> !MESSAGE Resource /CIF_Detail_1_0 is not open.
> !STACK 0
> org.eclipse.jet.taglib.JET2TagException: Resource /CIF_Detail_1_0 is not
> open.
> at
> org.eclipse.jet.taglib.workspace.ActionsUtil.ensureFolderExi sts(ActionsUtil.java:244)
> at
> org.eclipse.jet.internal.taglib.workspace.WsFolderAction.per formAction(WsFolderAction.java:76)
> at
> org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$3. run(WorkspaceContextExtender.java:238)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:843)
> at
> org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$2. run(WorkspaceContextExtender.java:227)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1737)
> at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1719)
> at
> org.eclipse.jet.taglib.workspace.WorkspaceContextExtender$Co ntextData.commit(WorkspaceContextExtender.java:215)
> at
> org.eclipse.jet.transform.TransformContextExtender.commit(Tr ansformContextExtender.java:215)
> at org.eclipse.jet.JET2Platform$4.run(JET2Platform.java:437)
> at
> org.eclipse.jet.internal.runtime.JETBundleManager.run(JETBun dleManager.java:336)
> at org.eclipse.jet.JET2Platform.runTransform(JET2Platform.java: 398)
> at
> org.eclipse.jet.JET2Platform.runTransformOnObject(JET2Platfo rm.java:501)
> at
> com.ibm.xtools.transform.authoring.JETRule.createTarget(JETR ule.java:53)
> [...]
> Caused by: org.eclipse.core.internal.resources.ResourceException: Resource
> /CIF_Detail_1_0 is not open.
> at
> org.eclipse.core.internal.resources.Project.checkAccessible( Project.java:145)
> at
> org.eclipse.core.internal.resources.Folder.assertCreateRequi rements(Folder.java:32)
> at org.eclipse.core.internal.resources.Folder.create(Folder.jav a:88)
> at org.eclipse.core.internal.resources.Folder.create(Folder.jav a:118)
> at
> org.eclipse.jet.taglib.workspace.ActionsUtil.ensureFolderExi sts(ActionsUtil.java:240)
> ... 50 more
> [...]
> ================================
>
>
>
>
> Any ideas what is going wrong with the resources in that case?
>
> Any help would be appreciated.... thanks in advance.
>
> regards,
> Florian
Previous Topic:data to text
Next Topic:name of the file input model
Goto Forum:
  


Current Time: Thu Apr 18 07:16:29 GMT 2024

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

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

Back to the top