|Re: Problem with unresolved classpath proxy URIs after upgrading to 2.4.2 [message #1061568 is a reply to message #1061567]
||Mon, 03 June 2013 02:27
| Hallvard Traetteberg
Registered: July 2009
Location: Trondheim, Norway
On 02.06.13 18.56, Hallvard Trætteberg wrote:|
> I just upgraded to 2.4.2 and suddenly get the following exception when
> running my DSL's parser (from MWE2) and the initial rule tries to create
> the root object:
> java.lang.IllegalStateException: Unresolved proxy
> Make sure the EPackage
> has been registered.
> The package is registered in the mwe file with registerGeneratedEPackage
> = "org.ptolemy.ecore.xactor.XactorPackage"
> and I didn't change this when upgrading.
> I've never seen classpath URIs used for EPackages/EClasses before.
> org.ptolemy.ecore.xactor is the namespace URI for the xactor EPackage
> that contains the EntityFolder EClass, while /org/ptolemy/xtext/ is the
> package of the grammar, but not where the ecore file resides.
> I notice that the Xtext grammar has been serialized as a binary resource
> (with xtextbin extension), and the classpath URI is the (unresolved)
> proxy URI of the EntityFolder EClass when it is loaded. I've traced the
> serialization, and it looks like the EClass is serialized with
> org.ptolemy.ecore.xactor#//EntityFolder as the URI. I don't understand
> why this won't resolve when reading it in or end up with as a classpath
I did some more debugging and it seems the EPackage's URI
"org.ptolemy.ecore.xactor" is resolved with the resource's URI as the
base, since "org.ptolemy.ecore.xactor" is a relative URI. When the
following code in readURI in BinaryResourceImpl$EObjectInputStream is
called, value is "org.ptolemy.ecore.xactor" and uri is
"classpath:/org/ptolemy/xtext/org.ptolemy.ecore.xactor", which does not
resolve to an EPackage.
String value = readSegmentedString();
uri = resolve(URI.createURI(value));
Is this proper behavior?
It seems a fix (for me) could be to use a URI with a scheme, e.g.
Powered by FUDForum
. Page generated in 0.03226 seconds