Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » MissingResourceException when using EMF in standalone mode
MissingResourceException when using EMF in standalone mode [message #632244] Tue, 12 October 2010 09:12 Go to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi,

I'm using EMF in standalone mode, more specifically inside an ANT
script. The ANT script does load and validate a GenModel and thereby
also the referenced Ecore model.

I get the following exception:

java.util.MissingResourceException: The string resource
'_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic' could not be
located
at
org.eclipse.emf.common.util.DelegatingResourceLocator.delega tedGetString(DelegatingResourceLocator.java:487)
at
org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:392)
at
org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:506)
at
org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:498)
at
org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.getString(EcoreValidator.java:4960)
at
org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.createDiagnostic(EcoreValidator.java:4945)
at
org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.parseInstanceTypeName(EcoreValidator.java:4219)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1323)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1278)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ypeArgument(GenBaseImpl.java:3443)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1355)
at
org.eclipse.emf.codegen.ecore.genmodel.impl.GenTypedElementI mpl.getQualifiedListItemType(GenTypedElementImpl.java:352)
...


I'd guess the plugin.properties file in
org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar, which contains the
requested property is not resolved correctly.

Does anyone know what might cause this exception?

Any help is very much appreciated.

Best regards,

Mirko
Re: MissingResourceException when using EMF in standalone mode [message #632281 is a reply to message #632244] Tue, 12 October 2010 12:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Mirko,

I'd expect that to work. Maybe you can trace what's happening in
DelegatingResourceLocator.doGetString?


Mirko Seifert wrote:
> Hi,
>
> I'm using EMF in standalone mode, more specifically inside an ANT
> script. The ANT script does load and validate a GenModel and thereby
> also the referenced Ecore model.
>
> I get the following exception:
>
> java.util.MissingResourceException: The string resource
> '_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic' could not
> be located
> at
> org.eclipse.emf.common.util.DelegatingResourceLocator.delega tedGetString(DelegatingResourceLocator.java:487)
>
> at
> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:392)
>
> at
> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:506)
>
> at
> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:498)
>
> at
> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.getString(EcoreValidator.java:4960)
>
> at
> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.createDiagnostic(EcoreValidator.java:4945)
>
> at
> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.parseInstanceTypeName(EcoreValidator.java:4219)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1323)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1278)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ypeArgument(GenBaseImpl.java:3443)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1355)
>
> at
> org.eclipse.emf.codegen.ecore.genmodel.impl.GenTypedElementI mpl.getQualifiedListItemType(GenTypedElementImpl.java:352)
>
> ...
>
>
> I'd guess the plugin.properties file in
> org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar, which contains the
> requested property is not resolved correctly.
>
> Does anyone know what might cause this exception?
>
> Any help is very much appreciated.
>
> Best regards,
>
> Mirko
Re: MissingResourceException when using EMF in standalone mode [message #632615 is a reply to message #632281] Wed, 13 October 2010 14:56 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------040106010403030901090809
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ed,

I've created a small class that reproduces the problem. It's attached.

After compiling the class you can run it as follows:

java -cp
.../bin:../libs/plugins/org.eclipse.emf.ecore_2.6.1.v2010091 4-1218.jar:../libs/plugins/org.eclipse.emf.common_2.6.0.v201 00914-1218.jar:../libs/plugins/org.eclipse.emf.ecore.xmi_2.5 .0.v20100521-1846.jar:../libs/plugins/org.eclipse.emf.codege n.ecore_2.6.1.v20100914-1218.jar:../libs/plugins/org.eclipse .emf.codegen_2.6.0.v20100914-1218.jar
emf.StandaloneEMFTest "file:/home/ed/test/Ecore.genmodel"

Of course, you'll need to adjust the paths ("../libs/plugins" and
"/home/ed/test/"). Also, you need to extract "Ecore.genmodel" and
"Ecore.ecore" to /home/ed/test.

When you run the example, the exception mentioned earlier is thrown.
Actually a different property cannot be found, but the exception is the
same.

Thanks a lot in advance!

Mirko


12.10.2010 14:27, Ed Merks:
> Mirko,
>
> I'd expect that to work. Maybe you can trace what's happening in
> DelegatingResourceLocator.doGetString?
>
>
> Mirko Seifert wrote:
>> Hi,
>>
>> I'm using EMF in standalone mode, more specifically inside an ANT
>> script. The ANT script does load and validate a GenModel and thereby
>> also the referenced Ecore model.
>>
>> I get the following exception:
>>
>> java.util.MissingResourceException: The string resource
>> '_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic' could not
>> be located
>> at
>> org.eclipse.emf.common.util.DelegatingResourceLocator.delega tedGetString(DelegatingResourceLocator.java:487)
>>
>> at
>> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:392)
>>
>> at
>> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:506)
>>
>> at
>> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:498)
>>
>> at
>> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.getString(EcoreValidator.java:4960)
>>
>> at
>> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.createDiagnostic(EcoreValidator.java:4945)
>>
>> at
>> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.parseInstanceTypeName(EcoreValidator.java:4219)
>>
>> at
>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1323)
>>
>> at
>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1278)
>>
>> at
>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ypeArgument(GenBaseImpl.java:3443)
>>
>> at
>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1355)
>>
>> at
>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenTypedElementI mpl.getQualifiedListItemType(GenTypedElementImpl.java:352)
>>
>> ...
>>
>>
>> I'd guess the plugin.properties file in
>> org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar, which contains the
>> requested property is not resolved correctly.
>>
>> Does anyone know what might cause this exception?
>>
>> Any help is very much appreciated.
>>
>> Best regards,
>>
>> Mirko


--------------040106010403030901090809
Content-Type: text/plain;
name="StandaloneEMFTest.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="Standalone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QoJCQl9 DQoJCX0NCgl9
DQoNCglwcml2YXRlIHN0YXRpYyB2b2lkIHJlZ2lzdGVyRmFjdG9yaWVzKCkg ew0KCQlFUGFj
a2FnZS5SZWdpc3RyeS5JTlNUQU5DRS5wdXQoR2VuTW9kZWxQYWNrYWdlLmVO U19VUkksDQoJ
CQkJR2VuTW9kZWxQYWNrYWdlLmVJTlNUQU5DRSk7DQoJCUVQYWNrYWdlLlJl Z2lzdHJ5LklO
U1RBTkNFLnB1dChFY29yZVBhY2thZ2UuZU5TX1VSSSwNCgkJCQlFY29yZVBh Y2thZ2UuZUlO
U1RBTkNFKTsNCg0KCQlHZW5Nb2RlbFBhY2thZ2UuZUlOU1RBTkNFLmdldEdl bkNsYXNzKCk7
DQoJCUVjb3JlUGFja2FnZS5lSU5TVEFOQ0UuZ2V0RUNsYXNzKCk7CgkJUmVz b3VyY2UuRmFj
dG9yeS5SZWdpc3RyeS5JTlNUQU5DRS5nZXRFeHRlbnNpb25Ub0ZhY3RvcnlN YXAoKS5wdXQo
DQoJCQkJImVjb3JlIiwNCgkJCQluZXcgb3JnLmVjbGlwc2UuZW1mLmVjb3Jl LnhtaS5pbXBs
LkVjb3JlUmVzb3VyY2VGYWN0b3J5SW1wbCgpKTsNCgkJUmVzb3VyY2UuRmFj dG9yeS5SZWdp
c3RyeS5JTlNUQU5DRS5nZXRFeHRlbnNpb25Ub0ZhY3RvcnlNYXAoKS5wdXQo DQoJCQkJImdl
bm1vZGVsIiwNCgkJCQluZXcgb3JnLmVjbGlwc2UuZW1mLmVjb3JlLnhtaS5p bXBsLkVjb3Jl
UmVzb3VyY2VGYWN0b3J5SW1wbCgpKTsNCgl9DQp9DQo=
--------------040106010403030901090809--
Re: MissingResourceException when using EMF in standalone mode [message #632676 is a reply to message #632615] Wed, 13 October 2010 20:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Mirko,

I installed the SR1 modeling package, generated a model (from
Library.xsd as in the tutorial) and also generated the tests. Then I
copied your class into the tests project and ran it as a java
application. It ran fine. I also added this

Diagnostic result =
EcoreValidator.EGenericTypeBuilder.INSTANCE.parseInstanceTyp eName( "a#b");
System.err.println("###" + result);

And it prints this:

###Diagnostic ERROR source=org.eclipse.emf.ecore.model code=42 Analysis
result for the instance type name 'a#b'
data=[org.eclipse.emf.ecore.impl.EGenericTypeImpl@e28b9 (expression: ?),
a#b] [Diagnostic ERROR source=org.eclipse.emf.ecore.model code=42 The
'#' at index 1 is not expected data=[1]]

So the messages are definitely being loaded...

I suspect that the issue is the ../blah you're using to specify the
path. I'm not sure Java will resolve that to an absolute path. EMF will
definitely rely on the path being absolute when it asks Java for the
jar's URL.


Mirko Seifert wrote:
> Hi Ed,
>
> I've created a small class that reproduces the problem. It's attached.
>
> After compiling the class you can run it as follows:
>
> java -cp
> ../bin:../libs/plugins/org.eclipse.emf.ecore_2.6.1.v20100914 -1218.jar:../libs/plugins/org.eclipse.emf.common_2.6.0.v2010 0914-1218.jar:../libs/plugins/org.eclipse.emf.ecore.xmi_2.5. 0.v20100521-1846.jar:../libs/plugins/org.eclipse.emf.codegen .ecore_2.6.1.v20100914-1218.jar:../libs/plugins/org.eclipse. emf.codegen_2.6.0.v20100914-1218.jar
> emf.StandaloneEMFTest "file:/home/ed/test/Ecore.genmodel"
>
> Of course, you'll need to adjust the paths ("../libs/plugins" and
> "/home/ed/test/"). Also, you need to extract "Ecore.genmodel" and
> "Ecore.ecore" to /home/ed/test.
>
> When you run the example, the exception mentioned earlier is thrown.
> Actually a different property cannot be found, but the exception is
> the same.
>
> Thanks a lot in advance!
>
> Mirko
>
>
> 12.10.2010 14:27, Ed Merks:
>> Mirko,
>>
>> I'd expect that to work. Maybe you can trace what's happening in
>> DelegatingResourceLocator.doGetString?
>>
>>
>> Mirko Seifert wrote:
>>> Hi,
>>>
>>> I'm using EMF in standalone mode, more specifically inside an ANT
>>> script. The ANT script does load and validate a GenModel and thereby
>>> also the referenced Ecore model.
>>>
>>> I get the following exception:
>>>
>>> java.util.MissingResourceException: The string resource
>>> '_UI_EClassifierInstanceTypeNameAnalysisResult_diagnostic' could not
>>> be located
>>> at
>>> org.eclipse.emf.common.util.DelegatingResourceLocator.delega tedGetString(DelegatingResourceLocator.java:487)
>>>
>>>
>>> at
>>> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:392)
>>>
>>>
>>> at
>>> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:506)
>>>
>>>
>>> at
>>> org.eclipse.emf.common.util.DelegatingResourceLocator.getStr ing(DelegatingResourceLocator.java:498)
>>>
>>>
>>> at
>>> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.getString(EcoreValidator.java:4960)
>>>
>>>
>>> at
>>> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.createDiagnostic(EcoreValidator.java:4945)
>>>
>>>
>>> at
>>> org.eclipse.emf.ecore.util.EcoreValidator$EGenericTypeBuilde r.parseInstanceTypeName(EcoreValidator.java:4219)
>>>
>>>
>>> at
>>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1323)
>>>
>>>
>>> at
>>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1278)
>>>
>>>
>>> at
>>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ypeArgument(GenBaseImpl.java:3443)
>>>
>>>
>>> at
>>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenBaseImpl.getT ype(GenBaseImpl.java:1355)
>>>
>>>
>>> at
>>> org.eclipse.emf.codegen.ecore.genmodel.impl.GenTypedElementI mpl.getQualifiedListItemType(GenTypedElementImpl.java:352)
>>>
>>>
>>> ...
>>>
>>>
>>> I'd guess the plugin.properties file in
>>> org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar, which contains the
>>> requested property is not resolved correctly.
>>>
>>> Does anyone know what might cause this exception?
>>>
>>> Any help is very much appreciated.
>>>
>>> Best regards,
>>>
>>> Mirko
>
Re: MissingResourceException when using EMF in standalone mode [message #632831 is a reply to message #632676] Thu, 14 October 2010 12:31 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi Ed,

I replaced the ../ parts of the classpath with absolute paths, but exception remains. Any other ideas?

Best regards,

Mirko
Re: MissingResourceException when using EMF in standalone mode [message #632931 is a reply to message #632831] Thu, 14 October 2010 17:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Mirko,

What exactly does your classpath look like?

Try doing exactly what I described. With that approach, Eclipse sets
up your classpath and you can look closely at how it's specified in the
debug view looking at the properties of the terminated application. You
can also trace why this stuff is failing. I.e., determine what's the
getBaseURL computed for the Ecore jar...


Mirko Seifert wrote:
> Hi Ed,
>
> I replaced the ../ parts of the classpath with absolute paths, but
> exception remains. Any other ideas?
>
> Best regards,
>
> Mirko
>
Re: MissingResourceException when using EMF in standalone mode [message #632951 is a reply to message #632931] Thu, 14 October 2010 18:54 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi Ed,

my classpath looked like this:

java -cp /home/hudson/build_server/output:/home/hudson/build_server/l ibs/plugins/org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar:/ home/hudson/build_server/libs/plugins/org.eclipse.emf.common _2.6.0.v20100914-1218.jar:/home/hudson/build_server/libs/plu gins/org.eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar:/hom e/hudson/build_server/libs/plugins/org.eclipse.emf.codegen.e core_2.6.1.v20100914-1218.jar:/home/hudson/build_server/libs /plugins/org.eclipse.emf.codegen_2.6.0.v20100914-1218.jar emf.StandaloneEMFTest "file:/home/hudson/build_server/build/Ecore.genmodel"

I did what you suggested on my windows machine where it worked fine as you suspected. I took the classpath from the properties view of the terminated applicated and converted it to be usable on linux (the ANT script runs on a Linux box). I replaced ";" with ":" (the path separator) and the path my Eclipse installation on windows with the path to Eclipse on linux (/home/hudson/build_server/libs). I exchange "javaw.exe" with "java" and removed the encoding parameter (-Dfile.encoding=Cp1252).

Now the classpath is slightly longer:

java -classpath /home/hudson/build_server/output:/home/hudson/build_server/l ibs/plugins/org.eclipse.core.runtime_3.6.0.v20100505.jar:/ho me/hudson/build_server/libs/plugins/org.eclipse.osgi_3.6.1.R 36x_v20100806.jar:/home/hudson/build_server/libs/plugins/org .eclipse.equinox.common_3.6.0.v20100503.jar:/home/hudson/bui ld_server/libs/plugins/org.eclipse.core.jobs_3.5.1.R36x_v201 00824.jar:/home/hudson/build_server/libs/plugins/org.eclipse .core.runtime.compatibility.registry_3.3.0.v20100520\runtime _registry_compatibility.jar:/home/hudson/build_server/libs/p lugins/org.eclipse.equinox.registry_3.5.0.v20100503.jar:/hom e/hudson/build_server/libs/plugins/org.eclipse.equinox.prefe rences_3.3.0.v20100503.jar:/home/hudson/build_server/libs/pl ugins/org.eclipse.core.contenttype_3.4.100.v20100505-1235.ja r:/home/hudson/build_server/libs/plugins/org.eclipse.equinox .app_1.3.1.R36x_v20100803.jar:C:\Projects\Eclipse-Workspaces \EMFText-DEV\library\bin:/home/hudson/build_server/libs/plug ins/org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar:/home/hud son/build_server/libs/plugins/org.eclipse.emf.common_2.6.0.v 20100914-1218.jar:/home/hudson/build_server/libs/plugins/org .eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar:/home/hudson /build_server/libs/plugins/org.junit_4.8.1.v4_8_1_v20100427- 1100\junit.jar:/home/hudson/build_server/libs/plugins/org.ha mcrest.core_1.1.0.v20090501071000.jar:/home/hudson/build_ser ver/libs/plugins/org.eclipse.emf.codegen_2.6.0.v20100914-121 8.jar:/home/hudson/build_server/libs/plugins/org.eclipse.emf .codegen.ecore_2.6.1.v20100914-1218.jar emf.StandaloneEMFTest file://home/hudson/build_server/build/Ecore.genmodel

Unfortunately, I do still face the exception. Maybe there is problem due to the forward slashes used on Linux? What can I do to nail the problem further down?

Thanks for your help!

Mirko
Re: MissingResourceException when using EMF in standalone mode [message #632964 is a reply to message #632951] Thu, 14 October 2010 20:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Mirko,

Comments below.


Mirko Seifert wrote:
> Hi Ed,
>
> my classpath looked like this:
>
> java -cp /home/hudson/build_server/output:/home/hudson/build_server/l
> ibs/plugins/org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar:/
> home/hudson/build_server/libs/plugins/org.eclipse.emf.common
> _2.6.0.v20100914-1218.jar:/home/hudson/build_server/libs/plu
> gins/org.eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar:/hom
> e/hudson/build_server/libs/plugins/org.eclipse.emf.codegen.e
> core_2.6.1.v20100914-1218.jar:/home/hudson/build_server/libs
> /plugins/org.eclipse.emf.codegen_2.6.0.v20100914-1218.jar
> emf.StandaloneEMFTest
> "file:/home/hudson/build_server/build/Ecore.genmodel"
>
> I did what you suggested on my windows machine where it worked fine as
> you suspected.
That's good.
> I took the classpath from the properties view of the terminated
> applicated and converted it to be usable on linux (the ANT script runs
> on a Linux box). I replaced ";" with ":" (the path separator) and the
> path my Eclipse installation on windows with the path to Eclipse on
> linux (/home/hudson/build_server/libs). I exchange "javaw.exe" with
> "java" and removed the encoding parameter (-Dfile.encoding=Cp1252).
>
> Now the classpath is slightly longer:
You really only need EMF's jars.
>
> java -classpath
> /home/hudson/build_server/output:/home/hudson/build_server/l
> ibs/plugins/org.eclipse.core.runtime_3.6.0.v20100505.jar:/ho
> me/hudson/build_server/libs/plugins/org.eclipse.osgi_3.6.1.R
> 36x_v20100806.jar:/home/hudson/build_server/libs/plugins/org
> .eclipse.equinox.common_3.6.0.v20100503.jar:/home/hudson/bui
> ld_server/libs/plugins/org.eclipse.core.jobs_3.5.1.R36x_v201
> 00824.jar:/home/hudson/build_server/libs/plugins/org.eclipse
> .core.runtime.compatibility.registry_3.3.0.v20100520\runtime
> _registry_compatibility.jar:/home/hudson/build_server/libs/p
> lugins/org.eclipse.equinox.registry_3.5.0.v20100503.jar:/hom
> e/hudson/build_server/libs/plugins/org.eclipse.equinox.prefe
> rences_3.3.0.v20100503.jar:/home/hudson/build_server/libs/pl
> ugins/org.eclipse.core.contenttype_3.4.100.v20100505-1235.ja
> r:/home/hudson/build_server/libs/plugins/org.eclipse.equinox
> .app_1.3.1.R36x_v20100803.jar:C:\Projects\Eclipse-Workspaces
> \EMFText-DEV\library\bin:/home/hudson/build_server/libs/plug
> ins/org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar:/home/hud
> son/build_server/libs/plugins/org.eclipse.emf.common_2.6.0.v
> 20100914-1218.jar:/home/hudson/build_server/libs/plugins/org
> .eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar:/home/hudson
> /build_server/libs/plugins/org.junit_4.8.1.v4_8_1_v20100427-
> 1100\junit.jar:/home/hudson/build_server/libs/plugins/org.ha
> mcrest.core_1.1.0.v20090501071000.jar:/home/hudson/build_ser
> ver/libs/plugins/org.eclipse.emf.codegen_2.6.0.v20100914-121
> 8.jar:/home/hudson/build_server/libs/plugins/org.eclipse.emf
> .codegen.ecore_2.6.1.v20100914-1218.jar emf.StandaloneEMFTest
> file://home/hudson/build_server/build/Ecore.genmodel
>
> Unfortunately, I do still face the exception. Maybe there is problem
> due to the forward slashes used on Linux?
Yes, don't use \ on Linux.
> What can I do to nail the problem further down?
Figuring out what EcorePlugin.INSTANCE.getBaseURL() returns is
important. Try a simple single class that prints out that value...
>
> Thanks for your help!
>
> Mirko
Re: MissingResourceException when using EMF in standalone mode [message #633313 is a reply to message #632964] Sat, 16 October 2010 08:42 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi Ed,

calling EcorePlugin.INSTANCE.getBaseURL()

yields the following exception:

Exception in thread "main" java.util.MissingResourceException: Missing properties: org/eclipse/emf/ecore/plugin/plugin.properties
at org.eclipse.emf.common.util.DelegatingResourceLocator.getBas eURL(DelegatingResourceLocator.java:206)
at emf.StandaloneEMFTest.main(StandaloneEMFTest.java:18)

I guess that's not bringing us closer to figure out what's wrong? What else can I do?

Best regards,

Mirko
Re: MissingResourceException when using EMF in standalone mode [message #633372 is a reply to message #633313] Sun, 17 October 2010 04:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Mirko,

Can you step through the method with the debugger?


Mirko Seifert wrote:
> Hi Ed,
>
> calling EcorePlugin.INSTANCE.getBaseURL()
>
> yields the following exception:
>
> Exception in thread "main" java.util.MissingResourceException: Missing
> properties: org/eclipse/emf/ecore/plugin/plugin.properties
> at
> org.eclipse.emf.common.util.DelegatingResourceLocator.getBas
> eURL(DelegatingResourceLocator.java:206)
> at emf.StandaloneEMFTest.main(StandaloneEMFTest.java:18)
>
> I guess that's not bringing us closer to figure out what's wrong? What
> else can I do?
>
> Best regards,
>
> Mirko
>
Re: MissingResourceException when using EMF in standalone mode [message #633622 is a reply to message #633372] Mon, 18 October 2010 14:53 Go to previous messageGo to next message
Mirko Seifert is currently offline Mirko SeifertFriend
Messages: 31
Registered: July 2009
Member
Hi Ed,

I started a remote debugging session and sadly I had to realise that there was a modified version of the EcorePlugin class in the classpath. I had created this earlier to figure out what was wrong. Unfortunatly, what was supposed to resolve the problem, caused the problem - since this modified class was not in the EMF jar, the properties file could not be found.

I removed my modified version of the EcorePlugin class and now everything works fine.

Thank you for your support and I apologize for any confusion I might have caused.

Best regards,

Mirko
Re: MissingResourceException when using EMF in standalone mode [message #633651 is a reply to message #633622] Mon, 18 October 2010 16:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Mirko,

Not only do we help address problems, we take confessions and grant
absolutions. :-P


Mirko Seifert wrote:
> Hi Ed,
>
> I started a remote debugging session and sadly I had to realise that
> there was a modified version of the EcorePlugin class in the
> classpath. I had created this earlier to figure out what was wrong.
> Unfortunatly, what was supposed to resolve the problem, caused the
> problem - since this modified class was not in the EMF jar, the
> properties file could not be found.
>
> I removed my modified version of the EcorePlugin class and now
> everything works fine.
>
> Thank you for your support and I apologize for any confusion I might
> have caused.
>
> Best regards,
>
> Mirko
>
Previous Topic:[EMF-OCL-Java] OCL Query on Ecore model from Java.
Next Topic:Re: Data type and configuring to existing DB
Goto Forum:
  


Current Time: Tue Oct 22 11:00:09 GMT 2019

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

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

Back to the top