Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Issue with closing view
[CDO] Issue with closing view [message #1853064] Thu, 16 June 2022 08:56 Go to next message
Ewoud Werkman is currently offline Ewoud WerkmanFriend
Messages: 28
Registered: January 2018
Junior Member
Hi!

After I open a view, retrieve a resource and then close the view I get the following exception:
 [DEBUG] Problem while deactivating View 81 [closed]
 java.lang.IllegalArgumentException: The feature 'resourceSet' is not a valid feature
 	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEObjectImpl.java:1101)
 	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1054)
 	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1042)
 	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.getResourceSet(CDOResourceImpl.java:298)
 	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.basicSetResourceSet(CDOResourceImpl.java:1678)
 	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourcesEList.inverseRemove(ResourceSetImpl.java:604)
 	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.removeAll(NotifyingListImpl.java:950)
 	at org.eclipse.emf.internal.cdo.view.CDOViewSetImpl.remove(CDOViewSetImpl.java:234)
 	at org.eclipse.emf.internal.cdo.view.CDOViewImpl.doBeforeDeactivate(CDOViewImpl.java:1584)
 	at org.eclipse.net4j.util.lifecycle.Lifecycle.internalDeactivate(Lifecycle.java:123)
 	at org.eclipse.net4j.util.lifecycle.Lifecycle.deactivate(Lifecycle.java:184)
 	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:254)
 	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:244)
 	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.deactivate(LifecycleUtil.java:271)
 	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.close(AbstractCDOView.java:3006)

I close views also in other (unrelated) parts of the code, without any problem.
This particular code retrieves the History and iterates over the CommitInfos.

Even if I add
if (!cdoResource.cdoView().isClosed()) {
      cdoResource.cdoView().close();
}

it throws the exception.

What do I miss here?

Kind regards,
Ewoud
Re: [CDO] Issue with closing view [message #1853069 is a reply to message #1853064] Thu, 16 June 2022 15:12 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Ewoud Werkman wrote on Thu, 16 June 2022 10:56
Hi!

After I open a view, retrieve a resource and then close the view I get the following exception:
 [DEBUG] Problem while deactivating View 81 [closed]
 java.lang.IllegalArgumentException: The feature 'resourceSet' is not a valid feature
 	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenGet(BasicEObjectImpl.java:1101)
 	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1054)



Have a look at this method in BasicEObjectImpl:

  public Object eGet(EStructuralFeature eFeature, boolean resolve, boolean coreType)
  {
    int featureID = eDerivedStructuralFeatureID(eFeature);
    if (featureID >= 0)
    {
      return eGet(featureID, resolve, coreType);
    }
    else
    {
      return eOpenGet(eFeature, resolve);
    }
  }


I've run thousands of test cases but I did never hit a breakpoint on the call to BasicEObjectImpl.eOpenGet() and I have no idea why eDerivedStructuralFeatureID(eFeature) would return a value < 0 (probably -1). I fear you have to set a breakpoint there yourself and find it out. Or provide me with an executable test case that reproduces the problem.




Previous Topic:BPMN model with multiple diagrams
Next Topic:[CDO] conflict merge
Goto Forum:
  


Current Time: Thu May 02 07:59:57 GMT 2024

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

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

Back to the top