Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] loading resources and package registration.
[CDO] loading resources and package registration. [message #1227430] Sat, 04 January 2014 13:22 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi (Eike),

In my effort to make Edapt support CDO model evolution, I need so help
understanding CDO and EPackages.

In the test case I work on I have this scenario:

Repo1 (source)

- Native packages
- Many resources conforming to native packages.

Repo2 (target)
- Empty


When I read a resource from Repo1 and I get an exception when calling
EcoreUtil.resolveAll(resource)

This is a Junit testcase, so the platform is not running and the native
EPackages are not registered by the platform. (The generated EMF code
for these packages is not present/available in the test case).

Now I gather that the EPackage should be registered, so I make sure the
EPackages are registered by the CDOViewProvider when unknown in the code
below. (Note: The EPackages are created from the .ecore file and added
to the resource set). However the CDO packageRegistry will report the
nsURI is already a known key, so adding is not allowed.


Thank You!
Christophe
----------


Exception:


Registry packageRegistry = resourceSet.getPackageRegistry();
if (!packageRegistry.isEmpty()) {
CDOPackageRegistry cdoPackageRegistry = session
..getPackageRegistry();
for (String nsURI : packageRegistry.keySet()) {
EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
if(!cdoPackageRegistry.containsKey(nsURI)){
cdoPackageRegistry.putEPackage(packageToAdd);
}
}
}


So now I am slightly confused, why will I get the exception below, while
the CDO Package registry reports it knows the nsURI?

Is it possible to work with resources with native packages
in a CDO repo, while the generated EPackage code is not available?

what does type=UNKNOWN mean?


Also, I tried this option:

session.options().setGeneratedPackageEmulationEnabled(true);

With this the Exception is gone, but later on I get a commit exception,
NPE on a missing EPackage. (I will report this Exception if needed later
on).


org.eclipse.emf.cdo.common.util.CDOException: Generated packages locally
not available:
CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
15:47:22.133]
at
org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
at
org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
at
org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
at
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
at
org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
at
org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
at
org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
at
org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
at
org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
at
org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
at
org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
at
org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
at
org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
at
org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
at
org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
at
org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
at
org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
at
org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
at
org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
at
org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
at
org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
at
org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
at
org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
at
org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
at
org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
at
org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
at
org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
at
org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
at
org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
at org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
at
org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
at
org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
at
org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
at
org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
at
org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
at
org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
at
org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
at
org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at
org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
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)
Re: [CDO] loading resources and package registration. [message #1227482 is a reply to message #1227430] Sat, 04 January 2014 17:19 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Christophe,

If the original type of a model is NATIVE then either the current type must also be NATIVE or you must set
session.options().setGeneratedPackageEmulationEnabled(true).

The rest of your post was a little vague so I'm unsure what else to say.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 04.01.2014 14:22, schrieb Christophe Bouhier:
> Hi (Eike),
>
> In my effort to make Edapt support CDO model evolution, I need so help understanding CDO and EPackages.
>
> In the test case I work on I have this scenario:
>
> Repo1 (source)
>
> - Native packages
> - Many resources conforming to native packages.
>
> Repo2 (target)
> - Empty
>
>
> When I read a resource from Repo1 and I get an exception when calling EcoreUtil.resolveAll(resource)
>
> This is a Junit testcase, so the platform is not running and the native EPackages are not registered by the platform.
> (The generated EMF code for these packages is not present/available in the test case).
>
> Now I gather that the EPackage should be registered, so I make sure the EPackages are registered by the
> CDOViewProvider when unknown in the code below. (Note: The EPackages are created from the .ecore file and added to the
> resource set). However the CDO packageRegistry will report the nsURI is already a known key, so adding is not allowed.
>
>
> Thank You!
> Christophe
> ----------
>
>
> Exception:
>
>
> Registry packageRegistry = resourceSet.getPackageRegistry();
> if (!packageRegistry.isEmpty()) {
> CDOPackageRegistry cdoPackageRegistry = session
> .getPackageRegistry();
> for (String nsURI : packageRegistry.keySet()) {
> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
> if(!cdoPackageRegistry.containsKey(nsURI)){
> cdoPackageRegistry.putEPackage(packageToAdd);
> }
> }
> }
>
>
> So now I am slightly confused, why will I get the exception below, while the CDO Package registry reports it knows the
> nsURI?
>
> Is it possible to work with resources with native packages
> in a CDO repo, while the generated EPackage code is not available?
>
> what does type=UNKNOWN mean?
>
>
> Also, I tried this option:
>
> session.options().setGeneratedPackageEmulationEnabled(true);
>
> With this the Exception is gone, but later on I get a commit exception, NPE on a missing EPackage. (I will report this
> Exception if needed later on).
>
>
> org.eclipse.emf.cdo.common.util.CDOException: Generated packages locally not available:
> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics, state=PROXY, type=UNKNOWN, originalType=NATIVE,
> timeStamp=2012-04-19 15:47:22.133]
> at org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
> at org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
> at org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
> at org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
> at org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
> at org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
> at org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
> at org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
> at org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
> at org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
> at org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
> at org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
> at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
> at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
> at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
> at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
> at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
> at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
> at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
> at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
> at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
> at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
> at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
> at org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
> at org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
> at org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
> at org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
> at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
> at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
> at org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
> at org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
> at org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
> at org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
> at
> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
> at
> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
> at
> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
> at
> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
> at
> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
> at
> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
> at org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
> at org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
> at org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
> at org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at junit.framework.TestCase.runTest(TestCase.java:176)
> at junit.framework.TestCase.runBare(TestCase.java:141)
> at junit.framework.TestResult$1.protect(TestResult.java:122)
> at junit.framework.TestResult.runProtected(TestResult.java:142)
> at junit.framework.TestResult.run(TestResult.java:125)
> at junit.framework.TestCase.run(TestCase.java:129)
> at junit.framework.TestSuite.runTest(TestSuite.java:255)
> at junit.framework.TestSuite.run(TestSuite.java:250)
> at org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
> at junit.framework.TestSuite.runTest(TestSuite.java:255)
> at junit.framework.TestSuite.run(TestSuite.java:250)
> at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
> 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)
>


Re: [CDO] loading resources and package registration. [message #1227530 is a reply to message #1227482] Sat, 04 January 2014 20:20 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 04-01-14 18:19, Eike Stepper wrote:
> Hi Christophe,
>
> If the original type of a model is NATIVE then either the current type
> must also be NATIVE or you must set
> session.options().setGeneratedPackageEmulationEnabled(true).
>

Sorry about being vague,

How do I interpret 'original' and 'current'? Is this in relation to the
Session which 'was' and 'is' used?

My question boils down to this, I want to work with a repo which has
NATIVE packages, but.... I don't have the NATIVE package. (assume, I
don't have the .genmodel which was migrated to CDO and used to generated
native CDO code). So I can't do MYPACKAGE.eInstance to retrieve it, add
it to GlobalRepo or put in the CDO package registry. So which options do
I have? (besides setGeneratedPackageEmulationEnabled(true))



> The rest of your post was a little vague so I'm unsure what else to say.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>> Hi (Eike),
>>
>> In my effort to make Edapt support CDO model evolution, I need so help
>> understanding CDO and EPackages.
>>
>> In the test case I work on I have this scenario:
>>
>> Repo1 (source)
>>
>> - Native packages
>> - Many resources conforming to native packages.
>>
>> Repo2 (target)
>> - Empty
>>
>>
>> When I read a resource from Repo1 and I get an exception when calling
>> EcoreUtil.resolveAll(resource)
>>
>> This is a Junit testcase, so the platform is not running and the
>> native EPackages are not registered by the platform. (The generated
>> EMF code for these packages is not present/available in the test case).
>>
>> Now I gather that the EPackage should be registered, so I make sure
>> the EPackages are registered by the CDOViewProvider when unknown in
>> the code below. (Note: The EPackages are created from the .ecore file
>> and added to the resource set). However the CDO packageRegistry will
>> report the nsURI is already a known key, so adding is not allowed.
>>
>>
>> Thank You!
>> Christophe
>> ----------
>>
>>
>> Exception:
>>
>>
>> Registry packageRegistry = resourceSet.getPackageRegistry();
>> if (!packageRegistry.isEmpty()) {
>> CDOPackageRegistry cdoPackageRegistry = session
>> .getPackageRegistry();
>> for (String nsURI : packageRegistry.keySet()) {
>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>> if(!cdoPackageRegistry.containsKey(nsURI)){
>> cdoPackageRegistry.putEPackage(packageToAdd);
>> }
>> }
>> }
>>
>>
>> So now I am slightly confused, why will I get the exception below,
>> while the CDO Package registry reports it knows the nsURI?
>>
>> Is it possible to work with resources with native packages
>> in a CDO repo, while the generated EPackage code is not available?
>>
>> what does type=UNKNOWN mean?
>>
>>
>> Also, I tried this option:
>>
>> session.options().setGeneratedPackageEmulationEnabled(true);
>>
>> With this the Exception is gone, but later on I get a commit
>> exception, NPE on a missing EPackage. (I will report this Exception if
>> needed later on).
>>
>>
>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>> locally not available:
>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>> state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
>> 15:47:22.133]
>> at
>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>
>> at
>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>
>> at
>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>
>> at
>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>
>> at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>> at
>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>
>> at
>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>
>> at
>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>> at
>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>
>> at
>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>> at
>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>
>> at
>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>
>> at
>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>> at
>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>
>> at
>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>
>> at
>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>
>> at
>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>
>> at
>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>
>> at
>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>
>> at
>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>
>> at
>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at junit.framework.TestCase.runTest(TestCase.java:176)
>> at junit.framework.TestCase.runBare(TestCase.java:141)
>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>> at junit.framework.TestResult.run(TestResult.java:125)
>> at junit.framework.TestCase.run(TestCase.java:129)
>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>> at junit.framework.TestSuite.run(TestSuite.java:250)
>> at
>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>
>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>> at junit.framework.TestSuite.run(TestSuite.java:250)
>> at
>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>
>> 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)
>>
>>
>
Re: [CDO] loading resources and package registration. [message #1227679 is a reply to message #1227530] Sun, 05 January 2014 07:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 04.01.2014 21:20, schrieb Christophe Bouhier:
> On 04-01-14 18:19, Eike Stepper wrote:
>> Hi Christophe,
>>
>> If the original type of a model is NATIVE then either the current type
>> must also be NATIVE or you must set
>> session.options().setGeneratedPackageEmulationEnabled(true).
>>
>
> Sorry about being vague,
>
> How do I interpret 'original' and 'current'?
Sorry, I should have been clearer. The "original type" of a model is the type it had in the client that committed this
model originally (and at the time of that commit). The (current) type of a model is the type that's currently valid in a
client. The type can change when generated packages come and go.


> Is this in relation to the Session which 'was' and 'is' used?
>
> My question boils down to this, I want to work with a repo which has NATIVE packages, but.... I don't have the NATIVE
> package. (assume, I don't have the .genmodel which was migrated to CDO and used to generated native CDO code). So I
> can't do MYPACKAGE.eInstance to retrieve it, add it to GlobalRepo or put in the CDO package registry. So which options
> do I have? (besides setGeneratedPackageEmulationEnabled(true))
Why besides? I think that setGeneratedPackageEmulationEnabled(true) is the way to go. The general behaviour is the
following:

When a CDOSession is opened the server sends a list of all registered nsURIs, or more exactly a list of CDOPackageInfos,
which are then put as EPackage.Registry.Descriptors into the session's package registry. When their EPackages are needed
they're are resolved. That means that first an attempt is made to "load" them from the global package registry. If that
fails and GeneratedPackageEmulationEnabled==true the XMI of that package is loaded from the server and used to emulate
the originally generated package.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
>
>
>> The rest of your post was a little vague so I'm unsure what else to say.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>>> Hi (Eike),
>>>
>>> In my effort to make Edapt support CDO model evolution, I need so help
>>> understanding CDO and EPackages.
>>>
>>> In the test case I work on I have this scenario:
>>>
>>> Repo1 (source)
>>>
>>> - Native packages
>>> - Many resources conforming to native packages.
>>>
>>> Repo2 (target)
>>> - Empty
>>>
>>>
>>> When I read a resource from Repo1 and I get an exception when calling
>>> EcoreUtil.resolveAll(resource)
>>>
>>> This is a Junit testcase, so the platform is not running and the
>>> native EPackages are not registered by the platform. (The generated
>>> EMF code for these packages is not present/available in the test case).
>>>
>>> Now I gather that the EPackage should be registered, so I make sure
>>> the EPackages are registered by the CDOViewProvider when unknown in
>>> the code below. (Note: The EPackages are created from the .ecore file
>>> and added to the resource set). However the CDO packageRegistry will
>>> report the nsURI is already a known key, so adding is not allowed.
>>>
>>>
>>> Thank You!
>>> Christophe
>>> ----------
>>>
>>>
>>> Exception:
>>>
>>>
>>> Registry packageRegistry = resourceSet.getPackageRegistry();
>>> if (!packageRegistry.isEmpty()) {
>>> CDOPackageRegistry cdoPackageRegistry = session
>>> .getPackageRegistry();
>>> for (String nsURI : packageRegistry.keySet()) {
>>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>>> if(!cdoPackageRegistry.containsKey(nsURI)){
>>> cdoPackageRegistry.putEPackage(packageToAdd);
>>> }
>>> }
>>> }
>>>
>>>
>>> So now I am slightly confused, why will I get the exception below,
>>> while the CDO Package registry reports it knows the nsURI?
>>>
>>> Is it possible to work with resources with native packages
>>> in a CDO repo, while the generated EPackage code is not available?
>>>
>>> what does type=UNKNOWN mean?
>>>
>>>
>>> Also, I tried this option:
>>>
>>> session.options().setGeneratedPackageEmulationEnabled(true);
>>>
>>> With this the Exception is gone, but later on I get a commit
>>> exception, NPE on a missing EPackage. (I will report this Exception if
>>> needed later on).
>>>
>>>
>>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>>> locally not available:
>>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>>> state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
>>> 15:47:22.133]
>>> at
>>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>>
>>> at
>>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>>
>>> at
>>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>>
>>> at
>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>>
>>> at
>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>>
>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>> at
>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>>
>>> at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>> at
>>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>>
>>> at
>>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>>
>>> at
>>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>>> at
>>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>>
>>> at
>>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>>> at
>>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>>
>>> at
>>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>>> at
>>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>>
>>> at
>>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>>
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>>
>>> at
>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>>
>>> at
>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>>
>>> at
>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>>
>>> at
>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>> at junit.framework.TestResult.run(TestResult.java:125)
>>> at junit.framework.TestCase.run(TestCase.java:129)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>> at
>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>
>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>> at
>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>
>>> 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)
>>>
>>>
>>
>


Re: [CDO] loading resources and package registration. [message #1227851 is a reply to message #1227679] Sun, 05 January 2014 20:29 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 05-01-14 08:55, Eike Stepper wrote:
> Am 04.01.2014 21:20, schrieb Christophe Bouhier:
>> On 04-01-14 18:19, Eike Stepper wrote:
>>> Hi Christophe,
>>>
>>> If the original type of a model is NATIVE then either the current type
>>> must also be NATIVE or you must set
>>> session.options().setGeneratedPackageEmulationEnabled(true).
>>>
>>
>> Sorry about being vague,
>>
>> How do I interpret 'original' and 'current'?
> Sorry, I should have been clearer. The "original type" of a model is the
> type it had in the client that committed this model originally (and at
> the time of that commit). The (current) type of a model is the type
> that's currently valid in a client. The type can change when generated
> packages come and go.
>
>
>> Is this in relation to the Session which 'was' and 'is' used?
>>
>> My question boils down to this, I want to work with a repo which has
>> NATIVE packages, but.... I don't have the NATIVE package. (assume, I
>> don't have the .genmodel which was migrated to CDO and used to
>> generated native CDO code). So I can't do MYPACKAGE.eInstance to
>> retrieve it, add it to GlobalRepo or put in the CDO package registry.
>> So which options do I have? (besides
>> setGeneratedPackageEmulationEnabled(true))
> Why besides? I think that setGeneratedPackageEmulationEnabled(true) is
> the way to go. The general behaviour is the following:

Ok, when I turn it on it all resolves, so it seems to work.

I get another Exception when commiting the resource to the target repo.
though. I am not sure this exception is related. It seems the ePackage
is not set in a Package unit. I did call:

session.getPackageRegistry().putEPackage(packageToAdd);

....before trying to commit the resource.

From the server trace (further down below) , I see it tries to register
the evolved EPackage as a Dynamic package.. but failing with the
exception.

To summarize:


Edapt <-- Source repo with Native Packages, read Resource A.
|
| (EPackage and model transformation).
|
V
Edapt --> Target repo with Dynamic evolved EPackage write resource A.
(Evolved EPackages are registered on the target repo).


org.eclipse.net4j.util.transaction.TransactionException:
org.eclipse.emf.cdo.util.CommitException:
org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
at
org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1222)
at
org.eclipse.emf.edapt.common.ResourceUtils.saveResourceSet(ResourceUtils.java:202)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.saveModel(CDOPersistency.java:52)
at
org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:276)
at
org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
at
org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at
org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
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.CommitException:
org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1237)
at
org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1184)
at
org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1218)
... 27 more
Caused by: org.eclipse.net4j.signal.RemoteException:
java.lang.NullPointerException
at
org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:141)
at
org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:130)
at
org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:465)
at
org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:66)
at org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
at org.eclipse.net4j.signal.Indication.execute(Indication.java:51)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at
org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
... 5 more



Server trace:



net4j-Thread-32 [debug.buffer] Retaining Buffer@51[RELEASED]
net4j-Thread-32 [debug.buffer] Retaining Buffer@52[RELEASED]
net4j-Thread-32 [debug.buffer] Retaining Buffer@53[RELEASED]
net4j-Thread-32 [debug.buffer] Retaining Buffer@54[RELEASED]
net4j-Thread-32 [debug] Read
CDOPackageInfo[packageURI=http://www.netxforge.com/16042013/generics,
parentURI=null]
net4j-Thread-32 [debug] Read
CDOPackageUnit[id=http://www.netxforge.com/16042013/generics,
state=LOADED, type=DYNAMIC, originalType=DYNAMIC, timeStamp=*]
[ERROR] NullPointerException
java.lang.NullPointerException
at
org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
at
org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
at
org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
at org.eclipse.net4j.signal.Signal.run(Signal.java:



>
> When a CDOSession is opened the server sends a list of all registered
> nsURIs, or more exactly a list of CDOPackageInfos, which are then put as
> EPackage.Registry.Descriptors into the session's package registry. When
> their EPackages are needed they're are resolved. That means that first
> an attempt is made to "load" them from the global package registry. If
> that fails and GeneratedPackageEmulationEnabled==true the XMI of that
> package is loaded from the server and used to emulate the originally
> generated package.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>>
>>
>>> The rest of your post was a little vague so I'm unsure what else to say.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>>>> Hi (Eike),
>>>>
>>>> In my effort to make Edapt support CDO model evolution, I need so help
>>>> understanding CDO and EPackages.
>>>>
>>>> In the test case I work on I have this scenario:
>>>>
>>>> Repo1 (source)
>>>>
>>>> - Native packages
>>>> - Many resources conforming to native packages.
>>>>
>>>> Repo2 (target)
>>>> - Empty
>>>>
>>>>
>>>> When I read a resource from Repo1 and I get an exception when calling
>>>> EcoreUtil.resolveAll(resource)
>>>>
>>>> This is a Junit testcase, so the platform is not running and the
>>>> native EPackages are not registered by the platform. (The generated
>>>> EMF code for these packages is not present/available in the test case).
>>>>
>>>> Now I gather that the EPackage should be registered, so I make sure
>>>> the EPackages are registered by the CDOViewProvider when unknown in
>>>> the code below. (Note: The EPackages are created from the .ecore file
>>>> and added to the resource set). However the CDO packageRegistry will
>>>> report the nsURI is already a known key, so adding is not allowed.
>>>>
>>>>
>>>> Thank You!
>>>> Christophe
>>>> ----------
>>>>
>>>>
>>>> Exception:
>>>>
>>>>
>>>> Registry packageRegistry = resourceSet.getPackageRegistry();
>>>> if (!packageRegistry.isEmpty()) {
>>>> CDOPackageRegistry cdoPackageRegistry = session
>>>> .getPackageRegistry();
>>>> for (String nsURI : packageRegistry.keySet()) {
>>>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>>>> if(!cdoPackageRegistry.containsKey(nsURI)){
>>>> cdoPackageRegistry.putEPackage(packageToAdd);
>>>> }
>>>> }
>>>> }
>>>>
>>>>
>>>> So now I am slightly confused, why will I get the exception below,
>>>> while the CDO Package registry reports it knows the nsURI?
>>>>
>>>> Is it possible to work with resources with native packages
>>>> in a CDO repo, while the generated EPackage code is not available?
>>>>
>>>> what does type=UNKNOWN mean?
>>>>
>>>>
>>>> Also, I tried this option:
>>>>
>>>> session.options().setGeneratedPackageEmulationEnabled(true);
>>>>
>>>> With this the Exception is gone, but later on I get a commit
>>>> exception, NPE on a missing EPackage. (I will report this Exception if
>>>> needed later on).
>>>>
>>>>
>>>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>>>> locally not available:
>>>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>>>> state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
>>>> 15:47:22.133]
>>>> at
>>>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>> at
>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>> at
>>>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>>>>
>>>> at
>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>>>> at
>>>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>>
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>> at junit.framework.TestResult.run(TestResult.java:125)
>>>> at junit.framework.TestCase.run(TestCase.java:129)
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>> at
>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>>
>>>>
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>> at
>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>>
>>>>
>>>> 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)
>>>>
>>>>
>>>>
>>>
>>
>
Re: [CDO] loading resources and package registration. [message #1228035 is a reply to message #1227851] Mon, 06 January 2014 08:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 05.01.2014 21:29, schrieb Christophe Bouhier:
> Ok, when I turn it on it all resolves, so it seems to work.
>
> I get another Exception when commiting the resource to the target repo. though. I am not sure this exception is
> related. It seems the ePackage is not set in a Package unit. I did call:
>
> session.getPackageRegistry().putEPackage(packageToAdd);
What type does this packageToAdd have and where does it come from?

> ...before trying to commit the resource.
>
> From the server trace (further down below) , I see it tries to register the evolved EPackage as a Dynamic package..
> but failing with the exception.
>
> To summarize:
>
>
> Edapt <-- Source repo with Native Packages, read Resource A.
> |
> | (EPackage and model transformation).
> |
> V
> Edapt --> Target repo with Dynamic evolved EPackage write resource A.
> (Evolved EPackages are registered on the target repo).
I would try to read the old model with dynamic (also NATIVE!) packages and write to the target repo with the generated
evolved packages. Can you try that?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



>
>
> org.eclipse.net4j.util.transaction.TransactionException: org.eclipse.emf.cdo.util.CommitException:
> org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
> at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1222)
> at org.eclipse.emf.edapt.common.ResourceUtils.saveResourceSet(ResourceUtils.java:202)
> at org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.saveModel(CDOPersistency.java:52)
> at org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:276)
> at org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
> at org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at junit.framework.TestCase.runTest(TestCase.java:176)
> at junit.framework.TestCase.runBare(TestCase.java:141)
> at junit.framework.TestResult$1.protect(TestResult.java:122)
> at junit.framework.TestResult.runProtected(TestResult.java:142)
> at junit.framework.TestResult.run(TestResult.java:125)
> at junit.framework.TestCase.run(TestCase.java:129)
> at junit.framework.TestSuite.runTest(TestSuite.java:255)
> at junit.framework.TestSuite.run(TestSuite.java:250)
> at org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
> at junit.framework.TestSuite.runTest(TestSuite.java:255)
> at junit.framework.TestSuite.run(TestSuite.java:250)
> at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
> 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.CommitException: org.eclipse.net4j.signal.RemoteException:
> java.lang.NullPointerException
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1237)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1184)
> at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1218)
> ... 27 more
> Caused by: org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
> at org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:141)
> at org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:130)
> at org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:465)
> at org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:66)
> at org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
> at org.eclipse.net4j.signal.Indication.execute(Indication.java:51)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
> ... 5 more
>
>
>
> Server trace:
>
>
>
> net4j-Thread-32 [debug.buffer] Retaining Buffer@51[RELEASED]
> net4j-Thread-32 [debug.buffer] Retaining Buffer@52[RELEASED]
> net4j-Thread-32 [debug.buffer] Retaining Buffer@53[RELEASED]
> net4j-Thread-32 [debug.buffer] Retaining Buffer@54[RELEASED]
> net4j-Thread-32 [debug] Read CDOPackageInfo[packageURI=http://www.netxforge.com/16042013/generics, parentURI=null]
> net4j-Thread-32 [debug] Read CDOPackageUnit[id=http://www.netxforge.com/16042013/generics, state=LOADED, type=DYNAMIC,
> originalType=DYNAMIC, timeStamp=*]
> [ERROR] NullPointerException
> java.lang.NullPointerException
> at
> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:
>
>
>
>>
>> When a CDOSession is opened the server sends a list of all registered
>> nsURIs, or more exactly a list of CDOPackageInfos, which are then put as
>> EPackage.Registry.Descriptors into the session's package registry. When
>> their EPackages are needed they're are resolved. That means that first
>> an attempt is made to "load" them from the global package registry. If
>> that fails and GeneratedPackageEmulationEnabled==true the XMI of that
>> package is loaded from the server and used to emulate the originally
>> generated package.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>>
>>>
>>>> The rest of your post was a little vague so I'm unsure what else to say.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>>>>> Hi (Eike),
>>>>>
>>>>> In my effort to make Edapt support CDO model evolution, I need so help
>>>>> understanding CDO and EPackages.
>>>>>
>>>>> In the test case I work on I have this scenario:
>>>>>
>>>>> Repo1 (source)
>>>>>
>>>>> - Native packages
>>>>> - Many resources conforming to native packages.
>>>>>
>>>>> Repo2 (target)
>>>>> - Empty
>>>>>
>>>>>
>>>>> When I read a resource from Repo1 and I get an exception when calling
>>>>> EcoreUtil.resolveAll(resource)
>>>>>
>>>>> This is a Junit testcase, so the platform is not running and the
>>>>> native EPackages are not registered by the platform. (The generated
>>>>> EMF code for these packages is not present/available in the test case).
>>>>>
>>>>> Now I gather that the EPackage should be registered, so I make sure
>>>>> the EPackages are registered by the CDOViewProvider when unknown in
>>>>> the code below. (Note: The EPackages are created from the .ecore file
>>>>> and added to the resource set). However the CDO packageRegistry will
>>>>> report the nsURI is already a known key, so adding is not allowed.
>>>>>
>>>>>
>>>>> Thank You!
>>>>> Christophe
>>>>> ----------
>>>>>
>>>>>
>>>>> Exception:
>>>>>
>>>>>
>>>>> Registry packageRegistry = resourceSet.getPackageRegistry();
>>>>> if (!packageRegistry.isEmpty()) {
>>>>> CDOPackageRegistry cdoPackageRegistry = session
>>>>> .getPackageRegistry();
>>>>> for (String nsURI : packageRegistry.keySet()) {
>>>>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>>>>> if(!cdoPackageRegistry.containsKey(nsURI)){
>>>>> cdoPackageRegistry.putEPackage(packageToAdd);
>>>>> }
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>> So now I am slightly confused, why will I get the exception below,
>>>>> while the CDO Package registry reports it knows the nsURI?
>>>>>
>>>>> Is it possible to work with resources with native packages
>>>>> in a CDO repo, while the generated EPackage code is not available?
>>>>>
>>>>> what does type=UNKNOWN mean?
>>>>>
>>>>>
>>>>> Also, I tried this option:
>>>>>
>>>>> session.options().setGeneratedPackageEmulationEnabled(true);
>>>>>
>>>>> With this the Exception is gone, but later on I get a commit
>>>>> exception, NPE on a missing EPackage. (I will report this Exception if
>>>>> needed later on).
>>>>>
>>>>>
>>>>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>>>>> locally not available:
>>>>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>>>>> state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
>>>>> 15:47:22.133]
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>>>>
>>>>>
>>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>>> at
>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>>> at
>>>>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>>>>> at
>>>>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>>>>
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>>>
>>>>>
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>
>>>>>
>>>>> at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>
>>>>>
>>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>>> at junit.framework.TestResult.run(TestResult.java:125)
>>>>> at junit.framework.TestCase.run(TestCase.java:129)
>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>> at
>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>>>
>>>>>
>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>> at
>>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>>>
>>>>>
>>>>> 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)
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [CDO] loading resources and package registration. [message #1228093 is a reply to message #1228035] Mon, 06 January 2014 11:48 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Eike,

See inline response below.

Cheers Christophe

ps. As discussed earlier, the scenario I am testing is only one of the
two envisaged 'solutions'. Scenario 2 is apply a History on the DBStore
directly. I would like to discuss scenario 2as well. Perhaps not in the
forum...



On 06-01-14 09:54, Eike Stepper wrote:
> Am 05.01.2014 21:29, schrieb Christophe Bouhier:
>> Ok, when I turn it on it all resolves, so it seems to work.
>>
>> I get another Exception when commiting the resource to the target
>> repo. though. I am not sure this exception is related. It seems the
>> ePackage is not set in a Package unit. I did call:
>>
>> session.getPackageRegistry().putEPackage(packageToAdd);
> What type does this packageToAdd have and where does it come from?
>
Ok, this package is the evolved EPackage. It is created by Edapt when
walking the history. The first release of an Edapt history is considered
to be the base EPackage, then following releases modify this EPackage.
It's important to understand, that during these migrations, code is not
generated. (So the Native packages are not available).

I blogged about how this works here:

http://modelmoo.blogspot.nl/2013/12/how-edapt-works.html


>> ...before trying to commit the resource.
>>
>> From the server trace (further down below) , I see it tries to
>> register the evolved EPackage as a Dynamic package.. but failing with
>> the exception.
>>
>> To summarize:
>>
>>
>> Edapt <-- Source repo with Native Packages, read Resource A.
>> |
>> | (EPackage and model transformation).
>> |
>> V
>> Edapt --> Target repo with Dynamic evolved EPackage write resource A.
>> (Evolved EPackages are registered on the target repo).
> I would try to read the old model with dynamic (also NATIVE!) packages
> and write to the target repo with the generated evolved packages. Can
> you try that?
>

I can likely load with the NATIVE packages, but writing with NATIVE is
going to be tricky. In the Edapt evolution, code is not generated based
on the new EPackage. BTW this scenario works well:

Regular XMI Resource --> Source repo with Dynamic EPackage, write
Resource A.
|
|
V
Edapt <-- Source repo with Dynamic EPackage, read Resource A.
|
| (EPackage and model transformation).
|
V
Edapt --> Target repo with Dynamic evolved EPackage write resource A.


> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
>>
>>
>> org.eclipse.net4j.util.transaction.TransactionException:
>> org.eclipse.emf.cdo.util.CommitException:
>> org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
>> at
>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1222)
>>
>> at
>> org.eclipse.emf.edapt.common.ResourceUtils.saveResourceSet(ResourceUtils.java:202)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.saveModel(CDOPersistency.java:52)
>>
>> at
>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:276)
>>
>> at
>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>
>> at
>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> at java.lang.reflect.Method.invoke(Method.java:601)
>> at junit.framework.TestCase.runTest(TestCase.java:176)
>> at junit.framework.TestCase.runBare(TestCase.java:141)
>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>> at junit.framework.TestResult.run(TestResult.java:125)
>> at junit.framework.TestCase.run(TestCase.java:129)
>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>> at junit.framework.TestSuite.run(TestSuite.java:250)
>> at
>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>
>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>> at junit.framework.TestSuite.run(TestSuite.java:250)
>> at
>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>
>> 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.CommitException:
>> org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1237)
>>
>> at
>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1184)
>>
>> at
>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1218)
>>
>> ... 27 more
>> Caused by: org.eclipse.net4j.signal.RemoteException:
>> java.lang.NullPointerException
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:141)
>>
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:130)
>>
>> at
>> org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:465)
>>
>> at
>> org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:66)
>>
>> at
>> org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57)
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>> at org.eclipse.net4j.signal.Indication.execute(Indication.java:51)
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>
>> at java.lang.Thread.run(Thread.java:722)
>> Caused by: java.lang.NullPointerException
>> at
>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>>
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
>>
>> ... 5 more
>>
>>
>>
>> Server trace:
>>
>>
>>
>> net4j-Thread-32 [debug.buffer] Retaining Buffer@51[RELEASED]
>> net4j-Thread-32 [debug.buffer] Retaining Buffer@52[RELEASED]
>> net4j-Thread-32 [debug.buffer] Retaining Buffer@53[RELEASED]
>> net4j-Thread-32 [debug.buffer] Retaining Buffer@54[RELEASED]
>> net4j-Thread-32 [debug] Read
>> CDOPackageInfo[packageURI=http://www.netxforge.com/16042013/generics,
>> parentURI=null]
>> net4j-Thread-32 [debug] Read
>> CDOPackageUnit[id=http://www.netxforge.com/16042013/generics,
>> state=LOADED, type=DYNAMIC, originalType=DYNAMIC, timeStamp=*]
>> [ERROR] NullPointerException
>> java.lang.NullPointerException
>> at
>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>>
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:
>>
>>
>>
>>>
>>> When a CDOSession is opened the server sends a list of all registered
>>> nsURIs, or more exactly a list of CDOPackageInfos, which are then put as
>>> EPackage.Registry.Descriptors into the session's package registry. When
>>> their EPackages are needed they're are resolved. That means that first
>>> an attempt is made to "load" them from the global package registry. If
>>> that fails and GeneratedPackageEmulationEnabled==true the XMI of that
>>> package is loaded from the server and used to emulate the originally
>>> generated package.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>>
>>>>
>>>>
>>>>> The rest of your post was a little vague so I'm unsure what else to
>>>>> say.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>
>>>>> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>>>>>> Hi (Eike),
>>>>>>
>>>>>> In my effort to make Edapt support CDO model evolution, I need so
>>>>>> help
>>>>>> understanding CDO and EPackages.
>>>>>>
>>>>>> In the test case I work on I have this scenario:
>>>>>>
>>>>>> Repo1 (source)
>>>>>>
>>>>>> - Native packages
>>>>>> - Many resources conforming to native packages.
>>>>>>
>>>>>> Repo2 (target)
>>>>>> - Empty
>>>>>>
>>>>>>
>>>>>> When I read a resource from Repo1 and I get an exception when calling
>>>>>> EcoreUtil.resolveAll(resource)
>>>>>>
>>>>>> This is a Junit testcase, so the platform is not running and the
>>>>>> native EPackages are not registered by the platform. (The generated
>>>>>> EMF code for these packages is not present/available in the test
>>>>>> case).
>>>>>>
>>>>>> Now I gather that the EPackage should be registered, so I make sure
>>>>>> the EPackages are registered by the CDOViewProvider when unknown in
>>>>>> the code below. (Note: The EPackages are created from the .ecore file
>>>>>> and added to the resource set). However the CDO packageRegistry will
>>>>>> report the nsURI is already a known key, so adding is not allowed.
>>>>>>
>>>>>>
>>>>>> Thank You!
>>>>>> Christophe
>>>>>> ----------
>>>>>>
>>>>>>
>>>>>> Exception:
>>>>>>
>>>>>>
>>>>>> Registry packageRegistry = resourceSet.getPackageRegistry();
>>>>>> if (!packageRegistry.isEmpty()) {
>>>>>> CDOPackageRegistry cdoPackageRegistry = session
>>>>>> .getPackageRegistry();
>>>>>> for (String nsURI : packageRegistry.keySet()) {
>>>>>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>>>>>> if(!cdoPackageRegistry.containsKey(nsURI)){
>>>>>> cdoPackageRegistry.putEPackage(packageToAdd);
>>>>>> }
>>>>>> }
>>>>>> }
>>>>>>
>>>>>>
>>>>>> So now I am slightly confused, why will I get the exception below,
>>>>>> while the CDO Package registry reports it knows the nsURI?
>>>>>>
>>>>>> Is it possible to work with resources with native packages
>>>>>> in a CDO repo, while the generated EPackage code is not available?
>>>>>>
>>>>>> what does type=UNKNOWN mean?
>>>>>>
>>>>>>
>>>>>> Also, I tried this option:
>>>>>>
>>>>>> session.options().setGeneratedPackageEmulationEnabled(true);
>>>>>>
>>>>>> With this the Exception is gone, but later on I get a commit
>>>>>> exception, NPE on a missing EPackage. (I will report this
>>>>>> Exception if
>>>>>> needed later on).
>>>>>>
>>>>>>
>>>>>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>>>>>> locally not available:
>>>>>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>>>>>> state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
>>>>>> 15:47:22.133]
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>>>> at
>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>>>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>>>> at
>>>>>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>>>>>> at
>>>>>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>>>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>>>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>>>> at junit.framework.TestResult.run(TestResult.java:125)
>>>>>> at junit.framework.TestCase.run(TestCase.java:129)
>>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>>> at
>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>>>>
>>>>>>
>>>>>>
>>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>>> at
>>>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>>>>
>>>>>>
>>>>>>
>>>>>> 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)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: [CDO] loading resources and package registration. [message #1228111 is a reply to message #1228093] Mon, 06 January 2014 12:42 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 06.01.2014 12:48, schrieb Christophe Bouhier:
> Ok, this package is the evolved EPackage. It is created by Edapt when walking the history. The first release of an
> Edapt history is considered to be the base EPackage, then following releases modify this EPackage. It's important to
> understand, that during these migrations, code is not generated.
Why not? The clients will use exactly that generated package to work with the repo.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> (So the Native packages are not available).
>
> I blogged about how this works here:
>
> http://modelmoo.blogspot.nl/2013/12/how-edapt-works.html
>
>
>>> ...before trying to commit the resource.
>>>
>>> From the server trace (further down below) , I see it tries to
>>> register the evolved EPackage as a Dynamic package.. but failing with
>>> the exception.
>>>
>>> To summarize:
>>>
>>>
>>> Edapt <-- Source repo with Native Packages, read Resource A.
>>> |
>>> | (EPackage and model transformation).
>>> |
>>> V
>>> Edapt --> Target repo with Dynamic evolved EPackage write resource A.
>>> (Evolved EPackages are registered on the target repo).
>> I would try to read the old model with dynamic (also NATIVE!) packages
>> and write to the target repo with the generated evolved packages. Can
>> you try that?
>>
>
> I can likely load with the NATIVE packages, but writing with NATIVE is going to be tricky. In the Edapt evolution,
> code is not generated based on the new EPackage. BTW this scenario works well:
>
> Regular XMI Resource --> Source repo with Dynamic EPackage, write Resource A.
> |
> |
> V
> Edapt <-- Source repo with Dynamic EPackage, read Resource A.
> |
> | (EPackage and model transformation).
> |
> V
> Edapt --> Target repo with Dynamic evolved EPackage write resource A.
>
>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>>>
>>>
>>> org.eclipse.net4j.util.transaction.TransactionException:
>>> org.eclipse.emf.cdo.util.CommitException:
>>> org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1222)
>>>
>>> at
>>> org.eclipse.emf.edapt.common.ResourceUtils.saveResourceSet(ResourceUtils.java:202)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.saveModel(CDOPersistency.java:52)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:276)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>
>>> at
>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>
>>> at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>
>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>> at junit.framework.TestResult.run(TestResult.java:125)
>>> at junit.framework.TestCase.run(TestCase.java:129)
>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>> at
>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>
>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>> at
>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>
>>> 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.CommitException:
>>> org.eclipse.net4j.signal.RemoteException: java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1237)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1184)
>>>
>>> at
>>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1218)
>>>
>>> ... 27 more
>>> Caused by: org.eclipse.net4j.signal.RemoteException:
>>> java.lang.NullPointerException
>>> at
>>> org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:141)
>>>
>>> at
>>> org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:130)
>>>
>>> at
>>> org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:465)
>>>
>>> at
>>> org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:66)
>>>
>>> at
>>> org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57)
>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>> at org.eclipse.net4j.signal.Indication.execute(Indication.java:51)
>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
>>> at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>
>>> at java.lang.Thread.run(Thread.java:722)
>>> Caused by: java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>>>
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>>>
>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
>>>
>>> ... 5 more
>>>
>>>
>>>
>>> Server trace:
>>>
>>>
>>>
>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@51[RELEASED]
>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@52[RELEASED]
>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@53[RELEASED]
>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@54[RELEASED]
>>> net4j-Thread-32 [debug] Read
>>> CDOPackageInfo[packageURI=http://www.netxforge.com/16042013/generics,
>>> parentURI=null]
>>> net4j-Thread-32 [debug] Read
>>> CDOPackageUnit[id=http://www.netxforge.com/16042013/generics,
>>> state=LOADED, type=DYNAMIC, originalType=DYNAMIC, timeStamp=*]
>>> [ERROR] NullPointerException
>>> java.lang.NullPointerException
>>> at
>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
>>>
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>>>
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>>>
>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
>>>
>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:
>>>
>>>
>>>
>>>>
>>>> When a CDOSession is opened the server sends a list of all registered
>>>> nsURIs, or more exactly a list of CDOPackageInfos, which are then put as
>>>> EPackage.Registry.Descriptors into the session's package registry. When
>>>> their EPackages are needed they're are resolved. That means that first
>>>> an attempt is made to "load" them from the global package registry. If
>>>> that fails and GeneratedPackageEmulationEnabled==true the XMI of that
>>>> package is loaded from the server and used to emulate the originally
>>>> generated package.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>> The rest of your post was a little vague so I'm unsure what else to
>>>>>> say.
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://www.esc-net.de
>>>>>> http://thegordian.blogspot.com
>>>>>> http://twitter.com/eikestepper
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>>>>>>> Hi (Eike),
>>>>>>>
>>>>>>> In my effort to make Edapt support CDO model evolution, I need so
>>>>>>> help
>>>>>>> understanding CDO and EPackages.
>>>>>>>
>>>>>>> In the test case I work on I have this scenario:
>>>>>>>
>>>>>>> Repo1 (source)
>>>>>>>
>>>>>>> - Native packages
>>>>>>> - Many resources conforming to native packages.
>>>>>>>
>>>>>>> Repo2 (target)
>>>>>>> - Empty
>>>>>>>
>>>>>>>
>>>>>>> When I read a resource from Repo1 and I get an exception when calling
>>>>>>> EcoreUtil.resolveAll(resource)
>>>>>>>
>>>>>>> This is a Junit testcase, so the platform is not running and the
>>>>>>> native EPackages are not registered by the platform. (The generated
>>>>>>> EMF code for these packages is not present/available in the test
>>>>>>> case).
>>>>>>>
>>>>>>> Now I gather that the EPackage should be registered, so I make sure
>>>>>>> the EPackages are registered by the CDOViewProvider when unknown in
>>>>>>> the code below. (Note: The EPackages are created from the .ecore file
>>>>>>> and added to the resource set). However the CDO packageRegistry will
>>>>>>> report the nsURI is already a known key, so adding is not allowed.
>>>>>>>
>>>>>>>
>>>>>>> Thank You!
>>>>>>> Christophe
>>>>>>> ----------
>>>>>>>
>>>>>>>
>>>>>>> Exception:
>>>>>>>
>>>>>>>
>>>>>>> Registry packageRegistry = resourceSet.getPackageRegistry();
>>>>>>> if (!packageRegistry.isEmpty()) {
>>>>>>> CDOPackageRegistry cdoPackageRegistry = session
>>>>>>> .getPackageRegistry();
>>>>>>> for (String nsURI : packageRegistry.keySet()) {
>>>>>>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>>>>>>> if(!cdoPackageRegistry.containsKey(nsURI)){
>>>>>>> cdoPackageRegistry.putEPackage(packageToAdd);
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> So now I am slightly confused, why will I get the exception below,
>>>>>>> while the CDO Package registry reports it knows the nsURI?
>>>>>>>
>>>>>>> Is it possible to work with resources with native packages
>>>>>>> in a CDO repo, while the generated EPackage code is not available?
>>>>>>>
>>>>>>> what does type=UNKNOWN mean?
>>>>>>>
>>>>>>>
>>>>>>> Also, I tried this option:
>>>>>>>
>>>>>>> session.options().setGeneratedPackageEmulationEnabled(true);
>>>>>>>
>>>>>>> With this the Exception is gone, but later on I get a commit
>>>>>>> exception, NPE on a missing EPackage. (I will report this
>>>>>>> Exception if
>>>>>>> needed later on).
>>>>>>>
>>>>>>>
>>>>>>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>>>>>>> locally not available:
>>>>>>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>>>>>>> state=PROXY, type=UNKNOWN, originalType=NATIVE, timeStamp=2012-04-19
>>>>>>> 15:47:22.133]
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>>>>> at
>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>>>>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>>>>> at
>>>>>>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>> at
>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at
>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>>>>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>>>>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>>>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>>>>> at junit.framework.TestResult.run(TestResult.java:125)
>>>>>>> at junit.framework.TestCase.run(TestCase.java:129)
>>>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>>>> at
>>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>>>> at
>>>>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 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)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [CDO] loading resources and package registration. [message #1228112 is a reply to message #1228093] Mon, 06 January 2014 12:43 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 06.01.2014 12:48, schrieb Christophe Bouhier:
> ps. As discussed earlier, the scenario I am testing is only one of the two envisaged 'solutions'. Scenario 2 is apply
> a History on the DBStore directly. I would like to discuss scenario 2as well. Perhaps not in the forum...
Yeah, i definitely favour scenario 2 because it's clearly way more performant and scalable. We can discuss it in the dev
list or a bugzilla if you want.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] loading resources and package registration. [message #1228272 is a reply to message #1228111] Mon, 06 January 2014 20:47 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 06-01-14 13:42, Eike Stepper wrote:
> Am 06.01.2014 12:48, schrieb Christophe Bouhier:
>> Ok, this package is the evolved EPackage. It is created by Edapt when
>> walking the history. The first release of an Edapt history is
>> considered to be the base EPackage, then following releases modify
>> this EPackage. It's important to understand, that during these
>> migrations, code is not generated.
> Why not? The clients will use exactly that generated package to work
> with the repo.
>
This is just the way Edapt works. Edapt did not envision needing the
generated packages, as they can be constructed from the .ecore. I guess
it would complicate things, considering various Releases of a History,
meaning various code generation cycles for one migration.

> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>> (So the Native packages are not available).
>>
>> I blogged about how this works here:
>>
>> http://modelmoo.blogspot.nl/2013/12/how-edapt-works.html
>>
>>
>>>> ...before trying to commit the resource.
>>>>
>>>> From the server trace (further down below) , I see it tries to
>>>> register the evolved EPackage as a Dynamic package.. but failing with
>>>> the exception.
>>>>
>>>> To summarize:
>>>>
>>>>
>>>> Edapt <-- Source repo with Native Packages, read Resource A.
>>>> |
>>>> | (EPackage and model transformation).
>>>> |
>>>> V
>>>> Edapt --> Target repo with Dynamic evolved EPackage write resource A.
>>>> (Evolved EPackages are registered on the target repo).
>>> I would try to read the old model with dynamic (also NATIVE!) packages
>>> and write to the target repo with the generated evolved packages. Can
>>> you try that?
>>>
>>
>> I can likely load with the NATIVE packages, but writing with NATIVE is
>> going to be tricky. In the Edapt evolution, code is not generated
>> based on the new EPackage. BTW this scenario works well:
>>
>> Regular XMI Resource --> Source repo with Dynamic EPackage, write
>> Resource A.
>> |
>> |
>> V
>> Edapt <-- Source repo with Dynamic EPackage, read Resource A.
>> |
>> | (EPackage and model transformation).
>> |
>> V
>> Edapt --> Target repo with Dynamic evolved EPackage write resource A.
>>
>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>>>
>>>>
>>>> org.eclipse.net4j.util.transaction.TransactionException:
>>>> org.eclipse.emf.cdo.util.CommitException:
>>>> org.eclipse.net4j.signal.RemoteException:
>>>> java.lang.NullPointerException
>>>> at
>>>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1222)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.common.ResourceUtils.saveResourceSet(ResourceUtils.java:202)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.saveModel(CDOPersistency.java:52)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:276)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>>
>>>>
>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>
>>>>
>>>> at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>
>>>>
>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>> at junit.framework.TestResult.run(TestResult.java:125)
>>>> at junit.framework.TestCase.run(TestCase.java:129)
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>> at
>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>>
>>>>
>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>> at
>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>>
>>>>
>>>> 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.CommitException:
>>>> org.eclipse.net4j.signal.RemoteException:
>>>> java.lang.NullPointerException
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commitSynced(CDOTransactionImpl.java:1237)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1184)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.save(CDOResourceImpl.java:1218)
>>>>
>>>>
>>>> ... 27 more
>>>> Caused by: org.eclipse.net4j.signal.RemoteException:
>>>> java.lang.NullPointerException
>>>> at
>>>> org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:141)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:130)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:465)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:66)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:57)
>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>> at org.eclipse.net4j.signal.Indication.execute(Indication.java:51)
>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:149)
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>>
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>>
>>>>
>>>> at java.lang.Thread.run(Thread.java:722)
>>>> Caused by: java.lang.NullPointerException
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
>>>>
>>>>
>>>> ... 5 more
>>>>
>>>>
>>>>
>>>> Server trace:
>>>>
>>>>
>>>>
>>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@51[RELEASED]
>>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@52[RELEASED]
>>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@53[RELEASED]
>>>> net4j-Thread-32 [debug.buffer] Retaining Buffer@54[RELEASED]
>>>> net4j-Thread-32 [debug] Read
>>>> CDOPackageInfo[packageURI=http://www.netxforge.com/16042013/generics,
>>>> parentURI=null]
>>>> net4j-Thread-32 [debug] Read
>>>> CDOPackageUnit[id=http://www.netxforge.com/16042013/generics,
>>>> state=LOADED, type=DYNAMIC, originalType=DYNAMIC, timeStamp=*]
>>>> [ERROR] NullPointerException
>>>> java.lang.NullPointerException
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.TransactionCommitContext$TransactionPackageRegistry.putPackageUnit(TransactionCommitContext.java:1445)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:149)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:99)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:110)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:87)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:92)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:65)
>>>>
>>>>
>>>> at
>>>> org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:66)
>>>>
>>>>
>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:
>>>>
>>>>
>>>>
>>>>>
>>>>> When a CDOSession is opened the server sends a list of all registered
>>>>> nsURIs, or more exactly a list of CDOPackageInfos, which are then
>>>>> put as
>>>>> EPackage.Registry.Descriptors into the session's package registry.
>>>>> When
>>>>> their EPackages are needed they're are resolved. That means that first
>>>>> an attempt is made to "load" them from the global package registry. If
>>>>> that fails and GeneratedPackageEmulationEnabled==true the XMI of that
>>>>> package is loaded from the server and used to emulate the originally
>>>>> generated package.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://www.esc-net.de
>>>>> http://thegordian.blogspot.com
>>>>> http://twitter.com/eikestepper
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> The rest of your post was a little vague so I'm unsure what else to
>>>>>>> say.
>>>>>>>
>>>>>>> Cheers
>>>>>>> /Eike
>>>>>>>
>>>>>>> ----
>>>>>>> http://www.esc-net.de
>>>>>>> http://thegordian.blogspot.com
>>>>>>> http://twitter.com/eikestepper
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Am 04.01.2014 14:22, schrieb Christophe Bouhier:
>>>>>>>> Hi (Eike),
>>>>>>>>
>>>>>>>> In my effort to make Edapt support CDO model evolution, I need so
>>>>>>>> help
>>>>>>>> understanding CDO and EPackages.
>>>>>>>>
>>>>>>>> In the test case I work on I have this scenario:
>>>>>>>>
>>>>>>>> Repo1 (source)
>>>>>>>>
>>>>>>>> - Native packages
>>>>>>>> - Many resources conforming to native packages.
>>>>>>>>
>>>>>>>> Repo2 (target)
>>>>>>>> - Empty
>>>>>>>>
>>>>>>>>
>>>>>>>> When I read a resource from Repo1 and I get an exception when
>>>>>>>> calling
>>>>>>>> EcoreUtil.resolveAll(resource)
>>>>>>>>
>>>>>>>> This is a Junit testcase, so the platform is not running and the
>>>>>>>> native EPackages are not registered by the platform. (The generated
>>>>>>>> EMF code for these packages is not present/available in the test
>>>>>>>> case).
>>>>>>>>
>>>>>>>> Now I gather that the EPackage should be registered, so I make sure
>>>>>>>> the EPackages are registered by the CDOViewProvider when unknown in
>>>>>>>> the code below. (Note: The EPackages are created from the .ecore
>>>>>>>> file
>>>>>>>> and added to the resource set). However the CDO packageRegistry
>>>>>>>> will
>>>>>>>> report the nsURI is already a known key, so adding is not allowed.
>>>>>>>>
>>>>>>>>
>>>>>>>> Thank You!
>>>>>>>> Christophe
>>>>>>>> ----------
>>>>>>>>
>>>>>>>>
>>>>>>>> Exception:
>>>>>>>>
>>>>>>>>
>>>>>>>> Registry packageRegistry = resourceSet.getPackageRegistry();
>>>>>>>> if (!packageRegistry.isEmpty()) {
>>>>>>>> CDOPackageRegistry cdoPackageRegistry = session
>>>>>>>> .getPackageRegistry();
>>>>>>>> for (String nsURI : packageRegistry.keySet()) {
>>>>>>>> EPackage packageToAdd = packageRegistry.getEPackage(nsURI);
>>>>>>>> if(!cdoPackageRegistry.containsKey(nsURI)){
>>>>>>>> cdoPackageRegistry.putEPackage(packageToAdd);
>>>>>>>> }
>>>>>>>> }
>>>>>>>> }
>>>>>>>>
>>>>>>>>
>>>>>>>> So now I am slightly confused, why will I get the exception below,
>>>>>>>> while the CDO Package registry reports it knows the nsURI?
>>>>>>>>
>>>>>>>> Is it possible to work with resources with native packages
>>>>>>>> in a CDO repo, while the generated EPackage code is not available?
>>>>>>>>
>>>>>>>> what does type=UNKNOWN mean?
>>>>>>>>
>>>>>>>>
>>>>>>>> Also, I tried this option:
>>>>>>>>
>>>>>>>> session.options().setGeneratedPackageEmulationEnabled(true);
>>>>>>>>
>>>>>>>> With this the Exception is gone, but later on I get a commit
>>>>>>>> exception, NPE on a missing EPackage. (I will report this
>>>>>>>> Exception if
>>>>>>>> needed later on).
>>>>>>>>
>>>>>>>>
>>>>>>>> org.eclipse.emf.cdo.common.util.CDOException: Generated packages
>>>>>>>> locally not available:
>>>>>>>> CDOPackageUnit[id=http://www.netxforge.com/13042011/generics,
>>>>>>>> state=PROXY, type=UNKNOWN, originalType=NATIVE,
>>>>>>>> timeStamp=2012-04-19
>>>>>>>> 15:47:22.133]
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.session.CDOSessionImpl.loadPackages(CDOSessionImpl.java:559)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:239)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl.load(CDOPackageUnitImpl.java:228)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:116)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl.getEPackage(CDOPackageInfoImpl.java:109)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage(EPackageRegistryImpl.java:127)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.common.model.CDOClassifierRef.resolve(CDOClassifierRef.java:113)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDOClassifierRefAndResolve(CDODataInputImpl.java:170)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.readSystemValues(BaseCDORevision.java:186)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.read(BaseCDORevision.java:160)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:427)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl.readCDORevision(CDODataInputImpl.java:418)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readRevision(RevisionInfo.java:226)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.spi.common.revision.RevisionInfo.readResult(RevisionInfo.java:165)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:143)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.LoadRevisionsRequest.confirming(LoadRevisionsRequest.java:1)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequest.confirming(CDOClientRequest.java:97)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedInput(RequestWithConfirmation.java:125)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:328)
>>>>>>>> at
>>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:105)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
>>>>>>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
>>>>>>>> at
>>>>>>>> org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:442)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:502)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:535)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.loadRevisions(CDOClientProtocol.java:172)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.loadRevisions(CDORevisionManagerImpl.java:387)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevisions(CDORevisionManagerImpl.java:292)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:275)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.getRevision(CDORevisionManagerImpl.java:268)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.CDOViewImpl.getRevision(CDOViewImpl.java:729)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObject(AbstractCDOView.java:1094)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject(AbstractCDOView.java:993)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getObject(CDOTransactionImpl.java:1152)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.convertIDToObject(AbstractCDOView.java:1327)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertIDToObject(CDOStoreImpl.java:691)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.convertToEMF(CDOStoreImpl.java:659)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.internal.cdo.view.CDOStoreImpl.get(CDOStoreImpl.java:191)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.impl.EStoreEObjectImpl$BasicEStoreEList.delegateGet(EStoreEObjectImpl.java:241)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.common.util.DelegatingEList.get(DelegatingEList.java:230)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:703)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:690)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(EcoreUtil.java:280)
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.common.ResourceUtils.resolveAll(ResourceUtils.java:289)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.common.ResourceUtils.loadResourceSet(ResourceUtils.java:106)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOPersistency.loadModel(CDOPersistency.java:63)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.loadRepository(CDOMigrationReconstructor.java:35)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrationReconstructor.endRelease(CDOMigrationReconstructor.java:55)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.endRelease(CompositeReconstructorBase.java:173)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:83)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.history.reconstruction.ForwardReconstructorBase.doReconstruct(ForwardReconstructorBase.java:58)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.history.reconstruction.CompositeReconstructorBase.reconstruct(CompositeReconstructorBase.java:75)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrate(CDOMigrator.java:365)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.migration.execution.CDOMigrator.migrateAndCopy(CDOMigrator.java:269)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestBase.testMigration(CDOMigrationTestBase.java:183)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestCase.testMigration(CDOMigrationTestCase.java:73)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>>>> at
>>>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at
>>>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at java.lang.reflect.Method.invoke(Method.java:601)
>>>>>>>> at junit.framework.TestCase.runTest(TestCase.java:176)
>>>>>>>> at junit.framework.TestCase.runBare(TestCase.java:141)
>>>>>>>> at junit.framework.TestResult$1.protect(TestResult.java:122)
>>>>>>>> at junit.framework.TestResult.runProtected(TestResult.java:142)
>>>>>>>> at junit.framework.TestResult.run(TestResult.java:125)
>>>>>>>> at junit.framework.TestCase.run(TestCase.java:129)
>>>>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>>>>> at
>>>>>>>> org.eclipse.emf.edapt.cdo.tests.CDOMigrationTestSuite.run(CDOMigrationTestSuite.java:80)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> at junit.framework.TestSuite.runTest(TestSuite.java:255)
>>>>>>>> at junit.framework.TestSuite.run(TestSuite.java:250)
>>>>>>>> at
>>>>>>>> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 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)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
Re: [CDO] loading resources and package registration. [message #1228604 is a reply to message #1228112] Tue, 07 January 2014 15:42 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 06-01-14 13:43, Eike Stepper wrote:
> Am 06.01.2014 12:48, schrieb Christophe Bouhier:
>> ps. As discussed earlier, the scenario I am testing is only one of the
>> two envisaged 'solutions'. Scenario 2 is apply a History on the
>> DBStore directly. I would like to discuss scenario 2as well. Perhaps
>> not in the forum...
> Yeah, i definitely favour scenario 2 because it's clearly way more
> performant and scalable. We can discuss it in the dev list or a bugzilla
> if you want.
OK, will update this bug then:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256856
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
Previous Topic:Custom Property dialog
Next Topic:Correct way to update transient crossrefs?
Goto Forum:
  


Current Time: Fri Mar 29 00:10:09 GMT 2024

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

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

Back to the top