Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Problem with returns EString and import Ecore for xtext file
Problem with returns EString and import Ecore for xtext file [message #554950] Tue, 24 August 2010 17:01 Go to next message
Eclipse UserFriend
I have the following in my xtext file:
ApiCall :
   'call' apiMethod=[ApiMethod|ApiMethodName];

 ApiMethod:
    name=ApiMethodName '{' }';

ApiMethodName returns ecore::EString:
    ID ('.' ID)*

This doesnt work without the following import:

import "http://www.eclipse.org/emf/2002/Ecore" as ecore

(as described here http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html# grammarImport)

However the generated .xmi file with that import cant be opened.. i get the following error:

org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'null' not found. (platform:/resource/nl.hyves.mobiledsl/src-gen/nl/hyves/mobiledsl/HyvesMobile.xmi, 158, 55)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2081)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2030)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:134)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1839)
org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'ves>
    </ru' is not found or is abstract. (platform:/resource/nl.hyves.mobiledsl/src-gen/nl/hyves/mobiledsl/HyvesMobile.xmi, 158, 55)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2243)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2367)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2098)


I only have this error after i updated xtext yesterday in eclipse.
I'm running eclipse Build id: 20100218-1602
and xtext Xtext Runtime 1.0.1.v201008100627


What is the problem here? How do i solve this?




Re: Problem with returns EString and import Ecore for xtext file [message #554998 is a reply to message #554950] Wed, 25 August 2010 02:45 Go to previous messageGo to next message
Eclipse UserFriend
Could you please provide the project, so we can check what's wrong?

Btw.: you could just remove the return type declaration, as
ecore::EString is the default for datatype rules. That would also allow
to remove the import of the EcorePackage.

But still it would be great if you could provide us your project.

Sven

Am 8/24/10 11:01 PM, schrieb Tjerk Wolterink:
> I have the following in my xtext file:
>
> ApiCall :
> 'call' apiMethod=[ApiMethod|ApiMethodName];
>
> ApiMethod:
> name=ApiMethodName '{' }';
>
> ApiMethodName returns ecore::EString:
> ID ('.' ID)*
>
> This doesnt work without the following import:
>
> import "http://www.eclipse.org/emf/2002/Ecore" as ecore
>
> (as described here
> http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html# grammarImport)
>
> However the generated .xmi file with that import cant be opened.. i get
> the following error:
>
>
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found.
> (platform:/resource/nl.hyves.mobiledsl/src-gen/nl/hyves/mobi ledsl/HyvesMobile.xmi,
> 158, 55)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:2081)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2030)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:134)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1839)
>
> org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'ves>
> </ru' is not found or is abstract.
> (platform:/resource/nl.hyves.mobiledsl/src-gen/nl/hyves/mobi ledsl/HyvesMobile.xmi,
> 158, 55)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2243)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2367)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:2098)
>
>
>
> I only have this error after i updated xtext yesterday in eclipse.
> I'm running eclipse Build id: 20100218-1602
> and xtext Xtext Runtime 1.0.1.v201008100627
>
>
> What is the problem here? How do i solve this?
>
>
>
>
>


--
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Problem with returns EString and import Ecore for xtext file [message #555007 is a reply to message #554998] Wed, 25 August 2010 03:27 Go to previous messageGo to next message
Eclipse UserFriend
Should i try to create a minimal project with this problem... or you want my complete project?
Re: Problem with returns EString and import Ecore for xtext file [message #555013 is a reply to message #555007] Wed, 25 August 2010 03:49 Go to previous messageGo to next message
Eclipse UserFriend
Am 8/25/10 9:27 AM, schrieb Tjerk Wolterink:
> Should i try to create a minimal project with this problem... or you
> want my complete project?

It should be reproducable and as small as possible ;-)

Sven


--
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Problem with returns EString and import Ecore for xtext file [message #555023 is a reply to message #554950] Wed, 25 August 2010 04:23 Go to previous messageGo to next message
Eclipse UserFriend
HI Tjerk,

it's most likey an Xml 1.1 / 1.0 problem. Please try to use the lastest
nightly of Xtext or edit the <MyDsl>.xmi manually and change the XML
version back to 1.0.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 24.08.10 23:01, schrieb Tjerk Wolterink:
> I have the following in my xtext file:
>
> ApiCall :
> 'call' apiMethod=[ApiMethod|ApiMethodName];
>
> ApiMethod:
> name=ApiMethodName '{' }';
>
> ApiMethodName returns ecore::EString:
> ID ('.' ID)*
>
> This doesnt work without the following import:
>
> import "http://www.eclipse.org/emf/2002/Ecore" as ecore
>
> (as described here
> http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html# grammarImport)
>
> However the generated .xmi file with that import cant be opened.. i get
> the following error:
>
>
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'null' not found.
> (platform:/resource/nl.hyves.mobiledsl/src-gen/nl/hyves/mobi ledsl/HyvesMobile.xmi,
> 158, 55)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:2081)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2030)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:134)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1839)
>
> org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'ves>
> </ru' is not found or is abstract.
> (platform:/resource/nl.hyves.mobiledsl/src-gen/nl/hyves/mobi ledsl/HyvesMobile.xmi,
> 158, 55)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2243)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2367)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:2098)
>
>
>
> I only have this error after i updated xtext yesterday in eclipse.
> I'm running eclipse Build id: 20100218-1602
> and xtext Xtext Runtime 1.0.1.v201008100627
>
>
> What is the problem here? How do i solve this?
>
>
>
>
>
Re: Problem with returns EString and import Ecore for xtext file [message #555037 is a reply to message #555023] Wed, 25 August 2010 05:19 Go to previous messageGo to next message
Eclipse UserFriend
YES! This solved it ... setting xml version to 1.0... Wow that was an easy fix.. but i would have never found it without your help.

So i heard there is a new version going to be released today?
Does this version contain the fix?
Re: Problem with returns EString and import Ecore for xtext file [message #555045 is a reply to message #555037] Wed, 25 August 2010 05:36 Go to previous message
Eclipse UserFriend
Am 8/25/10 11:19 AM, schrieb Tjerk Wolterink:
> YES! This solved it ... setting xml version to 1.0... Wow that was an
> easy fix.. but i would have never found it without your help.
>
> So i heard there is a new version going to be released today?
> Does this version contain the fix?

Yes it does.

--
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Previous Topic:Code completion using templates
Next Topic:Re: Validation produces Duplicate EModelElement without reason
Goto Forum:
  


Current Time: Sat Jul 12 18:08:31 EDT 2025

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

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

Back to the top