Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351600 - Cannot load resource on a previously cleared ResourceSet
Summary: Cannot load resource on a previously cleared ResourceSet
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 13:11 EDT by Eike Stepper CLA
Modified: 2012-09-21 06:50 EDT (History)
1 user (show)

See Also:


Attachments
Patch v1 - for future reference (20.79 KB, patch)
2011-07-08 13:21 EDT, Eike Stepper CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2011-07-08 13:11:04 EDT
Cloned from: 338921: Cannot load resource on a previously cleared ResourceSet
https://bugs.eclipse.org/bugs/show_bug.cgi?id=338921

If you load a resource in a ResourceSet, clear that ResourceSet, and load the resource again, an exception is thrown:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.cdo.util.InvalidURIException: Invalid URI "cdo://repo1/foo/bar": java.lang.IllegalStateException: Different object was registered for OID3
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at org.eclipse.emf.cdo.tests.bugzilla.Bugzilla_9999999_Test.testResourceQuery(Bugzilla_9999999_Test.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at org.eclipse.net4j.util.tests.AbstractOMTest.runBare(AbstractOMTest.java:214)
	at org.eclipse.emf.cdo.tests.config.impl.ConfigTest.runBare(ConfigTest.java:480)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at org.eclipse.net4j.util.tests.AbstractOMTest.run(AbstractOMTest.java:260)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.eclipse.emf.cdo.util.InvalidURIException: Invalid URI "cdo://repo1/foo/bar": java.lang.IllegalStateException: Different object was registered for OID3
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.registerProxyResource(AbstractCDOView.java:1015)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.registerProxy(CDOResourceImpl.java:902)
	at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.load(CDOResourceImpl.java:825)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
	... 23 more
Caused by: java.lang.IllegalStateException: Different object was registered for OID3
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.registerObject(AbstractCDOView.java:1031)
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.registerProxyResource(AbstractCDOView.java:1006)
	... 27 more
Comment 1 Eike Stepper CLA 2011-07-08 13:21:27 EDT
Created attachment 199356 [details]
Patch v1 - for future reference
Comment 2 Eike Stepper CLA 2011-07-08 13:26:59 EDT
Committed revision 8637:
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo
- branches/4.0-maintenance/plugins/org.eclipse.emf.cdo.tests
Comment 3 Eike Stepper CLA 2011-07-08 13:27:15 EDT
Resolved
Comment 4 Eike Stepper CLA 2012-09-21 06:50:19 EDT
Closing.