Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Resource factory needed exception while running Ecore2Java Ant task outside the Eclipse
Resource factory needed exception while running Ecore2Java Ant task outside the Eclipse [message #538669] Tue, 08 June 2010 11:39 Go to next message
login is currently offline loginFriend
Messages: 13
Registered: May 2010
Junior Member
Hi All,
I am trying to run the Ecore2Java ant task outside the Eclipse but i couldnt .
I got the follwowing exception .If any body has hints about this condition pls let me knw.

Does Ecore2Java task can be run outside the Eclipse?

C:\CDEWorkspace\spectrial\build.xml:76: java.lang.RuntimeException: org.eclipse.
emf.common.util.DiagnosticException: RuntimeException: Cannot create a resource
for 'file:/C:/CDEWorkspace/spectrial/model/spectrial.genmodel'; a registered res
ource factory is needed
at org.eclipse.emf.importer.ModelImporterApplication.handleGenM odelPath(
ModelImporterApplication.java:447)
at org.eclipse.emf.importer.ModelImporterApplication.adjustMode lImporter
(ModelImporterApplication.java:427)
at org.eclipse.emf.importer.ModelImporterApplication.execute(Mo delImport
erApplication.java:213)
at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI mporterAp
plication.java:178)
at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI mporterAp
plication.java:162)
at org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask.c reateGenM
odel(EcoreGeneratorTask.java:81)
at org.eclipse.emf.ant.taskdefs.codegen.ecore.GeneratorTask.doE xecute(Ge
neratorTask.java:380)
at org.eclipse.emf.ant.taskdefs.EMFTask.execute(EMFTask.java:76 )
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366 )
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:124 9)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.eclipse.emf.common.util.DiagnosticException: RuntimeException: Ca
nnot create a resource for 'file:/C:/CDEWorkspace/spectrial/model/spectrial.genm
odel'; a registered resource factory is needed
at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel( ModelImpo
rter.java:513)
at org.eclipse.emf.importer.ModelImporter.defineOriginalGenMode lPath(Mod
elImporter.java:167)
at org.eclipse.emf.importer.ModelImporterApplication.handleGenM odelPath(
ModelImporterApplication.java:443)
... 24 more
Caused by: java.lang.RuntimeException: Cannot create a resource for 'file:/C:/CD
EWorkspace/spectrial/model/spectrial.genmodel'; a registered resource factory is
needed
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(Resou
rceSetImpl.java:394)
at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel( ModelImpo
rter.java:470)
... 26 more

Total time: 1 second
C:\CDEWorkspace\spectrial>
Re: Resource factory needed exception while running Ecore2Java Ant task outside the Eclipse [message #538801 is a reply to message #538669] Tue, 08 June 2010 16:33 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi,

this is actually a question regarding EMF, thus I added the corresponding
newsgroup as well.

I got this task working by using Buckminster which runs a headless Eclipse
installation. Don't know how to proceed with pure ant though.

HTH
Axel


login wrote:

> Hi All,
> I am trying to run the Ecore2Java ant task outside the Eclipse but i
> couldnt .
> I got the follwowing exception .If any body has hints about this condition
> pls let me knw.
>
> Does Ecore2Java task can be run outside the Eclipse?
>
> C:\CDEWorkspace\spectrial\build.xml:76: java.lang.RuntimeException:
> org.eclipse. emf.common.util.DiagnosticException: RuntimeException: Cannot
> create a resource for
> 'file:/C:/CDEWorkspace/spectrial/model/spectrial.genmodel'; a registered
> res ource factory is needed
> at org.eclipse.emf.importer.ModelImporterApplication.handleGenM
> odelPath(
> ModelImporterApplication.java:447)
> at org.eclipse.emf.importer.ModelImporterApplication.adjustMode
> lImporter
> (ModelImporterApplication.java:427)
> at org.eclipse.emf.importer.ModelImporterApplication.execute(Mo
> delImport
> erApplication.java:213)
> at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI
> mporterAp
> plication.java:178)
> at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI
> mporterAp
> plication.java:162)
> at org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask.c
> reateGenM
> odel(EcoreGeneratorTask.java:81)
> at org.eclipse.emf.ant.taskdefs.codegen.ecore.GeneratorTask.doE
> xecute(Ge
> neratorTask.java:380)
> at org.eclipse.emf.ant.taskdefs.EMFTask.execute(EMFTask.java:76 )
> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j
> ava:291) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.
> java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch
> Utils.jav
> a:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at org.apache.tools.ant.Target.execute(Target.java:390)
> at org.apache.tools.ant.Target.performTasks(Target.java:411)
> at org.apache.tools.ant.Project.executeSortedTargets(Project.ja
> va:1397)
> at org.apache.tools.ant.Project.executeTarget(Project.java:1366 )
> at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D
> efaultExe
> cutor.java:41)
> at org.apache.tools.ant.Project.executeTargets(Project.java:124
> 9) at org.apache.tools.ant.Main.runBuild(Main.java:801)
> at org.apache.tools.ant.Main.startAnt(Main.java:218)
> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> Caused by: org.eclipse.emf.common.util.DiagnosticException:
> RuntimeException: Ca nnot create a resource for
> 'file:/C:/CDEWorkspace/spectrial/model/spectrial.genm odel'; a registered
> resource factory is needed
> at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel(
> ModelImpo
> rter.java:513)
> at org.eclipse.emf.importer.ModelImporter.defineOriginalGenMode
> lPath(Mod
> elImporter.java:167)
> at org.eclipse.emf.importer.ModelImporterApplication.handleGenM
> odelPath(
> ModelImporterApplication.java:443)
> ... 24 more
> Caused by: java.lang.RuntimeException: Cannot create a resource for
> 'file:/C:/CD EWorkspace/spectrial/model/spectrial.genmodel'; a registered
> resource factory is
> needed
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
> rce(Resou
> rceSetImpl.java:394)
> at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel(
> ModelImpo
> rter.java:470)
> ... 26 more
>
> Total time: 1 second
> C:\CDEWorkspace\spectrial>
Re: Resource factory needed exception while running Ecore2Java Ant task outside the Eclipse [message #538838 is a reply to message #538801] Tue, 08 June 2010 17:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33148
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080607090703080306070703
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Axel,

When running outside of Eclipse *all *plugin.xml registrations need to
be done manually. You should run it as an Eclipse ant task.


Axel Guckelsberger wrote:
> Hi,
>
> this is actually a question regarding EMF, thus I added the corresponding
> newsgroup as well.
>
> I got this task working by using Buckminster which runs a headless Eclipse
> installation. Don't know how to proceed with pure ant though.
>
> HTH
> Axel
>
>
> login wrote:
>
>
>> Hi All,
>> I am trying to run the Ecore2Java ant task outside the Eclipse but i
>> couldnt .
>> I got the follwowing exception .If any body has hints about this condition
>> pls let me knw.
>>
>> Does Ecore2Java task can be run outside the Eclipse?
>>
>> C:\CDEWorkspace\spectrial\build.xml:76: java.lang.RuntimeException:
>> org.eclipse. emf.common.util.DiagnosticException: RuntimeException: Cannot
>> create a resource for
>> 'file:/C:/CDEWorkspace/spectrial/model/spectrial.genmodel'; a registered
>> res ource factory is needed
>> at org.eclipse.emf.importer.ModelImporterApplication.handleGenM
>> odelPath(
>> ModelImporterApplication.java:447)
>> at org.eclipse.emf.importer.ModelImporterApplication.adjustMode
>> lImporter
>> (ModelImporterApplication.java:427)
>> at org.eclipse.emf.importer.ModelImporterApplication.execute(Mo
>> delImport
>> erApplication.java:213)
>> at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI
>> mporterAp
>> plication.java:178)
>> at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI
>> mporterAp
>> plication.java:162)
>> at org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask.c
>> reateGenM
>> odel(EcoreGeneratorTask.java:81)
>> at org.eclipse.emf.ant.taskdefs.codegen.ecore.GeneratorTask.doE
>> xecute(Ge
>> neratorTask.java:380)
>> at org.eclipse.emf.ant.taskdefs.EMFTask.execute(EMFTask.java:76 )
>> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j
>> ava:291) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.
>> java:39)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAcces
>> sorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:585)
>> at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch
>> Utils.jav
>> a:106)
>> at org.apache.tools.ant.Task.perform(Task.java:348)
>> at org.apache.tools.ant.Target.execute(Target.java:390)
>> at org.apache.tools.ant.Target.performTasks(Target.java:411)
>> at org.apache.tools.ant.Project.executeSortedTargets(Project.ja
>> va:1397)
>> at org.apache.tools.ant.Project.executeTarget(Project.java:1366 )
>> at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D
>> efaultExe
>> cutor.java:41)
>> at org.apache.tools.ant.Project.executeTargets(Project.java:124
>> 9) at org.apache.tools.ant.Main.runBuild(Main.java:801)
>> at org.apache.tools.ant.Main.startAnt(Main.java:218)
>> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
>> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
>> Caused by: org.eclipse.emf.common.util.DiagnosticException:
>> RuntimeException: Ca nnot create a resource for
>> 'file:/C:/CDEWorkspace/spectrial/model/spectrial.genm odel'; a registered
>> resource factory is needed
>> at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel(
>> ModelImpo
>> rter.java:513)
>> at org.eclipse.emf.importer.ModelImporter.defineOriginalGenMode
>> lPath(Mod
>> elImporter.java:167)
>> at org.eclipse.emf.importer.ModelImporterApplication.handleGenM
>> odelPath(
>> ModelImporterApplication.java:443)
>> ... 24 more
>> Caused by: java.lang.RuntimeException: Cannot create a resource for
>> 'file:/C:/CD EWorkspace/spectrial/model/spectrial.genmodel'; a registered
>> resource factory is
>> needed
>> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
>> rce(Resou
>> rceSetImpl.java:394)
>> at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel(
>> ModelImpo
>> rter.java:470)
>> ... 26 more
>>
>> Total time: 1 second
>> C:\CDEWorkspace\spectrial>
>>
>
>

--------------080607090703080306070703
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Axel,<br>
<br>
When running outside of Eclipse <b>all </b>plugin.xml registrations
need to be done manually.&nbsp; You should run it as an Eclipse ant task.<br>
<br>
<br>
Axel Guckelsberger wrote:
<blockquote cite="mid:hulrc7$iju$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,

this is actually a question regarding EMF, thus I added the corresponding
newsgroup as well.

I got this task working by using Buckminster which runs a headless Eclipse
installation. Don't know how to proceed with pure ant though.

HTH
Axel


login wrote:

</pre>
<blockquote type="cite">
<pre wrap="">Hi All,
I am trying to run the Ecore2Java ant task outside the Eclipse but i
couldnt .
I got the follwowing exception .If any body has hints about this condition
pls let me knw.

Does Ecore2Java task can be run outside the Eclipse?

C:\CDEWorkspace\spectrial\build.xml:76: java.lang.RuntimeException:
org.eclipse. emf.common.util.DiagnosticException: RuntimeException: Cannot
create a resource for
'<a class="moz-txt-link-freetext" href="file:/C:/CDEWorkspace/spectrial/model/spectrial.genmodel ">file:/C:/CDEWorkspace/spectrial/model/spectrial.genmodel</a >'; a registered
res ource factory is needed
at org.eclipse.emf.importer.ModelImporterApplication.handleGenM
odelPath(
ModelImporterApplication.java:447)
at org.eclipse.emf.importer.ModelImporterApplication.adjustMode
lImporter
(ModelImporterApplication.java:427)
at org.eclipse.emf.importer.ModelImporterApplication.execute(Mo
delImport
erApplication.java:213)
at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI
mporterAp
plication.java:178)
at org.eclipse.emf.importer.ModelImporterApplication.run(ModelI
mporterAp
plication.java:162)
at org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask.c
reateGenM
odel(EcoreGeneratorTask.java:81)
at org.eclipse.emf.ant.taskdefs.codegen.ecore.GeneratorTask.doE
xecute(Ge
neratorTask.java:380)
at org.eclipse.emf.ant.taskdefs.EMFTask.execute(EMFTask.java:76 )
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j
ava:291) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
ssorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
thodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch
Utils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.ja
va:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366 )
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D
efaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:124
9) at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.eclipse.emf.common.util.DiagnosticException:
RuntimeException: Ca nnot create a resource for
'<a class="moz-txt-link-freetext" href="file:/C:/CDEWorkspace/spectrial/model/spectrial.genm" >file:/C:/CDEWorkspace/spectrial/model/spectrial.genm</a> odel'; a registered
resource factory is needed
at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel(
ModelImpo
rter.java:513)
at org.eclipse.emf.importer.ModelImporter.defineOriginalGenMode
lPath(Mod
elImporter.java:167)
at org.eclipse.emf.importer.ModelImporterApplication.handleGenM
odelPath(
ModelImporterApplication.java:443)
... 24 more
Caused by: java.lang.RuntimeException: Cannot create a resource for
'<a class="moz-txt-link-freetext" href="file:/C:/CD">file:/C:/CD</a> EWorkspace/spectrial/model/spectrial.genmodel'; a registered
resource factory is
needed
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou
rce(Resou
rceSetImpl.java:394)
at org.eclipse.emf.importer.ModelImporter.loadOriginalGenModel(
ModelImpo
rter.java:470)
... 26 more

Total time: 1 second
C:\CDEWorkspace\spectrial&gt;
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>

--------------080607090703080306070703--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Outline viewer inside a compartment
Next Topic:get editingDomain from the propertydescriptor
Goto Forum:
  


Current Time: Mon May 20 02:52:54 GMT 2024

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

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

Back to the top