Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with unresolved classpath proxy URIs after upgrading to 2.4.2
Problem with unresolved classpath proxy URIs after upgrading to 2.4.2 [message #1061567] Sun, 02 June 2013 21:56 Go to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 582
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

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
classpath:/org/ptolemy/xtext/org.ptolemy.ecore.xactor#//EntityFolder.
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 URI.

Any suggestions?

Hallvard
Re: Problem with unresolved classpath proxy URIs after upgrading to 2.4.2 [message #1061568 is a reply to message #1061567] Sun, 02 June 2013 22:27 Go to previous message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 582
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 02.06.13 18.56, Hallvard Trætteberg wrote:
> Hi,
>
> 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
> classpath:/org/ptolemy/xtext/org.ptolemy.ecore.xactor#//EntityFolder.
> 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
> URI.

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.
http://org.ptolemy/org.ptolemy.ecore.xactor.

Hallvard
Previous Topic:implicit variable declaration in dsl editor with xbase
Next Topic:Disable lazyRessources
Goto Forum:
  


Current Time: Sat Apr 19 00:26:32 EDT 2014

Powered by FUDForum. Page generated in 0.71961 seconds