|
|
Re: MissingResourceException when using EMF in standalone mode [message #632615 is a reply to message #632281] |
Wed, 13 October 2010 14:56 |
Mirko Seifert 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="StandaloneEMFTest.java"
cGFja2FnZSBlbWY7DQoNCmltcG9ydCBvcmcuZWNsaXBzZS5lbWYuY29kZWdl bi5lY29yZS5n
ZW5tb2RlbC5HZW5GZWF0dXJlOw0KaW1wb3J0IG9yZy5lY2xpcHNlLmVtZi5j b2RlZ2VuLmVj
b3JlLmdlbm1vZGVsLkdlbk1vZGVsUGFja2FnZTsNCmltcG9ydCBvcmcuZWNs aXBzZS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YWdlLlJl 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 |
Ed Merks Messages: 33217 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
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
|
|
Re: MissingResourceException when using EMF in standalone mode [message #633651 is a reply to message #633622] |
Mon, 18 October 2010 16:31 |
Ed Merks Messages: 33217 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
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04677 seconds