Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resource factory problems
Resource factory problems [message #671688] Wed, 18 May 2011 17:07 Go to next message
Dan Becker is currently offline Dan BeckerFriend
Messages: 5
Registered: July 2009
Junior Member
Hello all,

I am having a bit of a problem with my first Xtext plugin. I have created an Xtext-based DSL based on a EMF model that is imported into the Xtext grammar. The new DSL editor works fine when I launch it in the Eclipse plugin test environment. However, when I package the plugins as a feature, publish the feature on our update site, and install the update on another machine, another Eclipse, I get the following stack trace and "Could not open the editor: Editor could not be initialized." when I attempt to open my blah.adsl model instance.

I assume this has something to do with available dependencies of the published plugins. Is there anyway to debug and figure out what my test environment has that my independent install environment lacks?

(Running on Helios SR2 EMP with EMT 1.3.2 and Xtext SDK 1.0.2)

Thanks, Dan


java.lang.IllegalStateException: The resource factory registered for platform:/resource/SPluginADSL/model/SApplication.adsl does not yield an XtextResource. Make sure the file name extension is correct (case matters).
at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:77)
at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResourceFor(ResourceForIEditorInputFactory.java:69)
at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:61)
at org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory.createResource(JavaClassPathResourceForIEditorInputFactory.java:37)
at org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:49)
at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.setDocumentContent(XtextDocumentProvider.java:102)
at org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument(StorageDocumentProvider.java:229)
at org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:735)
at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.createElementInfo(XtextDocumentProvider.java:131)
at org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:400)
at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)
at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)
...
Re: Resource factory problems [message #671698 is a reply to message #671688] Wed, 18 May 2011 17:10 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Sounds like another resource factory with the same file extension is
registered. Did you also generate and install EMF' editor code?
Please check your plugin.xml files there must be only one resource
factory per file extension.

Sven

Am 5/18/11 7:07 PM, schrieb Dan Becker:
> Hello all,
>
> I am having a bit of a problem with my first Xtext plugin. I have
> created an Xtext-based DSL based on a EMF model that is imported into
> the Xtext grammar. The new DSL editor works fine when I launch it in the
> Eclipse plugin test environment. However, when I package the plugins as
> a feature, publish the feature on our update site, and install the
> update on another machine, another Eclipse, I get the following stack
> trace and "Could not open the editor: Editor could not be initialized."
> when I attempt to open my blah.adsl model instance.
>
> I assume this has something to do with available dependencies of the
> published plugins. Is there anyway to debug and figure out what my test
> environment has that my independent install environment lacks?
>
> (Running on Helios SR2 EMP with EMT 1.3.2 and Xtext SDK 1.0.2)
>
> Thanks, Dan
>
>
> java.lang.IllegalStateException: The resource factory registered for
> platform:/resource/SPluginADSL/model/SApplication.adsl does not yield an
> XtextResource. Make sure the file name extension is correct (case matters).
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:77)
>
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResourceFor(ResourceForIEditorInputFactory.java:69)
>
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:61)
>
> at
> org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory.createResource(JavaClassPathResourceForIEditorInputFactory.java:37)
>
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:49)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.setDocumentContent(XtextDocumentProvider.java:102)
>
> at
> org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument(StorageDocumentProvider.java:229)
>
> at
> org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:735)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.createElementInfo(XtextDocumentProvider.java:131)
>
> at
> org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:400)
>
> at
> org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)
>
> at
> org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)
>
> ..


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Resource factory problems [message #671699 is a reply to message #671698] Wed, 18 May 2011 17:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Guys,<br>
<br>
Note that there will be logged messages in the Error Log about
conflicting extension registrations...<br>
<br>
<br>
Sven Efftinge wrote:
<blockquote cite="mid:ir0u2p$2tb$1@news.eclipse.org" type="cite">
<pre wrap="">Sounds like another resource factory with the same file extension is
registered. Did you also generate and install EMF' editor code?
Please check your plugin.xml files there must be only one resource
factory per file extension.

Sven

Am 5/18/11 7:07 PM, schrieb Dan Becker:
</pre>
<blockquote type="cite">
<pre wrap="">Hello all,

I am having a bit of a problem with my first Xtext plugin. I have
created an Xtext-based DSL based on a EMF model that is imported into
the Xtext grammar. The new DSL editor works fine when I launch it in the
Eclipse plugin test environment. However, when I package the plugins as
a feature, publish the feature on our update site, and install the
update on another machine, another Eclipse, I get the following stack
trace and "Could not open the editor: Editor could not be initialized."
when I attempt to open my blah.adsl model instance.

I assume this has something to do with available dependencies of the
published plugins. Is there anyway to debug and figure out what my test
environment has that my independent install environment lacks?

(Running on Helios SR2 EMP with EMT 1.3.2 and Xtext SDK 1.0.2)

Thanks, Dan


java.lang.IllegalStateException: The resource factory registered for
platform:/resource/SPluginADSL/model/SApplication.adsl does not yield an
XtextResource. Make sure the file name extension is correct (case matters).
at
org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:77)

at
org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResourceFor(ResourceForIEditorInputFactory.java:69)

at
org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:61)

at
org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory.createResource(JavaClassPathResourceForIEditorInputFactory.java:37)

at
org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:49)

at
org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.setDocumentContent(XtextDocumentProvider.java:102)

at
org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument(StorageDocumentProvider.java:229)

at
org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:735)

at
org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.createElementInfo(XtextDocumentProvider.java:131)

at
org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:400)

at
org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)

at
org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)

...
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Resource factory problems [message #671741 is a reply to message #671699] Wed, 18 May 2011 20:53 Go to previous message
Dan Becker is currently offline Dan BeckerFriend
Messages: 5
Registered: July 2009
Junior Member
That was definitely the problem. Thanks for the help.

By the way, can you tell me what the extensions should be in this kind of project where there are multiple Xtext and EMF plugins? The idea of this architecture was to have two languages ADSL and BDSL. The ADSL language would be a superset of the BDSL language, and ADSL would allow objects from BDSL in the grammar. Both language would import EMF models that are maintained separately.

Would this be the proper extension strategy?
1. 'com.company.project.dsl.bdsl.emf' registers a package for 'h_ttp://www.company.com/project/dsl/bdsl/BDSL'
2. 'com.company.project.dsl.adsl.emf' registers a package for 'h_ttp://www.company.com/project/dsl/adsl/ADSL'
3. 'com.company.project.dsl.bdsl.ui' registers an extension parser for 'bdsl'
4. 'com.company.project.dsl.adsl.ui' registers an extension parser for 'adsl'

(Replace h_ttp with http. This BB won't let me have links until I have more karma.)
Thanks, Dan
Re: Resource factory problems [message #671743 is a reply to message #671688] Wed, 18 May 2011 20:33 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Dan,

please make sure that the plugin.xml is listed in the build.properties
(you'll get a warning there if something's missing).

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

Am 18.05.11 19:07, schrieb Dan Becker:
> Hello all,
>
> I am having a bit of a problem with my first Xtext plugin. I have
> created an Xtext-based DSL based on a EMF model that is imported into
> the Xtext grammar. The new DSL editor works fine when I launch it in the
> Eclipse plugin test environment. However, when I package the plugins as
> a feature, publish the feature on our update site, and install the
> update on another machine, another Eclipse, I get the following stack
> trace and "Could not open the editor: Editor could not be initialized."
> when I attempt to open my blah.adsl model instance.
>
> I assume this has something to do with available dependencies of the
> published plugins. Is there anyway to debug and figure out what my test
> environment has that my independent install environment lacks?
>
> (Running on Helios SR2 EMP with EMT 1.3.2 and Xtext SDK 1.0.2)
>
> Thanks, Dan
>
>
> java.lang.IllegalStateException: The resource factory registered for
> platform:/resource/SPluginADSL/model/SApplication.adsl does not yield an
> XtextResource. Make sure the file name extension is correct (case matters).
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:77)
>
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResourceFor(ResourceForIEditorInputFactory.java:69)
>
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:61)
>
> at
> org.eclipse.xtext.ui.editor.model.JavaClassPathResourceForIEditorInputFactory.createResource(JavaClassPathResourceForIEditorInputFactory.java:37)
>
> at
> org.eclipse.xtext.ui.editor.model.ResourceForIEditorInputFactory.createResource(ResourceForIEditorInputFactory.java:49)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.setDocumentContent(XtextDocumentProvider.java:102)
>
> at
> org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument(StorageDocumentProvider.java:229)
>
> at
> org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:735)
>
> at
> org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.createElementInfo(XtextDocumentProvider.java:131)
>
> at
> org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:400)
>
> at
> org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)
>
> at
> org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)
>
> ..
Previous Topic:[Xtext 2] Missing error markers in package explorer
Next Topic:java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
Goto Forum:
  


Current Time: Fri Apr 19 22:31:13 GMT 2024

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

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

Back to the top