Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET2] Struggling with finding my files during runtime
[JET2] Struggling with finding my files during runtime [message #18112] Sun, 27 May 2007 16:08 Go to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Hi,
I have JET2 templates that work perfectly when I use the Run JET options
within Eclipse.
When I link it in to my GMF diagram and lauch the runtime Eclipse
environment it doesn't find the files that it tried to load.
I feel the problem might be around the setting of the
("org.eclipse.jet.resource.project.name").
During runtime I have set this to :-
1) the Eclipse Project Name only
2) platform:/<ProejctName>
3) ./

But each time I used the c:load it still doesn't find the files that I feel
it should.

Any clues ?
Below is the code I use to call the JERTransform from within my GMF diagram.
Below that is the Jet load command I'm using
Map<String, String> variables = new HashMap<String, String>();

variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);

IStatus status =
GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
aProgressMonitor);



<c:load url="{$compoundResourceName}.xml" var="{$compoundResourceName}Var"
type="xml"/>
Re: [JET2] Struggling with finding my files during runtime [message #18121 is a reply to message #18112] Mon, 28 May 2007 01:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

To add a bit more I logged the variable when running local and within plugin
eclipse launch with my GMF diagram and in both instances the
attribute {org.eclipse.jet.resource.project.name} returns just the Project
name.

Is there something special about c:load at runtime ? or is it something
special about the way eclipse launches its GMF plugin developement run test
?

Stu

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f3caem$u7i$1@build.eclipse.org...
> Hi,
> I have JET2 templates that work perfectly when I use the Run JET options
> within Eclipse.
> When I link it in to my GMF diagram and lauch the runtime Eclipse
> environment it doesn't find the files that it tried to load.
> I feel the problem might be around the setting of the
> ("org.eclipse.jet.resource.project.name").
> During runtime I have set this to :-
> 1) the Eclipse Project Name only
> 2) platform:/<ProejctName>
> 3) ./
>
> But each time I used the c:load it still doesn't find the files that I
> feel it should.
>
> Any clues ?
> Below is the code I use to call the JERTransform from within my GMF
> diagram.
> Below that is the Jet load command I'm using
> Map<String, String> variables = new HashMap<String, String>();
>
> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>
> IStatus status =
> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
> aProgressMonitor);
>
>
>
> <c:load url="{$compoundResourceName}.xml" var="{$compoundResourceName}Var"
> type="xml"/>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #18154 is a reply to message #18112] Mon, 28 May 2007 13:01 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

Looking at your code, I don't think it has anything to do with
'org.eclipse.jet.resource.project.name'.

You mention:

> <c:load url="{$compoundResourceName}.xml" var="{$compoundResourceName}Var"
> type="xml"/>

What is your calculation for $compoundResourceName ?

If it includes an URL schema (e.g. http:, file:), then it will be resolved
directly. However, it there is no such schema (I'm guessing this is the
case), then c:load will resolve the URL relative to a base URL. By default,
this is an URL for the root directory of the transformation project.

I am guessing that you are wanting to load from the workspace, and that your
calculation for compoundResourceName results in a value such as:
.../project-name/...

Fortunately, c:load has an optional attribute which uses the the workspace
root as the baseURL:

<c:load url="..." urlContext="workspace" .../>

You can then set compoundResourceName to start with the project name:
my-project/....

Paul
Re: [JET2] Struggling with finding my files during runtime [message #18216 is a reply to message #18154] Mon, 28 May 2007 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

$compoundResourceName in my test case becomes Test1 then Test2

Test1.xml exists in the root of the eclipse project (in the GMF launched
test project as well.

It works ok when I run using the Jet transformation.

But doesn't find it when I run it within a GMF diagram plugin.

From your note below I did the following:-
<c:load
url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
var="{$compoundResourceName}" urlContext="workspace" />

which one the first pass equates to:
<c:load url="TestPlugins/Test2.xml" var="Test2" urlContext="workspace" />

And I get the following Error BUT only when I run it from within a GMF
plugin.

Unable to load: TestPlugins/Test2.xml





"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f3ejrj$d74$1@build.eclipse.org...
> Stu:
>
> Looking at your code, I don't think it has anything to do with
> 'org.eclipse.jet.resource.project.name'.
>
> You mention:
>
>> <c:load url="{$compoundResourceName}.xml"
>> var="{$compoundResourceName}Var" type="xml"/>
>
> What is your calculation for $compoundResourceName ?
>
> If it includes an URL schema (e.g. http:, file:), then it will be resolved
> directly. However, it there is no such schema (I'm guessing this is the
> case), then c:load will resolve the URL relative to a base URL. By
> default, this is an URL for the root directory of the transformation
> project.
>
> I am guessing that you are wanting to load from the workspace, and that
> your calculation for compoundResourceName results in a value such as:
> ../project-name/...
>
> Fortunately, c:load has an optional attribute which uses the the workspace
> root as the baseURL:
>
> <c:load url="..." urlContext="workspace" .../>
>
> You can then set compoundResourceName to start with the project name:
> my-project/....
>
> Paul
>
>
Re: [JET2] Struggling with finding my files during runtime [message #18302 is a reply to message #18216] Thu, 31 May 2007 14:47 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

I'm having trouble reproducing this. Can you launch this from a debugger
with a break point in LoadTag.doAction:

try
{
Object modelRoot = TransformContextExtender.loadModel(modelURL, loaderId,
type);
context.setVariable(var, modelRoot);
}
catch (IOException e)
{
>> final String msg = JET2Messages.LoadTag_CouldNotLoad; << Break here
throw new JET2TagException(MessageFormat.format(msg, new Object []{
url }), e);
}

And tell me what the exception is? If you can print a stack trace, even
better.

BTW, in investigating this, I discovered that the IStatus returned by
JET2Platform.runTransformOnXXX() was always returning a severity of OK. I've
submitted bug 190222 to track this.

Paul
Re: [JET2] Struggling with finding my files during runtime [message #18319 is a reply to message #18302] Fri, 01 June 2007 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Yeah I found theok iStatus as I was trying to use the error dialog :-) Glad
you got it.

Ok information below:-

Seems to be saying feature 'version' is missing.

e Resource$IOWrappedException (id=8067)
cause FeatureNotFoundException (id=8071)
cause FeatureNotFoundException (id=8071)
column 294
detailMessage "Feature \'version\' not found."
featureName "version"
line 2
location "platform:/resource/TestPlugins/Test2.xml"
object RuleConductorImpl (id=8092)
stackTrace null
detailMessage "Feature \'version\' not found.
(platform:/resource/TestPlugins/Test2.xml, 2, 294)"
stackTrace null


Stack dump:
Thread [main] (Suspended)
LoadTag.doAction(TagInfo, JET2Context, JET2Writer) line: 87
SafeEmptyRuntimeTag$1.doRun() line: 49
SafeEmptyRuntimeTag$1(SafeCustomRuntimeTag$TagSafeRunnable). run() line: 72
SafeRunner.run(ISafeRunnable) line: 37
Platform.run(ISafeRunnable) line: 850
SafeEmptyRuntimeTag.doStart(JET2Context, JET2Writer) line: 43
_jet_commonloadCompound.generate(JET2Context, JET2Writer) line: 140
TransformContextExtender.execute(String, boolean, JET2Writer) line: 146
IncludeTag.doAction(TagInfo, JET2Context, JET2Writer) line: 79
SafeEmptyRuntimeTag$1.doRun() line: 49
SafeEmptyRuntimeTag$1(SafeCustomRuntimeTag$TagSafeRunnable). run() line: 72
SafeRunner.run(ISafeRunnable) line: 37
Platform.run(ISafeRunnable) line: 850
SafeEmptyRuntimeTag.doStart(JET2Context, JET2Writer) line: 43
_jet_1createDataDictionaryCSV.generate(JET2Context, JET2Writer) line: 142
TransformContextExtender.execute(String, boolean, JET2Writer) line: 146
TransformContextExtender.execute(String, JET2Writer) line: 119
FileTag.doAction(TagInfo, JET2Context, JET2Writer) line: 101
SafeEmptyRuntimeTag$1.doRun() line: 49
SafeEmptyRuntimeTag$1(SafeCustomRuntimeTag$TagSafeRunnable). run() line: 72
SafeRunner.run(ISafeRunnable) line: 37
Platform.run(ISafeRunnable) line: 850
SafeEmptyRuntimeTag.doStart(JET2Context, JET2Writer) line: 43
_jet_main.generate(JET2Context, JET2Writer) line: 47
TransformContextExtender.execute(String, boolean, JET2Writer) line: 146
TransformContextExtender.execute(String, JET2Writer) line: 119
JET2Platform$4.run(IJETBundleDescriptor, JET2TemplateLoader,
IProgressMonitor) line: 448
JETBundleManager.run(String, IJETRunnable, IProgressMonitor) line: 330
JET2Platform.runTransform(String, JET2Context, IProgressMonitor) line: 416
JET2Platform.runTransformOnObject(String, Object, Map, IProgressMonitor)
line: 520
GenerateVisualRatingDataDictionaryAction.runTransformVisualD iagram(XMIResourceImpl,Map <String,String>, NullProgressMonitor) line: 16 RuleConductorCreateDataDictionaryAction.run(IAction) line: 63 EditorPluginAction(PluginAction).runWithEvent(Event) line: 253 PluginActionContributionItem(ActionContributionItem).handleW idgetSelection(Event, boolean) line: 545 ActionContributionItem.access$2(ActionContributionItem, Event, boolean)line: 490 ActionContributionItem$6.handleEvent(Event) line: 443 EventTable.sendEvent(Event) line: 66 ToolItem(Widget).sendEvent(Event) line: 938 Display.runDeferredEvents() line: 3673 Display.readAndDispatch() line: 3284 Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2337 Workbench.runUI() line: 2301 Workbench.access$4(Workbench) line: 2176 Workbench$4.run() line: 463 Realm.runWithDefault(Realm, Runnable) line: 289 Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 458 PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149 IDEApplication.start(IApplicationContext) line: 101 EclipseAppHandle.run(Object) line: 146 EclipseAppLauncher.runApplication(Object) line: 106 EclipseAppLauncher.start(Object) line: 76 EclipseStarter.run(Object) line: 356 EclipseStarter.run(String[], Runnable) line: 171 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: notavailable [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available Method.invoke(Object, Object...) line: not available Main.invokeFramework(String[], URL[]) line: 476 Main.basicRun(String[]) line: 416 Main.run(String[]) line: 1141 Main.main(String[]) line: 1116"Paul Elder" <pelder@ca.ibm.com> wrote in messagenews:f3mn73$i6$1@build.eclipse.org...> Stu:>> I'm having trouble reproducing this. Can you launch this from a debuggerwith a break point in LoadTag.doAction:>> try> {> Object modelRoot = TransformContextExtender.loadModel(modelURL, loaderId,type);> context.setVariable(var, modelRoot);> }> catch (IOException e)> {>>> final String msg = JET2Messages.LoadTag_CouldNotLoad; << Break here> throw new JET2TagException(MessageFormat.format(msg, new Object []{url }), e);> }>> And tell me what the exception is? If you can print a stack trace, evenbetter.>> BTW, in investigating this, I discovered that the IStatus returned byJET2Platform.runTransformOnXXX() was always returning a severity of OK. I'vesubmitted bug 190222 to track this.>> Paul>
Re: [JET2] Struggling with finding my files during runtime [message #18371 is a reply to message #18319] Fri, 01 June 2007 17:47 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

Can you tell me a bit more about Test2.xml?

From you have provided, it appears to be a document created from an EMF
model.

JET uses EMF to load XML documents, and when EMF finds a schema reference
for which it has a know Ecore model for, it loads the document using it.
Since everything works fine in your one environment, and not in the other, I
think one of the following may be occuring.

1) The Ecore model is not registered in one of those environments, but is in
the other
2) The ecore model's in the two environments are different.

Paul
Re: [JET2] Struggling with finding my files during runtime [message #18403 is a reply to message #18371] Sat, 02 June 2007 04:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Ok I have narrowed it down to:-

1) The error ONLY happens when JET2 is called from a plugin (when using
the launch in the dev environment it works ok).
2) If the format is:-
<root next="sample2.xml">

</root>

then it works

BUT

if I use

<com.ibridge.diagrammodel:RuleConductor next="test2.xml">

</com.ibridge.diagrammodel:RuleConductor>

Then it doesn't.

So it seem likesomething at runtime creates an exception when reading the
com.ibridge.diagrammodel:RuleConductor

I have attached the very simple striped down version of how I narrow this
down.

test1.xml has a next which is used to load test2.xml.

main.jet and dumpTest.jet << loads test1.xml then test2.xml

The PerformJetTest.java is my code called by the extenion point.

Below is the code I call the above java class with from the GMF diagram:-

Map<String, String> variables = new HashMap<String, String>();

variables.put("org.eclipse.jet.resource.project.name","TestProjectJET ");

variables.put("loadVar","sample1.xml");

System.out.println("About to call common generate emthod in JET project");

IStatus status =
PerformJetTest.runTransformVisualDiagram(resource,variables,
aProgressMonitor);

System.out.println("Jet Outcome>>"+status.toString());






"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f3pm53$tmc$1@build.eclipse.org...
> Stu:
>
> Can you tell me a bit more about Test2.xml?
>
> From you have provided, it appears to be a document created from an EMF
> model.
>
> JET uses EMF to load XML documents, and when EMF finds a schema reference
> for which it has a know Ecore model for, it loads the document using it.
> Since everything works fine in your one environment, and not in the other,
> I
> think one of the following may be occuring.
>
> 1) The Ecore model is not registered in one of those environments, but is
> in
> the other
> 2) The ecore model's in the two environments are different.
>
> Paul
>
>






  • Attachment: test2.xml
    (Size: 0.11KB, Downloaded 183 times)
  • Attachment: test1.xml
    (Size: 0.11KB, Downloaded 212 times)
  • Attachment: main.jet
    (Size: 0.85KB, Downloaded 211 times)
  • Attachment: dumpTest.jet
    (Size: 0.50KB, Downloaded 281 times)
  • Attachment: PerformJetTest.java
    (Size: 0.63KB, Downloaded 251 times)
Re: [JET2] Struggling with finding my files during runtime [message #19731 is a reply to message #18403] Mon, 04 June 2007 14:23 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

I'm going to try and do some experiments and see if I can get you through
this. I'll post again later.

Paul
Re: [JET2] Struggling with finding my files during runtime [message #19841 is a reply to message #19731] Tue, 05 June 2007 00:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Thank mate,
Did you manage to replicate the issue ?
At the moment I'm demo'ing the facility via the dev.environment which works
well.
Cheers for the support,
Stu

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f417ae$cc1$1@build.eclipse.org...
> Stu:
>
> I'm going to try and do some experiments and see if I can get you through
> this. I'll post again later.
>
> Paul
>
Re: [JET2] Struggling with finding my files during runtime [message #20643 is a reply to message #19841] Tue, 05 June 2007 13:07 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

No luck yet, but I'm going through shut-down of both the Europa release and
some internal development, so I haven't tried too hard.

I'll keep you posted.

Paul

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f42arr$vc9$1@build.eclipse.org...
> Thank mate,
> Did you manage to replicate the issue ?
> At the moment I'm demo'ing the facility via the dev.environment which
> works well.
> Cheers for the support,
> Stu
>
> "Paul Elder" <pelder@ca.ibm.com> wrote in message
> news:f417ae$cc1$1@build.eclipse.org...
>> Stu:
>>
>> I'm going to try and do some experiments and see if I can get you through
>> this. I'll post again later.
>>
>> Paul
>>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #22494 is a reply to message #20643] Mon, 18 June 2007 17:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Paul,
The issue for this seems to be around the ':'
If I use:-
<root:root next="sample2.xml">

</root:root>

I get the error but if I use:-
<rootroot next="sample2.xml">

</rootroot>

Its all fine.

Anywhere I can put a debug and step through it to help with this one ?

Stu



"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f43n8b$s94$1@build.eclipse.org...
> Stu:
>
> No luck yet, but I'm going through shut-down of both the Europa release
> and some internal development, so I haven't tried too hard.
>
> I'll keep you posted.
>
> Paul
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f42arr$vc9$1@build.eclipse.org...
>> Thank mate,
>> Did you manage to replicate the issue ?
>> At the moment I'm demo'ing the facility via the dev.environment which
>> works well.
>> Cheers for the support,
>> Stu
>>
>> "Paul Elder" <pelder@ca.ibm.com> wrote in message
>> news:f417ae$cc1$1@build.eclipse.org...
>>> Stu:
>>>
>>> I'm going to try and do some experiments and see if I can get you
>>> through this. I'll post again later.
>>>
>>> Paul
>>>
>>
>>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #28067 is a reply to message #18112] Tue, 24 July 2007 01:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Paul any answer on this one ?
Getting close to my go live cut off?
If you can think of another soltuion that would be good. I just feel a bit
stuck.

Thanks,

Stu

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f3caem$u7i$1@build.eclipse.org...
> Hi,
> I have JET2 templates that work perfectly when I use the Run JET options
> within Eclipse.
> When I link it in to my GMF diagram and lauch the runtime Eclipse
> environment it doesn't find the files that it tried to load.
> I feel the problem might be around the setting of the
> ("org.eclipse.jet.resource.project.name").
> During runtime I have set this to :-
> 1) the Eclipse Project Name only
> 2) platform:/<ProejctName>
> 3) ./
>
> But each time I used the c:load it still doesn't find the files that I
> feel it should.
>
> Any clues ?
> Below is the code I use to call the JERTransform from within my GMF
> diagram.
> Below that is the Jet load command I'm using
> Map<String, String> variables = new HashMap<String, String>();
>
> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>
> IStatus status =
> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
> aProgressMonitor);
>
>
>
> <c:load url="{$compoundResourceName}.xml" var="{$compoundResourceName}Var"
> type="xml"/>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #28410 is a reply to message #28067] Wed, 25 July 2007 14:28 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

I'm looking into this today. I'll update you with my progress (or lack
thereof) when I leave for the day.

Paul

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f83l54$3fr$1@build.eclipse.org...
> Paul any answer on this one ?
> Getting close to my go live cut off?
> If you can think of another soltuion that would be good. I just feel a
> bit stuck.
>
> Thanks,
>
> Stu
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f3caem$u7i$1@build.eclipse.org...
>> Hi,
>> I have JET2 templates that work perfectly when I use the Run JET options
>> within Eclipse.
>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>> environment it doesn't find the files that it tried to load.
>> I feel the problem might be around the setting of the
>> ("org.eclipse.jet.resource.project.name").
>> During runtime I have set this to :-
>> 1) the Eclipse Project Name only
>> 2) platform:/<ProejctName>
>> 3) ./
>>
>> But each time I used the c:load it still doesn't find the files that I
>> feel it should.
>>
>> Any clues ?
>> Below is the code I use to call the JERTransform from within my GMF
>> diagram.
>> Below that is the Jet load command I'm using
>> Map<String, String> variables = new HashMap<String, String>();
>>
>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>
>> IStatus status =
>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>> aProgressMonitor);
>>
>>
>>
>> <c:load url="{$compoundResourceName}.xml"
>> var="{$compoundResourceName}Var" type="xml"/>
>>
>>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #28925 is a reply to message #28067] Wed, 25 July 2007 17:57 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

I've still don't have a definitive solution, but here are some thoughts:

In a previous post you mention the following stack trace after c:load's
failure:

Seems to be saying feature 'version' is missing.

e Resource$IOWrappedException (id=8067)
cause FeatureNotFoundException (id=8071)
cause FeatureNotFoundException (id=8071)
column 294
detailMessage "Feature \'version\' not found."
featureName "version"
line 2
location "platform:/resource/TestPlugins/Test2.xml"
object RuleConductorImpl (id=8092)
stackTrace null
detailMessage "Feature \'version\' not found.
(platform:/resource/TestPlugins/Test2.xml, 2, 294)"
stackTrace null

This is a common failure when JET's XML loader (which is acutally using an
EMF facility) tries to load an XMI-encoded document and JET has not supplied
EMF with the right file extension to select the correct EMF deserializer.
The generic XML deserializer that JET falls back to cannot load XMI encoded
documents.

Here are the first two lines of an XMI encoded document.

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xmachine"
nsURI="..." nsPrefix="...">

The message "Feature 'version' not found" is refereing to the attribute
xmi:version. It cannot be found because the generic XML deserializer
silently ignores the xmlns:xmi declaration.

The only way that JET can load an XMI encoded document is to have an
EMF-generated deserializer (i.e. resource factory). The way JET finds that
factory is via the file extension, or, via the 'type' attribute on the
c:load tag (the 'type' attribute overrides the file extension).

You stated that a simplified document (your posted indicated it lacked a
namespace prefix on the original document, but I suspect is also lacked the
xmlns:xmi and xmi:version attributes) could be loaded. This to me is
consistent with the JET's inability to load XMI without the assist of an
appropriate resource factory.

BUT, all is not lost.

First, I assume that the document you are loading was serialized via EMF.
Things to check:

1) In the plug-in that declares the EMF metamodel for your document, verify
that plugin.xml has an entry like:

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type=" ... file extension for models ..."
class="... fully qualified name of an XXXResourceFactoryImpl" />
</extension>

2) If you are using a GMF editor to create the document, verify that domain
file extension is set to the same value as in 1, above. If you don't, JET
will not be able to load the resulting XMI output without a 'type' hint on
c:load (of the extension identified in 1).

3) In the c:load tag, explicitly specify the model loader id
"org.eclipse.jet.emf", and, assuming the xml is not the registered extension
in 1, the registered extension:

<c:load
url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
var="{$compoundResourceName}" urlContext="workspace"
loader="org.eclipse.jet.emf" type="... type from 1 ..." />

If none of this works, I think I will require a test case that I can debug.
The other alternative would be to load your XML documents via some mechanism
other than EMF (an standard XML DocumentBuilder, for example).
Unfortunately, JET doesn't include one of those yet, but there is an example
attached to bug 195847
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=195847).

Paul


"Stu" <evaandoli@dodo.com.au> wrote in message
news:f83l54$3fr$1@build.eclipse.org...
> Paul any answer on this one ?
> Getting close to my go live cut off?
> If you can think of another soltuion that would be good. I just feel a
> bit stuck.
>
> Thanks,
>
> Stu
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f3caem$u7i$1@build.eclipse.org...
>> Hi,
>> I have JET2 templates that work perfectly when I use the Run JET options
>> within Eclipse.
>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>> environment it doesn't find the files that it tried to load.
>> I feel the problem might be around the setting of the
>> ("org.eclipse.jet.resource.project.name").
>> During runtime I have set this to :-
>> 1) the Eclipse Project Name only
>> 2) platform:/<ProejctName>
>> 3) ./
>>
>> But each time I used the c:load it still doesn't find the files that I
>> feel it should.
>>
>> Any clues ?
>> Below is the code I use to call the JERTransform from within my GMF
>> diagram.
>> Below that is the Jet load command I'm using
>> Map<String, String> variables = new HashMap<String, String>();
>>
>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>
>> IStatus status =
>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>> aProgressMonitor);
>>
>>
>>
>> <c:load url="{$compoundResourceName}.xml"
>> var="{$compoundResourceName}Var" type="xml"/>
>>
>>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #29148 is a reply to message #28925] Thu, 26 July 2007 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

I got the test case narrowed down to:-
The issue for this seems to be around the ':'
If I use:-
<root:root next="sample2.xml">

</root:root>

I get the error but if I use:-
<rootroot next="sample2.xml">

</rootroot>

Does that help at all ?

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f882vi$ecs$1@build.eclipse.org...
> Stu:
>
> I've still don't have a definitive solution, but here are some thoughts:
>
> In a previous post you mention the following stack trace after c:load's
> failure:
>
> Seems to be saying feature 'version' is missing.
>
> e Resource$IOWrappedException (id=8067)
> cause FeatureNotFoundException (id=8071)
> cause FeatureNotFoundException (id=8071)
> column 294
> detailMessage "Feature \'version\' not found."
> featureName "version"
> line 2
> location "platform:/resource/TestPlugins/Test2.xml"
> object RuleConductorImpl (id=8092)
> stackTrace null
> detailMessage "Feature \'version\' not found.
> (platform:/resource/TestPlugins/Test2.xml, 2, 294)"
> stackTrace null
>
> This is a common failure when JET's XML loader (which is acutally using an
> EMF facility) tries to load an XMI-encoded document and JET has not
> supplied EMF with the right file extension to select the correct EMF
> deserializer. The generic XML deserializer that JET falls back to cannot
> load XMI encoded documents.
>
> Here are the first two lines of an XMI encoded document.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xmachine"
> nsURI="..." nsPrefix="...">
>
> The message "Feature 'version' not found" is refereing to the attribute
> xmi:version. It cannot be found because the generic XML deserializer
> silently ignores the xmlns:xmi declaration.
>
> The only way that JET can load an XMI encoded document is to have an
> EMF-generated deserializer (i.e. resource factory). The way JET finds that
> factory is via the file extension, or, via the 'type' attribute on the
> c:load tag (the 'type' attribute overrides the file extension).
>
> You stated that a simplified document (your posted indicated it lacked a
> namespace prefix on the original document, but I suspect is also lacked
> the xmlns:xmi and xmi:version attributes) could be loaded. This to me is
> consistent with the JET's inability to load XMI without the assist of an
> appropriate resource factory.
>
> BUT, all is not lost.
>
> First, I assume that the document you are loading was serialized via EMF.
> Things to check:
>
> 1) In the plug-in that declares the EMF metamodel for your document,
> verify that plugin.xml has an entry like:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <parser
> type=" ... file extension for models ..."
> class="... fully qualified name of an XXXResourceFactoryImpl" />
> </extension>
>
> 2) If you are using a GMF editor to create the document, verify that
> domain file extension is set to the same value as in 1, above. If you
> don't, JET will not be able to load the resulting XMI output without a
> 'type' hint on c:load (of the extension identified in 1).
>
> 3) In the c:load tag, explicitly specify the model loader id
> "org.eclipse.jet.emf", and, assuming the xml is not the registered
> extension in 1, the registered extension:
>
> <c:load
> url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
> var="{$compoundResourceName}" urlContext="workspace"
> loader="org.eclipse.jet.emf" type="... type from 1 ..." />
>
> If none of this works, I think I will require a test case that I can
> debug. The other alternative would be to load your XML documents via some
> mechanism other than EMF (an standard XML DocumentBuilder, for example).
> Unfortunately, JET doesn't include one of those yet, but there is an
> example attached to bug 195847
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195847).
>
> Paul
>
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f83l54$3fr$1@build.eclipse.org...
>> Paul any answer on this one ?
>> Getting close to my go live cut off?
>> If you can think of another soltuion that would be good. I just feel a
>> bit stuck.
>>
>> Thanks,
>>
>> Stu
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:f3caem$u7i$1@build.eclipse.org...
>>> Hi,
>>> I have JET2 templates that work perfectly when I use the Run JET
>>> options within Eclipse.
>>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>>> environment it doesn't find the files that it tried to load.
>>> I feel the problem might be around the setting of the
>>> ("org.eclipse.jet.resource.project.name").
>>> During runtime I have set this to :-
>>> 1) the Eclipse Project Name only
>>> 2) platform:/<ProejctName>
>>> 3) ./
>>>
>>> But each time I used the c:load it still doesn't find the files that I
>>> feel it should.
>>>
>>> Any clues ?
>>> Below is the code I use to call the JERTransform from within my GMF
>>> diagram.
>>> Below that is the Jet load command I'm using
>>> Map<String, String> variables = new HashMap<String, String>();
>>>
>>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>>
>>> IStatus status =
>>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>>> aProgressMonitor);
>>>
>>>
>>>
>>> <c:load url="{$compoundResourceName}.xml"
>>> var="{$compoundResourceName}Var" type="xml"/>
>>>
>>>
>>
>>
>
>
Re: [JET2] Struggling with finding my files during runtime [message #29186 is a reply to message #29148] Thu, 26 July 2007 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Sorry Paul - only read message one- Head not on today - I'll look at this
tomorrow and let you know.
Thanks for the detailed response.

Great support,

Stuart

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f8ab7o$340$1@build.eclipse.org...
>I got the test case narrowed down to:-
> The issue for this seems to be around the ':'
> If I use:-
> <root:root next="sample2.xml">
>
> </root:root>
>
> I get the error but if I use:-
> <rootroot next="sample2.xml">
>
> </rootroot>
>
> Does that help at all ?
>
> "Paul Elder" <pelder@ca.ibm.com> wrote in message
> news:f882vi$ecs$1@build.eclipse.org...
>> Stu:
>>
>> I've still don't have a definitive solution, but here are some thoughts:
>>
>> In a previous post you mention the following stack trace after c:load's
>> failure:
>>
>> Seems to be saying feature 'version' is missing.
>>
>> e Resource$IOWrappedException (id=8067)
>> cause FeatureNotFoundException (id=8071)
>> cause FeatureNotFoundException (id=8071)
>> column 294
>> detailMessage "Feature \'version\' not found."
>> featureName "version"
>> line 2
>> location "platform:/resource/TestPlugins/Test2.xml"
>> object RuleConductorImpl (id=8092)
>> stackTrace null
>> detailMessage "Feature \'version\' not found.
>> (platform:/resource/TestPlugins/Test2.xml, 2, 294)"
>> stackTrace null
>>
>> This is a common failure when JET's XML loader (which is acutally using
>> an EMF facility) tries to load an XMI-encoded document and JET has not
>> supplied EMF with the right file extension to select the correct EMF
>> deserializer. The generic XML deserializer that JET falls back to cannot
>> load XMI encoded documents.
>>
>> Here are the first two lines of an XMI encoded document.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xmachine"
>> nsURI="..." nsPrefix="...">
>>
>> The message "Feature 'version' not found" is refereing to the attribute
>> xmi:version. It cannot be found because the generic XML deserializer
>> silently ignores the xmlns:xmi declaration.
>>
>> The only way that JET can load an XMI encoded document is to have an
>> EMF-generated deserializer (i.e. resource factory). The way JET finds
>> that factory is via the file extension, or, via the 'type' attribute on
>> the c:load tag (the 'type' attribute overrides the file extension).
>>
>> You stated that a simplified document (your posted indicated it lacked a
>> namespace prefix on the original document, but I suspect is also lacked
>> the xmlns:xmi and xmi:version attributes) could be loaded. This to me is
>> consistent with the JET's inability to load XMI without the assist of an
>> appropriate resource factory.
>>
>> BUT, all is not lost.
>>
>> First, I assume that the document you are loading was serialized via EMF.
>> Things to check:
>>
>> 1) In the plug-in that declares the EMF metamodel for your document,
>> verify that plugin.xml has an entry like:
>>
>> <extension point="org.eclipse.emf.ecore.extension_parser">
>> <parser
>> type=" ... file extension for models ..."
>> class="... fully qualified name of an XXXResourceFactoryImpl" />
>> </extension>
>>
>> 2) If you are using a GMF editor to create the document, verify that
>> domain file extension is set to the same value as in 1, above. If you
>> don't, JET will not be able to load the resulting XMI output without a
>> 'type' hint on c:load (of the extension identified in 1).
>>
>> 3) In the c:load tag, explicitly specify the model loader id
>> "org.eclipse.jet.emf", and, assuming the xml is not the registered
>> extension in 1, the registered extension:
>>
>> <c:load
>> url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
>> var="{$compoundResourceName}" urlContext="workspace"
>> loader="org.eclipse.jet.emf" type="... type from 1 ..." />
>>
>> If none of this works, I think I will require a test case that I can
>> debug. The other alternative would be to load your XML documents via some
>> mechanism other than EMF (an standard XML DocumentBuilder, for example).
>> Unfortunately, JET doesn't include one of those yet, but there is an
>> example attached to bug 195847
>> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195847).
>>
>> Paul
>>
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:f83l54$3fr$1@build.eclipse.org...
>>> Paul any answer on this one ?
>>> Getting close to my go live cut off?
>>> If you can think of another soltuion that would be good. I just feel a
>>> bit stuck.
>>>
>>> Thanks,
>>>
>>> Stu
>>>
>>> "Stu" <evaandoli@dodo.com.au> wrote in message
>>> news:f3caem$u7i$1@build.eclipse.org...
>>>> Hi,
>>>> I have JET2 templates that work perfectly when I use the Run JET
>>>> options within Eclipse.
>>>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>>>> environment it doesn't find the files that it tried to load.
>>>> I feel the problem might be around the setting of the
>>>> ("org.eclipse.jet.resource.project.name").
>>>> During runtime I have set this to :-
>>>> 1) the Eclipse Project Name only
>>>> 2) platform:/<ProejctName>
>>>> 3) ./
>>>>
>>>> But each time I used the c:load it still doesn't find the files that I
>>>> feel it should.
>>>>
>>>> Any clues ?
>>>> Below is the code I use to call the JERTransform from within my GMF
>>>> diagram.
>>>> Below that is the Jet load command I'm using
>>>> Map<String, String> variables = new HashMap<String, String>();
>>>>
>>>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>>>
>>>> IStatus status =
>>>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>>>> aProgressMonitor);
>>>>
>>>>
>>>>
>>>> <c:load url="{$compoundResourceName}.xml"
>>>> var="{$compoundResourceName}Var" type="xml"/>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
<solved> Re: [JET2] Struggling with finding my files during runtime [message #29522 is a reply to message #28925] Mon, 30 July 2007 06:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Excellent response my dear friend.

GMF generates the extension point to be the diagram XMI and not the data
XMI.
So implementing the load with the loader and type hints worked.

Thanks a lot of that response very helpful.

I think we are up to 5 beers I owe you know,

Stu

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f882vi$ecs$1@build.eclipse.org...
> Stu:
>
> I've still don't have a definitive solution, but here are some thoughts:
>
> In a previous post you mention the following stack trace after c:load's
> failure:
>
> Seems to be saying feature 'version' is missing.
>
> e Resource$IOWrappedException (id=8067)
> cause FeatureNotFoundException (id=8071)
> cause FeatureNotFoundException (id=8071)
> column 294
> detailMessage "Feature \'version\' not found."
> featureName "version"
> line 2
> location "platform:/resource/TestPlugins/Test2.xml"
> object RuleConductorImpl (id=8092)
> stackTrace null
> detailMessage "Feature \'version\' not found.
> (platform:/resource/TestPlugins/Test2.xml, 2, 294)"
> stackTrace null
>
> This is a common failure when JET's XML loader (which is acutally using an
> EMF facility) tries to load an XMI-encoded document and JET has not
> supplied EMF with the right file extension to select the correct EMF
> deserializer. The generic XML deserializer that JET falls back to cannot
> load XMI encoded documents.
>
> Here are the first two lines of an XMI encoded document.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xmachine"
> nsURI="..." nsPrefix="...">
>
> The message "Feature 'version' not found" is refereing to the attribute
> xmi:version. It cannot be found because the generic XML deserializer
> silently ignores the xmlns:xmi declaration.
>
> The only way that JET can load an XMI encoded document is to have an
> EMF-generated deserializer (i.e. resource factory). The way JET finds that
> factory is via the file extension, or, via the 'type' attribute on the
> c:load tag (the 'type' attribute overrides the file extension).
>
> You stated that a simplified document (your posted indicated it lacked a
> namespace prefix on the original document, but I suspect is also lacked
> the xmlns:xmi and xmi:version attributes) could be loaded. This to me is
> consistent with the JET's inability to load XMI without the assist of an
> appropriate resource factory.
>
> BUT, all is not lost.
>
> First, I assume that the document you are loading was serialized via EMF.
> Things to check:
>
> 1) In the plug-in that declares the EMF metamodel for your document,
> verify that plugin.xml has an entry like:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <parser
> type=" ... file extension for models ..."
> class="... fully qualified name of an XXXResourceFactoryImpl" />
> </extension>
>
> 2) If you are using a GMF editor to create the document, verify that
> domain file extension is set to the same value as in 1, above. If you
> don't, JET will not be able to load the resulting XMI output without a
> 'type' hint on c:load (of the extension identified in 1).
>
> 3) In the c:load tag, explicitly specify the model loader id
> "org.eclipse.jet.emf", and, assuming the xml is not the registered
> extension in 1, the registered extension:
>
> <c:load
> url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
> var="{$compoundResourceName}" urlContext="workspace"
> loader="org.eclipse.jet.emf" type="... type from 1 ..." />
>
> If none of this works, I think I will require a test case that I can
> debug. The other alternative would be to load your XML documents via some
> mechanism other than EMF (an standard XML DocumentBuilder, for example).
> Unfortunately, JET doesn't include one of those yet, but there is an
> example attached to bug 195847
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195847).
>
> Paul
>
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f83l54$3fr$1@build.eclipse.org...
>> Paul any answer on this one ?
>> Getting close to my go live cut off?
>> If you can think of another soltuion that would be good. I just feel a
>> bit stuck.
>>
>> Thanks,
>>
>> Stu
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:f3caem$u7i$1@build.eclipse.org...
>>> Hi,
>>> I have JET2 templates that work perfectly when I use the Run JET
>>> options within Eclipse.
>>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>>> environment it doesn't find the files that it tried to load.
>>> I feel the problem might be around the setting of the
>>> ("org.eclipse.jet.resource.project.name").
>>> During runtime I have set this to :-
>>> 1) the Eclipse Project Name only
>>> 2) platform:/<ProejctName>
>>> 3) ./
>>>
>>> But each time I used the c:load it still doesn't find the files that I
>>> feel it should.
>>>
>>> Any clues ?
>>> Below is the code I use to call the JERTransform from within my GMF
>>> diagram.
>>> Below that is the Jet load command I'm using
>>> Map<String, String> variables = new HashMap<String, String>();
>>>
>>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>>
>>> IStatus status =
>>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>>> aProgressMonitor);
>>>
>>>
>>>
>>> <c:load url="{$compoundResourceName}.xml"
>>> var="{$compoundResourceName}Var" type="xml"/>
>>>
>>>
>>
>>
>
>
Re: <solved> Re: [JET2] Struggling with finding my files during runtime [message #29580 is a reply to message #29522] Mon, 30 July 2007 15:28 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

Now, I just have to figure out a reason to get to OZ so I can collect ;-)

Paul

"Stu" <evaandoli@dodo.com.au> wrote in message
news:f8k27t$t9n$1@build.eclipse.org...
> Excellent response my dear friend.
>
> GMF generates the extension point to be the diagram XMI and not the data
> XMI.
> So implementing the load with the loader and type hints worked.
>
> Thanks a lot of that response very helpful.
>
> I think we are up to 5 beers I owe you know,
>
> Stu
>
> "Paul Elder" <pelder@ca.ibm.com> wrote in message
> news:f882vi$ecs$1@build.eclipse.org...
>> Stu:
>>
>> I've still don't have a definitive solution, but here are some thoughts:
>>
>> In a previous post you mention the following stack trace after c:load's
>> failure:
>>
>> Seems to be saying feature 'version' is missing.
>>
>> e Resource$IOWrappedException (id=8067)
>> cause FeatureNotFoundException (id=8071)
>> cause FeatureNotFoundException (id=8071)
>> column 294
>> detailMessage "Feature \'version\' not found."
>> featureName "version"
>> line 2
>> location "platform:/resource/TestPlugins/Test2.xml"
>> object RuleConductorImpl (id=8092)
>> stackTrace null
>> detailMessage "Feature \'version\' not found.
>> (platform:/resource/TestPlugins/Test2.xml, 2, 294)"
>> stackTrace null
>>
>> This is a common failure when JET's XML loader (which is acutally using
>> an EMF facility) tries to load an XMI-encoded document and JET has not
>> supplied EMF with the right file extension to select the correct EMF
>> deserializer. The generic XML deserializer that JET falls back to cannot
>> load XMI encoded documents.
>>
>> Here are the first two lines of an XMI encoded document.
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xmachine"
>> nsURI="..." nsPrefix="...">
>>
>> The message "Feature 'version' not found" is refereing to the attribute
>> xmi:version. It cannot be found because the generic XML deserializer
>> silently ignores the xmlns:xmi declaration.
>>
>> The only way that JET can load an XMI encoded document is to have an
>> EMF-generated deserializer (i.e. resource factory). The way JET finds
>> that factory is via the file extension, or, via the 'type' attribute on
>> the c:load tag (the 'type' attribute overrides the file extension).
>>
>> You stated that a simplified document (your posted indicated it lacked a
>> namespace prefix on the original document, but I suspect is also lacked
>> the xmlns:xmi and xmi:version attributes) could be loaded. This to me is
>> consistent with the JET's inability to load XMI without the assist of an
>> appropriate resource factory.
>>
>> BUT, all is not lost.
>>
>> First, I assume that the document you are loading was serialized via EMF.
>> Things to check:
>>
>> 1) In the plug-in that declares the EMF metamodel for your document,
>> verify that plugin.xml has an entry like:
>>
>> <extension point="org.eclipse.emf.ecore.extension_parser">
>> <parser
>> type=" ... file extension for models ..."
>> class="... fully qualified name of an XXXResourceFactoryImpl" />
>> </extension>
>>
>> 2) If you are using a GMF editor to create the document, verify that
>> domain file extension is set to the same value as in 1, above. If you
>> don't, JET will not be able to load the resulting XMI output without a
>> 'type' hint on c:load (of the extension identified in 1).
>>
>> 3) In the c:load tag, explicitly specify the model loader id
>> "org.eclipse.jet.emf", and, assuming the xml is not the registered
>> extension in 1, the registered extension:
>>
>> <c:load
>> url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
>> var="{$compoundResourceName}" urlContext="workspace"
>> loader="org.eclipse.jet.emf" type="... type from 1 ..." />
>>
>> If none of this works, I think I will require a test case that I can
>> debug. The other alternative would be to load your XML documents via some
>> mechanism other than EMF (an standard XML DocumentBuilder, for example).
>> Unfortunately, JET doesn't include one of those yet, but there is an
>> example attached to bug 195847
>> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195847).
>>
>> Paul
>>
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:f83l54$3fr$1@build.eclipse.org...
>>> Paul any answer on this one ?
>>> Getting close to my go live cut off?
>>> If you can think of another soltuion that would be good. I just feel a
>>> bit stuck.
>>>
>>> Thanks,
>>>
>>> Stu
>>>
>>> "Stu" <evaandoli@dodo.com.au> wrote in message
>>> news:f3caem$u7i$1@build.eclipse.org...
>>>> Hi,
>>>> I have JET2 templates that work perfectly when I use the Run JET
>>>> options within Eclipse.
>>>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>>>> environment it doesn't find the files that it tried to load.
>>>> I feel the problem might be around the setting of the
>>>> ("org.eclipse.jet.resource.project.name").
>>>> During runtime I have set this to :-
>>>> 1) the Eclipse Project Name only
>>>> 2) platform:/<ProejctName>
>>>> 3) ./
>>>>
>>>> But each time I used the c:load it still doesn't find the files that I
>>>> feel it should.
>>>>
>>>> Any clues ?
>>>> Below is the code I use to call the JERTransform from within my GMF
>>>> diagram.
>>>> Below that is the Jet load command I'm using
>>>> Map<String, String> variables = new HashMap<String, String>();
>>>>
>>>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>>>
>>>> IStatus status =
>>>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>>>> aProgressMonitor);
>>>>
>>>>
>>>>
>>>> <c:load url="{$compoundResourceName}.xml"
>>>> var="{$compoundResourceName}Var" type="xml"/>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: <solved> Re: [JET2] Struggling with finding my files during runtime [message #30168 is a reply to message #29580] Tue, 31 July 2007 07:31 Go to previous message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

True and the beers not that great :-)

Just as a follow on is there something that should be changed in GMF to help
others with this type of error.
I'm using GMF pretty much as is. So you get two XMI files
(MyFile.vr_diagram and MyFile.vr). One has diagram info the other data
info.
There is an extension point for vr_diagram BUT GMF by default doesn't create
one for the data file (vr in this case).
Thus the c:load JET function does know what to you with the file.

Do this make sense :-)

Just wondering how to stop others getting stumped like I did,

Stuart

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:f8l04f$5jm$1@build.eclipse.org...
> Stu:
>
> Now, I just have to figure out a reason to get to OZ so I can collect ;-)
>
> Paul
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f8k27t$t9n$1@build.eclipse.org...
>> Excellent response my dear friend.
>>
>> GMF generates the extension point to be the diagram XMI and not the data
>> XMI.
>> So implementing the load with the loader and type hints worked.
>>
>> Thanks a lot of that response very helpful.
>>
>> I think we are up to 5 beers I owe you know,
>>
>> Stu
>>
>> "Paul Elder" <pelder@ca.ibm.com> wrote in message
>> news:f882vi$ecs$1@build.eclipse.org...
>>> Stu:
>>>
>>> I've still don't have a definitive solution, but here are some thoughts:
>>>
>>> In a previous post you mention the following stack trace after c:load's
>>> failure:
>>>
>>> Seems to be saying feature 'version' is missing.
>>>
>>> e Resource$IOWrappedException (id=8067)
>>> cause FeatureNotFoundException (id=8071)
>>> cause FeatureNotFoundException (id=8071)
>>> column 294
>>> detailMessage "Feature \'version\' not found."
>>> featureName "version"
>>> line 2
>>> location "platform:/resource/TestPlugins/Test2.xml"
>>> object RuleConductorImpl (id=8092)
>>> stackTrace null
>>> detailMessage "Feature \'version\' not found.
>>> (platform:/resource/TestPlugins/Test2.xml, 2, 294)"
>>> stackTrace null
>>>
>>> This is a common failure when JET's XML loader (which is acutally using
>>> an EMF facility) tries to load an XMI-encoded document and JET has not
>>> supplied EMF with the right file extension to select the correct EMF
>>> deserializer. The generic XML deserializer that JET falls back to cannot
>>> load XMI encoded documents.
>>>
>>> Here are the first two lines of an XMI encoded document.
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <ecore:EPackage xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="xmachine"
>>> nsURI="..." nsPrefix="...">
>>>
>>> The message "Feature 'version' not found" is refereing to the attribute
>>> xmi:version. It cannot be found because the generic XML deserializer
>>> silently ignores the xmlns:xmi declaration.
>>>
>>> The only way that JET can load an XMI encoded document is to have an
>>> EMF-generated deserializer (i.e. resource factory). The way JET finds
>>> that factory is via the file extension, or, via the 'type' attribute on
>>> the c:load tag (the 'type' attribute overrides the file extension).
>>>
>>> You stated that a simplified document (your posted indicated it lacked a
>>> namespace prefix on the original document, but I suspect is also lacked
>>> the xmlns:xmi and xmi:version attributes) could be loaded. This to me is
>>> consistent with the JET's inability to load XMI without the assist of an
>>> appropriate resource factory.
>>>
>>> BUT, all is not lost.
>>>
>>> First, I assume that the document you are loading was serialized via
>>> EMF. Things to check:
>>>
>>> 1) In the plug-in that declares the EMF metamodel for your document,
>>> verify that plugin.xml has an entry like:
>>>
>>> <extension point="org.eclipse.emf.ecore.extension_parser">
>>> <parser
>>> type=" ... file extension for models ..."
>>> class="... fully qualified name of an XXXResourceFactoryImpl" />
>>> </extension>
>>>
>>> 2) If you are using a GMF editor to create the document, verify that
>>> domain file extension is set to the same value as in 1, above. If you
>>> don't, JET will not be able to load the resulting XMI output without a
>>> 'type' hint on c:load (of the extension identified in 1).
>>>
>>> 3) In the c:load tag, explicitly specify the model loader id
>>> "org.eclipse.jet.emf", and, assuming the xml is not the registered
>>> extension in 1, the registered extension:
>>>
>>> <c:load
>>> url=" {$org.eclipse.jet.resource.project.name}/{$compoundResourceN ame}.xml "
>>> var="{$compoundResourceName}" urlContext="workspace"
>>> loader="org.eclipse.jet.emf" type="... type from 1 ..." />
>>>
>>> If none of this works, I think I will require a test case that I can
>>> debug. The other alternative would be to load your XML documents via
>>> some mechanism other than EMF (an standard XML DocumentBuilder, for
>>> example). Unfortunately, JET doesn't include one of those yet, but there
>>> is an example attached to bug 195847
>>> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=195847).
>>>
>>> Paul
>>>
>>>
>>> "Stu" <evaandoli@dodo.com.au> wrote in message
>>> news:f83l54$3fr$1@build.eclipse.org...
>>>> Paul any answer on this one ?
>>>> Getting close to my go live cut off?
>>>> If you can think of another soltuion that would be good. I just feel a
>>>> bit stuck.
>>>>
>>>> Thanks,
>>>>
>>>> Stu
>>>>
>>>> "Stu" <evaandoli@dodo.com.au> wrote in message
>>>> news:f3caem$u7i$1@build.eclipse.org...
>>>>> Hi,
>>>>> I have JET2 templates that work perfectly when I use the Run JET
>>>>> options within Eclipse.
>>>>> When I link it in to my GMF diagram and lauch the runtime Eclipse
>>>>> environment it doesn't find the files that it tried to load.
>>>>> I feel the problem might be around the setting of the
>>>>> ("org.eclipse.jet.resource.project.name").
>>>>> During runtime I have set this to :-
>>>>> 1) the Eclipse Project Name only
>>>>> 2) platform:/<ProejctName>
>>>>> 3) ./
>>>>>
>>>>> But each time I used the c:load it still doesn't find the files that I
>>>>> feel it should.
>>>>>
>>>>> Any clues ?
>>>>> Below is the code I use to call the JERTransform from within my GMF
>>>>> diagram.
>>>>> Below that is the Jet load command I'm using
>>>>> Map<String, String> variables = new HashMap<String, String>();
>>>>>
>>>>> variables.put("org.eclipse.jet.resource.project.name",resource.getURI().segments()[1]);
>>>>>
>>>>> IStatus status =
>>>>> GenerateXMLDictionaryAction.runTransformXMLDiagram(resource, variables,
>>>>> aProgressMonitor);
>>>>>
>>>>>
>>>>>
>>>>> <c:load url="{$compoundResourceName}.xml"
>>>>> var="{$compoundResourceName}Var" type="xml"/>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Previous Topic:Versions problem
Next Topic:Installing JET plugins in a separate directory
Goto Forum:
  


Current Time: Fri Mar 29 12:35:05 GMT 2024

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

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

Back to the top