Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Save exception - UnknownServiceException
Save exception - UnknownServiceException [message #1067182] Sun, 07 July 2013 09:33 Go to next message
Vladimir D is currently offline Vladimir D
Messages: 13
Registered: January 2013
Junior Member
Hi all,

I have a problem, that I'm trying to solve for a while now. To get to this problem I need to explain some things. First of all I've developed my meta-model that references Ecore.ecore meta-model as i need some elements from it. To make a long story short, in my meta-model, I have developed some concepts that allow two EAttributes of different EClasses to be connected (e.g. one EAttribute gets its value from another, and this is represented by a link between them).

So I've created graphiti based editor, that allows you to specify any input meta-model from which you can take any EClass and put it in a diagram (I have a popup window that allows you to chose any EClass from input meta-model). When you choose an EClass it is automatically added as a pictogram element, and populated with its EAttributes and EReferences. When I do that I can save my diagram without any problems.

But, when i try to connect those two classes (in fact their attributes) i get the following message (full stack trace is in attached file):

Quote:
!ENTRY org.eclipse.graphiti.ui 4 0 2013-07-07 10:29:18.568
!MESSAGE The following resources could not be saved:
URI: platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore, cause:
java.net.UnknownServiceException: protocol doesn't support output


Here I should mention that in previous version of this tool, where I manually added EClasses (without popup window, I had all those concepts in toolbar and added them one by one), I had no such problems. All of this worked just fine.

Only thing, that I can think of now is that in my saved BO file, I have reference to data types in Ecore (as EAttributes may be of some type specified in Ecore.ecore) and that graphiti is trying to save that file?! In that BO file, all EClasses are not referenced but created inside my concepts(as they are contained in my concepts), and only those EDataType elements are referencing plugin with Ecore.ecore file, as they are referencing EString, EBoolean etc.

I would be very thankful for any pointers on how to solve this problem. If you need any more information I will gladly provide.

Vladimir
Re: Save exception - UnknownServiceException [message #1067189 is a reply to message #1067182] Sun, 07 July 2013 12:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26088
Registered: July 2009
Senior Member
Vladimir,

Looking at the stack trace and exception message, it's clear that one of
the resource's being saved is
platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore, i.e., and
that's definitely not something you should be modifying (although you'd
be modifying only your local in-memory version of it) and most certainly
not something you should be trying to save. I'm not sure of the details
along the stack trace, and I'm pretty sure EMF's URI converter would
treat this as a read only URI (in
org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.getAttributes(URI,
Map<?, ?>)) , so either something is not testing for read-only resources
and trying to save them anyway, or you're expected to specialize
org.eclipse.graphiti.ui.editor.DefaultPersistencyBehavior to add such a
test. In EMF's generated editors,
org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.isReadOnly(Resource)
is responsible for testing so you might start by setting a breakpoint
there; perhaps you only need to use
org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.setResourceToReadOnlyMap(Map<Resource,
Boolean>) during initialization...

On 07/07/2013 11:33 AM, Vladimir D wrote:
> Hi all,
>
> I have a problem, that I'm trying to solve for a while now. To get to this problem I need to explain some things. First of all I've developed my meta-model that references Ecore.ecore meta-model as i need some elements from it. To make a long story short, in my meta-model, I have developed some concepts that allow two EAttributes of different EClasses to be connected (e.g. one EAttribute gets its value from another, and this is represented by a link between them).
>
> So I've created graphiti based editor, that allows you to specify any input meta-model from which you can take any EClass and put it in a diagram (I have a popup window that allows you to chose any EClass from input meta-model). When you choose an EClass it is automatically added as a pictogram element, and populated with its EAttributes and EReferences. When I do that I can save my diagram without any problems.
>
> But, when i try to connect those two classes (in fact their attributes) i get the following message (full stack trace is in attached file):
>
> Quote:
>> !ENTRY org.eclipse.graphiti.ui 4 0 2013-07-07 10:29:18.568
>> !MESSAGE The following resources could not be saved:
>> URI: platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore, cause:
>> java.net.UnknownServiceException: protocol doesn't support output
>
> Here I should mention that in previous version of this tool, where I manually added EClasses (without popup window, I had all those concepts in toolbar and added them one by one), I had no such problems. All of this worked just fine.
>
> Only thing, that I can think of now is that in my saved BO file, I have reference to data types in Ecore (as EAttributes may be of some type specified in Ecore.ecore) and that graphiti is trying to save that file?! In that BO file, all EClasses are not referenced but created inside my concepts(as they are contained in my concepts), and only those EDataType elements are referencing plugin with Ecore.ecore file, as they are referencing EString, EBoolean etc.
>
> I would be very thankful for any pointers on how to solve this problem. If you need any more information I will gladly provide.
>
> Vladimir
Re: Save exception - UnknownServiceException [message #1067536 is a reply to message #1067189] Tue, 09 July 2013 09:08 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 596
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I've had a similar problem, where Graphiti tried to save resources
containing JvmType types that were created during Xtext/Xbase Jvm model
inference. I did not find a way of indicating to Graphiti that certain
resources should not be saved or that they were read only. There really
should be an overridable method that determines if a resource should be
saved, with default behavior to check the readOnlyMap.

Hallvard

On 07.07.13 14.12, Ed Merks wrote:
> Vladimir,
>
> Looking at the stack trace and exception message, it's clear that one of
> the resource's being saved is
> platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore, i.e., and
> that's definitely not something you should be modifying (although you'd
> be modifying only your local in-memory version of it) and most certainly
> not something you should be trying to save. I'm not sure of the details
> along the stack trace, and I'm pretty sure EMF's URI converter would
> treat this as a read only URI (in
> org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.getAttributes(URI,
> Map<?, ?>)) , so either something is not testing for read-only resources
> and trying to save them anyway, or you're expected to specialize
> org.eclipse.graphiti.ui.editor.DefaultPersistencyBehavior to add such a
> test. In EMF's generated editors,
> org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.isReadOnly(Resource)
> is responsible for testing so you might start by setting a breakpoint
> there; perhaps you only need to use
> org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.setResourceToReadOnlyMap(Map<Resource,
> Boolean>) during initialization...
>
> On 07/07/2013 11:33 AM, Vladimir D wrote:
>> Hi all,
>>
>> I have a problem, that I'm trying to solve for a while now. To get to
>> this problem I need to explain some things. First of all I've
>> developed my meta-model that references Ecore.ecore meta-model as i
>> need some elements from it. To make a long story short, in my
>> meta-model, I have developed some concepts that allow two EAttributes
>> of different EClasses to be connected (e.g. one EAttribute gets its
>> value from another, and this is represented by a link between them).
>>
>> So I've created graphiti based editor, that allows you to specify any
>> input meta-model from which you can take any EClass and put it in a
>> diagram (I have a popup window that allows you to chose any EClass
>> from input meta-model). When you choose an EClass it is automatically
>> added as a pictogram element, and populated with its EAttributes and
>> EReferences. When I do that I can save my diagram without any problems.
>>
>> But, when i try to connect those two classes (in fact their
>> attributes) i get the following message (full stack trace is in
>> attached file):
>>
>> Quote:
>>> !ENTRY org.eclipse.graphiti.ui 4 0 2013-07-07 10:29:18.568
>>> !MESSAGE The following resources could not be saved:
>>> URI: platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore, cause:
>>> java.net.UnknownServiceException: protocol doesn't support output
>>
>> Here I should mention that in previous version of this tool, where I
>> manually added EClasses (without popup window, I had all those
>> concepts in toolbar and added them one by one), I had no such
>> problems. All of this worked just fine.
>>
>> Only thing, that I can think of now is that in my saved BO file, I
>> have reference to data types in Ecore (as EAttributes may be of some
>> type specified in Ecore.ecore) and that graphiti is trying to save
>> that file?! In that BO file, all EClasses are not referenced but
>> created inside my concepts(as they are contained in my concepts), and
>> only those EDataType elements are referencing plugin with Ecore.ecore
>> file, as they are referencing EString, EBoolean etc.
>>
>> I would be very thankful for any pointers on how to solve this
>> problem. If you need any more information I will gladly provide.
>>
>> Vladimir
>
Re: Save exception - UnknownServiceException [message #1067804 is a reply to message #1067182] Wed, 10 July 2013 16:08 Go to previous messageGo to next message
Vladimir D is currently offline Vladimir D
Messages: 13
Registered: January 2013
Junior Member
Hi Ed, hi Hallvard

first of all, I like to thank you for your answers. In the end I decided that I don't need that interleaved model, so my problem was solved. But as Hallvard said, I didn't find any convenient method for correcting this problem. There should be a method that allows you to ignore some of the resources, while updating other.

Best regards,
Vladimir
Re: Save exception - UnknownServiceException [message #1067820 is a reply to message #1067804] Wed, 10 July 2013 17:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26088
Registered: July 2009
Senior Member
Vladimir,

Yes, or the framework should reuse what's already available. I.e., the
editing domain has support for such a check and the implementation of
org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.isReadOnly(Resource)
shows how EMF's URI converter supports checking if a resource's URI is
read-only. It sounds like someone should open a bugzilla enhancement
request, or maybe it's just a bug to attempt to save a resource that
can't be saved (and should never be modified).


On 10/07/2013 6:08 PM, Vladimir D wrote:
> Hi Ed, hi Hallvard
>
> first of all, I like to thank you for your answers. In the end I
> decided that I don't need that interleaved model, so my problem was
> solved. But as Hallvard said, I didn't find any convenient method for
> correcting this problem. There should be a method that allows you to
> ignore some of the resources, while updating other.
>
> Best regards,
> Vladimir
Re: Save exception - UnknownServiceException [message #1068130 is a reply to message #1067820] Fri, 12 July 2013 10:35 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=412838 for this.

Michael
Previous Topic:Issue with drop in Compartment Pattern
Next Topic:autoupdate
Goto Forum:
  


Current Time: Thu Oct 02 00:32:47 GMT 2014

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

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