Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 269787 - CDOPackageRegistry does not behave like the former lazy registry
Summary: CDOPackageRegistry does not behave like the former lazy registry
Status: CLOSED WORKSFORME
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-24 04:31 EDT by Stephane fournier CLA
Modified: 2010-06-29 09:22 EDT (History)
3 users (show)

See Also:
stepper: galileo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane fournier CLA 2009-03-24 04:31:39 EDT
Build ID: I20090313-0100 (3.5M6)
EMF : 2.5.0M6
CDO build : 2.0.0M6

Steps To Reproduce:
1. Create a session, do not call CDOPackageRegistryPopulator methods.
2. Open a transaction
3. Create a resource to add, modify data.

More information:
Here is the code used to create the session :
// Create TCP connector through wiring container
IConnector connector = (IConnector) IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.connectors", "tcp", "localhost:2036");
// Create CDO session configuration
CDOSessionConfiguration config = CDONet4jUtil.createSessionConfiguration();
config.setConnector(connector);
config.setRepositoryName("repo1");
// Open the session.
CDOSession session = config.openSession();

Here is the code used to create the transaction :
CDOTransaction transaction = session.openTransaction(resourceSet);

When creating data through the transaction, I got an exception about unregistered packages. If I call CDOPackageRegistryPopulator.populate(..), it works.

Stéphane.

org.eclipse.net4j.util.transaction.TransactionException: org.eclipse.emf.cdo.common.util.CDOException: No package unit for com.thalesgroup.mde.shared.data.activity.impl.ActivityPackageImpl@181a7dc (name: activity) (nsURI: http://www.thalesgroup.com/mde/shared/activity/1.0.0, nsPrefix: com.thalesgroup.mde.shared.data)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:580)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:586)
	at org.eclipse.emf.cdo.examples.StandaloneManualExample.main(StandaloneManualExample.java:101)
	at com.thalesgroup.mde.cdo.client.tests.CDOClientApplication.start(CDOClientApplication.java:25)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:556)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:511)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1284)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1260)
Caused by: org.eclipse.emf.cdo.common.util.CDOException: No package unit for com.thalesgroup.mde.shared.data.activity.impl.ActivityPackageImpl@181a7dc (name: activity) (nsURI: http://www.thalesgroup.com/mde/shared/activity/1.0.0, nsPrefix: com.thalesgroup.mde.shared.data)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.analyzeNewPackages(CDOTransactionImpl.java:1104)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.analyzeNewPackages(CDOTransactionImpl.java:1076)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.access$7(CDOTransactionImpl.java:1048)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.<init>(CDOTransactionImpl.java:1208)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.createCommitContext(CDOTransactionImpl.java:551)
	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:46)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:572)
Comment 1 Stephane fournier CLA 2009-03-24 06:01:34 EDT
See this post :http://www.eclipse.org/newsportal/article.php?id=40334&group=eclipse.tools.emf#40334 where I explain how I patched the CDOPackageResgistryImpl.getPackageInfo(EPackage ePackage) method to take into account CDOPackageRegistryPopulator.Descriptor.

Stephane.
Comment 2 Eike Stepper CLA 2009-03-31 03:00:00 EDT
This WORKSFORME.
It could have been a DUPLICATE as well but without test case I couldn't check it before.
I added org.eclipse.emf.cdo.tests.PackageRegistryTest.testLaziness().
Please reopen, if my test case does not assert your problem...
Comment 3 Eike Stepper CLA 2010-06-29 04:44:48 EDT
Closing