Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » CDO Loading packages at activation time
CDO Loading packages at activation time [message #425412] Tue, 25 November 2008 16:23 Go to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi,

I'm trying to load packages into MemStore when it starts. I want to load a
static set of Packages everytime the server is started. I tried 2
different approachs so far.
1st approach, adding cdoPackages at activation time:

CDOSessionImpl session = new CDOSessionImpl();
CDOPackage cdoActionPackage =
CDOEMFUtil.createCDOPackage(ActionPackage.eINSTANCE,
session.getPackageManager());
PackageManager storePkgManager =
(PackageManager)getRepository().getPackageManager();
storePkgManager.addPackage(cdoActionPackage);

The 2nd approach is by using Package infos on the store accessor :

public Collection<CDOPackageInfo> readPackageInfos() {
Collection<CDOPackageInfo> returnVal = new ArrayList<CDOPackageInfo>();
CDOSessionImpl session = new CDOSessionImpl();
CDOPackageInfo cdoActionPackage =
CDOOEMFUtil.createCDOPackageInfo(ActionPackage.eINSTANCE,
session.getPackageManager());
returnVal.add(cdoActionPackage);
return returnVal;
}

Both these 2 methods cause problems, when the client tries to load the
same packages, I get an Illegal State Exception coming from the package
Manager CDOPackageManagerImpl.addPackage, this method throws an exeption
when you try to add a Package that is already in the store, which I think
would be better if it was simply ignored when the package is already
there.

Thank you for any suggestion in this matter,
Re: CDO Loading packages at activation time [message #425414 is a reply to message #425412] Tue, 25 November 2008 16:44 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
Kaab,

Comments below...


kaab schrieb:
> Hi,
> I'm trying to load packages into MemStore when it starts. I want to
> load a static set of Packages everytime the server is started. I tried
> 2 different approachs so far. 1st approach, adding cdoPackages at
> activation time:
Theoretically there are indeed the two ways: (1) Open an "embedded"
client session in the server process and use client API to regularly
*commit* the packages (2) Use server API



>
> CDOSessionImpl session = new CDOSessionImpl();
> CDOPackage cdoActionPackage =
> CDOEMFUtil.createCDOPackage(ActionPackage.eINSTANCE,
> session.getPackageManager());
> PackageManager storePkgManager =
> (PackageManager)getRepository().getPackageManager();
> storePkgManager.addPackage(cdoActionPackage);
Your implementation of (1) doesn't seem correct. You should not add the
CDOPackage to the package *manager* of the repository but register the
EPackage with the package *registry* of the session. Then open a
transaction on the session, add a dummy object (possibly in a dummy
resource) of the package and commit the transaction. You only need to do
this once per package ever. From that time on the repository distributes
the package to all other client sessions.

>
> The 2nd approach is by using Package infos on the store accessor :
>
> public Collection<CDOPackageInfo> readPackageInfos() {
> Collection<CDOPackageInfo> returnVal = new ArrayList<CDOPackageInfo>();
> CDOSessionImpl session = new CDOSessionImpl();
> CDOPackageInfo cdoActionPackage =
> CDOOEMFUtil.createCDOPackageInfo(ActionPackage.eINSTANCE,
> session.getPackageManager());
> returnVal.add(cdoActionPackage);
> return returnVal;
> }
I don't think that someone ever tried (2).

>
> Both these 2 methods cause problems, when the client tries to load the
> same packages, I get an Illegal State Exception coming from the
> package Manager CDOPackageManagerImpl.addPackage, this method throws
> an exeption when you try to add a Package that is already in the
> store, which I think would be better if it was simply ignored when the
> package is already there.
> Thank you for any suggestion in this matter,
Please let me know if my answer helped to do (1) right ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com


Re: CDO Loading packages at activation time [message #425415 is a reply to message #425414] Tue, 25 November 2008 19:20 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Thanks Eike,

I am going with the first method, but the problem is that i want to this
in activation time, and I can't connect to the server when its activating.
Is there any other way to initialise the server without having to make a
call to a client and do a commit ?

Thanks,
Re: CDO Loading packages at activation time [message #425417 is a reply to message #425415] Tue, 25 November 2008 20:39 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060204090403010109030704
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

kaab schrieb:
> Thanks Eike,
> I am going with the first method, but the problem is that i want to
> this in activation time, and I can't connect to the server when its
> activating. Is there any other way to initialise the server without
> having to make a call to a client and do a commit ?
You could listen to lifecycle events of the repository (untested):

| *final *IRepository repository = ...
repository.addListener(*new *LifecycleEventAdapter()
{
@Override
*protected **void *onActivated(ILifecycle lifecycle)
{
IJVMAcceptor acceptor = JVMUtil.getAcceptor(IPluginContainer.INSTANCE, "repo-init");
IJVMConnector connector = JVMUtil.getConnector(IPluginContainer.INSTANCE, "repo-init");

CDOSessionConfiguration config = CDOUtil.createSessionConfiguration();
config.setConnector(connector);
config.setRepositoryName(repository.getName());

CDOSession session = config.openSession();
session.getPackageRegistry().putEPackage(ActionPackage.eINST ANCE);

CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getOrCreateResource("/dummies");
resource.getContents().add(ActionFactory.eINSTANCE.createAct ion());
transaction.commit();

session.close();
connector.close();
acceptor.close();
}
});|




Does this help?

Cheers
/Eike

----
http://thegordian.blogspot.com



--------------060204090403010109030704
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
kaab schrieb:
<blockquote
cite="mid:e2076acb87fea3252cc304becc865410$1@www.eclipse.org"
type="cite">Thanks Eike, <br>
I am going with the first method, but the problem is that i want to
this in activation time, and I can't connect to the server when its
activating. Is there any other way to initialise the server without
having to make a call to a client and do a commit ?
<br>
</blockquote>
You could listen to lifecycle events of the repository (untested):<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">


Re: CDO Loading packages at activation time [message #425418 is a reply to message #425417] Tue, 25 November 2008 21:26 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi,
I get this error when using your snippet :
We have our own implementation of the MemStore so it be might related, i
never had an error with taht so I don't know if it is. The error happens
when I try to open a session (config.openSession()) :


[ERROR] Factory not found: org.eclipse.emf.cdo.server.repositories[default]
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
found: org.eclipse.emf.cdo.server.repositories[default]
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
at
org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
at
org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
at
org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
at
org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[ERROR] Factory not found: org.eclipse.emf.cdo.server.repositories[default]
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
found: org.eclipse.emf.cdo.server.repositories[default]
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
at
org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
at
org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
at
org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
at
org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[ERROR] [Ljava.lang.StackTraceElement;
java.lang.ClassNotFoundException: [Ljava.lang.StackTraceElement;
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:485)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:401)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:389)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:86)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.net4j.util.io.ExtendedIOUtil$ClassLoaderClassRes olver.resolveClass(ExtendedIOUtil.java:230)
at
org.eclipse.net4j.util.io.ExtendedIOUtil$3.resolveClass(Exte ndedIOUtil.java:162)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at
org.eclipse.net4j.util.io.ExtendedIOUtil.readObject(Extended IOUtil.java:176)
at
org.eclipse.net4j.util.io.ExtendedIOUtil.readObject(Extended IOUtil.java:131)
at
org.eclipse.net4j.util.io.ExtendedDataInputStream.readObject (ExtendedDataInputStream.java:46)
at
org.eclipse.net4j.signal.RemoteExceptionIndication.indicatin g(RemoteExceptionIndication.java:46)
at org.eclipse.net4j.signal.Indication.doExtendedInput(Indicati on.java:55)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
at org.eclipse.net4j.signal.Indication.execute(Indication.java: 49)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[ERROR] org.eclipse.net4j.util.container.FactoryNotFoundException: Factory
not found: org.eclipse.emf.cdo.server.repositories[default]
org.eclipse.net4j.signal.RemoteException:
org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
found: org.eclipse.emf.cdo.server.repositories[default]
at
org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteEx ception(RequestWithConfirmation.java:123)
at
org.eclipse.net4j.signal.SignalProtocol.handleRemoteExceptio n(SignalProtocol.java:459)
at
org.eclipse.net4j.signal.RemoteExceptionIndication.indicatin g(RemoteExceptionIndication.java:53)
at org.eclipse.net4j.signal.Indication.doExtendedInput(Indicati on.java:55)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
at org.eclipse.net4j.signal.Indication.execute(Indication.java: 49)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException:
Factory not found: org.eclipse.emf.cdo.server.repositories[default]
at
org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
at
org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
at
org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
at
org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
at
org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
at
org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
at
org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
... 5 more


Thanks,
Re: CDO Loading packages at activation time [message #425422 is a reply to message #425418] Tue, 25 November 2008 22:53 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi again,

I've tried the same method but using a TCP Connector, I always get
connection refused, so I have some doubts on the ability to connect to the
store when its in this state.

[ERROR] Connection refused: no further information
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
at
org.eclipse.net4j.internal.tcp.TCPConnector.handleConnect(TC PConnector.java:144)
at
org.eclipse.net4j.internal.tcp.TCPSelector.handleSelection(T CPSelector.java:245)
at org.eclipse.net4j.internal.tcp.TCPSelector.run(TCPSelector.j ava:170)
at java.lang.Thread.run(Unknown Source)

thanks,
Re: CDO Loading packages at activation time [message #425427 is a reply to message #425418] Wed, 26 November 2008 07:24 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020602030502030909060402
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Kaab,

Oh yes, it seems as if the repository is, at that time, in a state
between activation and registration with the container ;-(
Please forget about my orevious hint with the lifecycle adapter.

I think the best place to hook into is directly between the repository
registration and the (TCP) acceptor registration.
During this time the repository is up and running but TCP connections
are not yet possible.

It depends on how you start your server. Can you give a detailed
explanation how you are doing this?
Have a look at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplicat ion:

| @Override
*protected **void *doStart() *throws *Exception
{
*super*.doStart();
OM.LOG.info("CDO Server starting");
File configFile = OMPlatform.INSTANCE.getConfigFile("cdo-server.xml");
*if *(configFile != *null *&& configFile.exists())
{
RepositoryConfigurator repositoryConfigurator = *new *RepositoryConfigurator(IPluginContainer.INSTANCE);
repositories = repositoryConfigurator.configure(configFile);
*if *(repositories == *null *|| repositories.length == 0)
{
OM.LOG.warn("No repositories configured");
}

// HERE IS A GOOD PLACE TO HOOK INTO

TransportConfigurator net4jConfigurator = *new *TransportConfigurator(IPluginContainer.INSTANCE);
acceptors = net4jConfigurator.configure(configFile);
*if *(acceptors == *null *|| acceptors.length == 0)
{
OM.LOG.warn("No acceptors configured");
}
}
*else*
{
OM.LOG.warn("CDO server configuration not found: " + configFile.getAbsolutePath());
}

OM.LOG.info("CDO Server started");
}|


Cheers
/Eike

----
http://thegordian.blogspot.com



kaab schrieb:
> Hi, I get this error when using your snippet :
> We have our own implementation of the MemStore so it be might related,
> i never had an error with taht so I don't know if it is. The error
> happens when I try to open a session (config.openSession()) :
>
> [ERROR] Factory not found:
> org.eclipse.emf.cdo.server.repositories[default]
> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
> found: org.eclipse.emf.cdo.server.repositories[default]
> at
> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
>
> at
> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>
> at
> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> [ERROR] Factory not found:
> org.eclipse.emf.cdo.server.repositories[default]
> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
> found: org.eclipse.emf.cdo.server.repositories[default]
> at
> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
>
> at
> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>
> at
> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> [ERROR] [Ljava.lang.StackTraceElement;
> java.lang.ClassNotFoundException: [Ljava.lang.StackTraceElement;
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:485)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:401)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:389)
>
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:86)
>
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at
> org.eclipse.net4j.util.io.ExtendedIOUtil$ClassLoaderClassRes olver.resolveClass(ExtendedIOUtil.java:230)
>
> at
> org.eclipse.net4j.util.io.ExtendedIOUtil$3.resolveClass(Exte ndedIOUtil.java:162)
>
> at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
> at java.io.ObjectInputStream.readClassDesc(Unknown Source)
> at java.io.ObjectInputStream.readArray(Unknown Source)
> at java.io.ObjectInputStream.readObject0(Unknown Source)
> at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
> at java.io.ObjectInputStream.readSerialData(Unknown Source)
> at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
> at java.io.ObjectInputStream.readObject0(Unknown Source)
> at java.io.ObjectInputStream.readObject(Unknown Source)
> at
> org.eclipse.net4j.util.io.ExtendedIOUtil.readObject(Extended IOUtil.java:176)
>
> at
> org.eclipse.net4j.util.io.ExtendedIOUtil.readObject(Extended IOUtil.java:131)
>
> at
> org.eclipse.net4j.util.io.ExtendedDataInputStream.readObject (ExtendedDataInputStream.java:46)
>
> at
> org.eclipse.net4j.signal.RemoteExceptionIndication.indicatin g(RemoteExceptionIndication.java:46)
>
> at
> org.eclipse.net4j.signal.Indication.doExtendedInput(Indicati on.java:55)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at org.eclipse.net4j.signal.Indication.execute(Indication.java: 49)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> [ERROR] org.eclipse.net4j.util.container.FactoryNotFoundException:
> Factory not found: org.eclipse.emf.cdo.server.repositories[default]
> org.eclipse.net4j.signal.RemoteException:
> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory not
> found: org.eclipse.emf.cdo.server.repositories[default]
> at
> org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteEx ception(RequestWithConfirmation.java:123)
>
> at
> org.eclipse.net4j.signal.SignalProtocol.handleRemoteExceptio n(SignalProtocol.java:459)
>
> at
> org.eclipse.net4j.signal.RemoteExceptionIndication.indicatin g(RemoteExceptionIndication.java:53)
>
> at
> org.eclipse.net4j.signal.Indication.doExtendedInput(Indicati on.java:55)
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
> at org.eclipse.net4j.signal.Indication.execute(Indication.java: 49)
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException:
> Factory not found: org.eclipse.emf.cdo.server.repositories[default]
> at
> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
>
> at
> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
>
> at
> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>
> at
> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>
> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>
> ... 5 more
>
>
> Thanks,
>

--------------020602030502030909060402
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Kaab,<br>
<br>
Oh yes, it seems as if the repository is, at that time, in a state
between activation and registration with the container ;-(<br>
Please forget about my orevious hint with the lifecycle adapter. <br>
<br>
I think the best place to hook into is directly between the repository
registration and the (TCP) acceptor registration.<br>
During this time the repository is up and running but TCP connections
are not yet possible.<br>
<br>
It depends on how you start your server. Can you give a detailed
explanation how you are doing this?<br>
Have a look at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplicat ion: <br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">


Re: CDO Loading packages at activation time [message #425428 is a reply to message #425427] Wed, 26 November 2008 07:27 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050809090904080301000800
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

One more comment:

If you feel that the problem of repository-first-time-initialization
should be addressed in a more convenient and reusable way, feel free to
file an enhancement request. I could imagine an extension point driven
approach...

Cheers
/Eike

----
http://thegordian.blogspot.com



Eike Stepper schrieb:
> Kaab,
>
> Oh yes, it seems as if the repository is, at that time, in a state
> between activation and registration with the container ;-(
> Please forget about my orevious hint with the lifecycle adapter.
>
> I think the best place to hook into is directly between the repository
> registration and the (TCP) acceptor registration.
> During this time the repository is up and running but TCP connections
> are not yet possible.
>
> It depends on how you start your server. Can you give a detailed
> explanation how you are doing this?
> Have a look at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplicat ion:
>
> | @Override
> *protected **void *doStart() *throws *Exception
> {
> *super*.doStart();
> OM.LOG.info("CDO Server starting");
> File configFile = OMPlatform.INSTANCE.getConfigFile("cdo-server.xml");
> *if *(configFile != *null *&& configFile.exists())
> {
> RepositoryConfigurator repositoryConfigurator = *new *RepositoryConfigurator(IPluginContainer.INSTANCE);
> repositories = repositoryConfigurator.configure(configFile);
> *if *(repositories == *null *|| repositories.length == 0)
> {
> OM.LOG.warn("No repositories configured");
> }
>
> // HERE IS A GOOD PLACE TO HOOK INTO
>
> TransportConfigurator net4jConfigurator = *new *TransportConfigurator(IPluginContainer.INSTANCE);
> acceptors = net4jConfigurator.configure(configFile);
> *if *(acceptors == *null *|| acceptors.length == 0)
> {
> OM.LOG.warn("No acceptors configured");
> }
> }
> *else*
> {
> OM.LOG.warn("CDO server configuration not found: " + configFile.getAbsolutePath());
> }
>
> OM.LOG.info("CDO Server started");
> }|
>
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> kaab schrieb:
>> Hi, I get this error when using your snippet :
>> We have our own implementation of the MemStore so it be might
>> related, i never had an error with taht so I don't know if it is. The
>> error happens when I try to open a session (config.openSession()) :
>>
>> [ERROR] Factory not found:
>> org.eclipse.emf.cdo.server.repositories[default]
>> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory
>> not found: org.eclipse.emf.cdo.server.repositories[default]
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>>
>> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source)
>> at java.lang.Thread.run(Unknown Source)
>> [ERROR] Factory not found:
>> org.eclipse.emf.cdo.server.repositories[default]
>> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory
>> not found: org.eclipse.emf.cdo.server.repositories[default]
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>>
>> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source)
>> at java.lang.Thread.run(Unknown Source)
>> [ERROR] [Ljava.lang.StackTraceElement;
>> java.lang.ClassNotFoundException: [Ljava.lang.StackTraceElement;
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:485)
>>
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:401)
>>
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:389)
>>
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:86)
>>
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at
>> org.eclipse.net4j.util.io.ExtendedIOUtil$ClassLoaderClassRes olver.resolveClass(ExtendedIOUtil.java:230)
>>
>> at
>> org.eclipse.net4j.util.io.ExtendedIOUtil$3.resolveClass(Exte ndedIOUtil.java:162)
>>
>> at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>> at java.io.ObjectInputStream.readClassDesc(Unknown Source)
>> at java.io.ObjectInputStream.readArray(Unknown Source)
>> at java.io.ObjectInputStream.readObject0(Unknown Source)
>> at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
>> at java.io.ObjectInputStream.readSerialData(Unknown Source)
>> at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>> at java.io.ObjectInputStream.readObject0(Unknown Source)
>> at java.io.ObjectInputStream.readObject(Unknown Source)
>> at
>> org.eclipse.net4j.util.io.ExtendedIOUtil.readObject(Extended IOUtil.java:176)
>>
>> at
>> org.eclipse.net4j.util.io.ExtendedIOUtil.readObject(Extended IOUtil.java:131)
>>
>> at
>> org.eclipse.net4j.util.io.ExtendedDataInputStream.readObject (ExtendedDataInputStream.java:46)
>>
>> at
>> org.eclipse.net4j.signal.RemoteExceptionIndication.indicatin g(RemoteExceptionIndication.java:46)
>>
>> at
>> org.eclipse.net4j.signal.Indication.doExtendedInput(Indicati on.java:55)
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
>> at org.eclipse.net4j.signal.Indication.execute(Indication.java: 49)
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source)
>> at java.lang.Thread.run(Unknown Source)
>> [ERROR] org.eclipse.net4j.util.container.FactoryNotFoundException:
>> Factory not found: org.eclipse.emf.cdo.server.repositories[default]
>> org.eclipse.net4j.signal.RemoteException:
>> org.eclipse.net4j.util.container.FactoryNotFoundException: Factory
>> not found: org.eclipse.emf.cdo.server.repositories[default]
>> at
>> org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteEx ception(RequestWithConfirmation.java:123)
>>
>> at
>> org.eclipse.net4j.signal.SignalProtocol.handleRemoteExceptio n(SignalProtocol.java:459)
>>
>> at
>> org.eclipse.net4j.signal.RemoteExceptionIndication.indicatin g(RemoteExceptionIndication.java:53)
>>
>> at
>> org.eclipse.net4j.signal.Indication.doExtendedInput(Indicati on.java:55)
>> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:317)
>> at org.eclipse.net4j.signal.Indication.execute(Indication.java: 49)
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:237)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:145)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source)
>> at java.lang.Thread.run(Unknown Source)
>> Caused by: org.eclipse.net4j.util.container.FactoryNotFoundException:
>> Factory not found: org.eclipse.emf.cdo.server.repositories[default]
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getFactory (ManagedContainer.java:188)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.createElem ent(ManagedContainer.java:474)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:270)
>>
>> at
>> org.eclipse.net4j.util.container.ManagedContainer.getElement (ManagedContainer.java:255)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RepositoryFactory.get(Re positoryFactory.java:43)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.ContainerRepositoryProvi der.getRepository(ContainerRepositoryProvider.java:37)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.OpenSessionIndi cation.responding(OpenSessionIndication.java:85)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.responding(CDOServerIndication.java:151)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.doExtendedOu tput(IndicationWithResponse.java:96)
>>
>> at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:285)
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:65)
>>
>> ... 5 more
>>
>>
>> Thanks,
>>

--------------050809090904080301000800
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
One more comment:<br>
<br>
If you feel that the problem of repository-first-time-initialization
should be addressed in a more convenient and reusable way, feel free to
file an enhancement request. I could imagine an extension point driven
approach...<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<br>
<br>
<br>
Eike Stepper schrieb:
<blockquote cite="mid:ggitk3$fgl$1@build.eclipse.org" type="cite">
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
Kaab,<br>
<br>
Oh yes, it seems as if the repository is, at that time, in a state
between activation and registration with the container ;-(<br>
Please forget about my orevious hint with the lifecycle adapter. <br>
<br>
I think the best place to hook into is directly between the repository
registration and the (TCP) acceptor registration.<br>
During this time the repository is up and running but TCP connections
are not yet possible.<br>
<br>
It depends on how you start your server. Can you give a detailed
explanation how you are doing this?<br>
Have a look at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplicat ion: <br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; ">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = --><!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">


Re: CDO Loading packages at activation time [message #425429 is a reply to message #425422] Wed, 26 November 2008 07:31 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
Kaab,

As pointed out in my other reply, at the time the repository's ACTIVATED
event is broadcast the repository is activated but not locally available
in the container. The TCP acceptor is even not activated at this time,
which explains the "Connection refused" message. That's why I used a
temporary JVM acceptor/connector.

Cheers
/Eike

----
http://thegordian.blogspot.com



kaab schrieb:
> Hi again,
> I've tried the same method but using a TCP Connector, I always get
> connection refused, so I have some doubts on the ability to connect to
> the store when its in this state.
>
> [ERROR] Connection refused: no further information
> java.net.ConnectException: Connection refused: no further information
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
> at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
> at
> org.eclipse.net4j.internal.tcp.TCPConnector.handleConnect(TC PConnector.java:144)
>
> at
> org.eclipse.net4j.internal.tcp.TCPSelector.handleSelection(T CPSelector.java:245)
>
> at
> org.eclipse.net4j.internal.tcp.TCPSelector.run(TCPSelector.j ava:170)
> at java.lang.Thread.run(Unknown Source)
>
> thanks,
>


Re: CDO Loading packages at activation time [message #425453 is a reply to message #425428] Wed, 26 November 2008 15:34 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi Eike,

Thanks for your response, I've tried your new proposal, the connection and
the commit works well, but the store do not seem to be correctly
initiliazed. Once the store has been initialised and the client opens a
connections and tries to add our Ecore model to its registry, I get the
duplicate Package error :


java.lang.IllegalStateException: Duplicate package:
CDOPackage(URI=http://kdm.castortech.com/spec/KDM/1.0/action, name=action,
dynamic=true, metaIDRange=null,
parentURI=http://kdm.castortech.com/spec/KDM/1.0)
at
org.eclipse.emf.cdo.internal.common.model.CDOPackageManagerI mpl.addPackage(CDOPackageManagerImpl.java:123)
at
org.eclipse.emf.internal.cdo.util.ModelUtil.addCDOPackage(Mo delUtil.java:177)
at
org.eclipse.emf.internal.cdo.util.ModelUtil.addCDOPackage(Mo delUtil.java:181)
at
org.eclipse.emf.internal.cdo.util.ModelUtil.getCDOPackage(Mo delUtil.java:155)
at
org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl.put (CDOPackageRegistryImpl.java:131)
at
org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl.put EPackage(CDOPackageRegistryImpl.java:107)
at
org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl.put EPackage(CDOPackageRegistryImpl.java:99)
at
org.eclipse.emf.cdo.internal.ui.actions.RegisterPackagesActi on.doRun(RegisterPackagesAction.java:68)
at
org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

This is the same problem as the one I had before when I was putting
cdoPackages directly into the PackageManager.

Any advice would be great,

Thanks again,
Re: CDO Loading packages at activation time [message #425463 is a reply to message #425453] Wed, 26 November 2008 19:09 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
Kaab,

You only need to initialize the package registry manually with packages
that are not yet committed to the repository.
Once they are committed all packages registries in the network are
automatically configured with it.
Doing so again will lead to an exceptin as you noticed.

Cheers
/Eike

----
http://thegordian.blogspot.com



kaab schrieb:
> Hi Eike,
> Thanks for your response, I've tried your new proposal, the connection
> and the commit works well, but the store do not seem to be correctly
> initiliazed. Once the store has been initialised and the client opens
> a connections and tries to add our Ecore model to its registry, I get
> the duplicate Package error :
>
>
> java.lang.IllegalStateException: Duplicate package:
> CDOPackage(URI=http://kdm.castortech.com/spec/KDM/1.0/action,
> name=action, dynamic=true, metaIDRange=null,
> parentURI=http://kdm.castortech.com/spec/KDM/1.0)
> at
> org.eclipse.emf.cdo.internal.common.model.CDOPackageManagerI mpl.addPackage(CDOPackageManagerImpl.java:123)
>
> at
> org.eclipse.emf.internal.cdo.util.ModelUtil.addCDOPackage(Mo delUtil.java:177)
>
> at
> org.eclipse.emf.internal.cdo.util.ModelUtil.addCDOPackage(Mo delUtil.java:181)
>
> at
> org.eclipse.emf.internal.cdo.util.ModelUtil.getCDOPackage(Mo delUtil.java:155)
>
> at
> org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl.put (CDOPackageRegistryImpl.java:131)
>
> at
> org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl.put EPackage(CDOPackageRegistryImpl.java:107)
>
> at
> org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl.put EPackage(CDOPackageRegistryImpl.java:99)
>
> at
> org.eclipse.emf.cdo.internal.ui.actions.RegisterPackagesActi on.doRun(RegisterPackagesAction.java:68)
>
> at
> org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
> This is the same problem as the one I had before when I was putting
> cdoPackages directly into the PackageManager.
>
> Any advice would be great,
> Thanks again,


Re: CDO Loading packages at activation time [message #425523 is a reply to message #425463] Sat, 29 November 2008 19:58 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi Eike,

Sorry to get back you late, I was working on something else.

You're right about the fact that I write packages twice. But after the
first commit they are not correctly or fully distributed to my CDO Client,
if I try to commit ressource to the server without manually registering
the Packages, I get : Generated Package Locally not available, this is why
I re-registred again thinking that it is necessary, I'm really sorry about
that.

In the Package Manager view of the CDOClient UI, Packages appear as follow
:


Package Reg Repo
http://kdm.castortech.com/spec/KDM/1.0/code | ? | STATIC

Normally they appear as DYNAMIC instead of ?.


Hereby the corresponding stacktrace when I try to commit without manual
registration :

org.eclipse.emf.cdo.common.util.CDOException: Generated package locally
not available: http://kdm.castortech.com/spec/KDM/1.0/kdm
at
org.eclipse.emf.internal.cdo.util.ModelUtil.createEPackage(M odelUtil.java:333)
at
org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl$Rem otePackageDescriptor.getEPackage(CDOPackageRegistryImpl.java :178)
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:133)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2442)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2407)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1285)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1454)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:83)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDriver.scanRootElementHook(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$PrologDriver.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1444)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1240)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at
org.eclipse.emf.cdo.internal.ui.actions.ImportResourceAction .doRun(ImportResourceAction.java:89)
at
org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


I'm a little bit confused about the DYNAMIC, STATIC status, it used to be
dynamic after the first commit with CDOClient UI. Please can you provide
me with more information about how packages are distributed to clients,
till now when I was doing my tests, every time I connect using a new
client, I re-resgitered the packages to the client registry without having
any problem, if I don't do so, the client would not operate correctly.

Thanks,
Re: CDO Loading packages at activation time [message #425533 is a reply to message #425523] Mon, 01 December 2008 10:01 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
Kaab,

In the 2.0 stream we recently changed the handling of missing generated
packages at the client side. The new strategy is: If the package
originally committed was a generated one then a generated package with
the same nsURI and structure must be available on the other clients as
well. In other words, we no longer create dynamic packages for missing
generated packages.

As a consequence you must either deploy a generated package to all your
clients, or initially commit a dynamic package to the repository.

Cheers
/Eike

----
http://thegordian.blogspot.com


kaab schrieb:
> Hi Eike,
> Sorry to get back you late, I was working on something else.
> You're right about the fact that I write packages twice. But after the
> first commit they are not correctly or fully distributed to my CDO
> Client, if I try to commit ressource to the server without manually
> registering the Packages, I get : Generated Package Locally not
> available, this is why I re-registred again thinking that it is
> necessary, I'm really sorry about that.
>
> In the Package Manager view of the CDOClient UI, Packages appear as
> follow :
>
> Package Reg Repo
> http://kdm.castortech.com/spec/KDM/1.0/code | ? | STATIC
> Normally they appear as DYNAMIC instead of ?.
>
>
> Hereby the corresponding stacktrace when I try to commit without
> manual registration :
> org.eclipse.emf.cdo.common.util.CDOException: Generated package
> locally not available: http://kdm.castortech.com/spec/KDM/1.0/kdm
> at
> org.eclipse.emf.internal.cdo.util.ModelUtil.createEPackage(M odelUtil.java:333)
>
> at
> org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl$Rem otePackageDescriptor.getEPackage(CDOPackageRegistryImpl.java :178)
>
> at
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl.getEPackage( EPackageRegistryImpl.java:133)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2442)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2407)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1285)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1454)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:83)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:167)
>
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDriver.scanRootElementHook(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$PrologDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1444)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1240)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>
> at
> org.eclipse.emf.cdo.internal.ui.actions.ImportResourceAction .doRun(ImportResourceAction.java:89)
>
> at
> org.eclipse.net4j.util.ui.actions.LongRunningAction$1.run(Lo ngRunningAction.java:164)
>
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
>
> I'm a little bit confused about the DYNAMIC, STATIC status, it used to
> be dynamic after the first commit with CDOClient UI. Please can you
> provide me with more information about how packages are distributed to
> clients, till now when I was doing my tests, every time I connect
> using a new client, I re-resgitered the packages to the client
> registry without having any problem, if I don't do so, the client
> would not operate correctly.
>
> Thanks,
>
>
>
>


Re: CDO Loading packages at activation time [message #425553 is a reply to message #425533] Mon, 01 December 2008 14:53 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi Eike,

Thanks for your rapid response as always. Comments below :

> Kaab,

> In the 2.0 stream we recently changed the handling of missing generated
> packages at the client side. The new strategy is: If the package
> originally committed was a generated one then a generated package with
> the same nsURI and structure must be available on the other clients as
> well.

What happens if they're not ? When I try committing a model that conforms
to the initiliazed ecore model (KDM) (commited to the store on init)
without resgitering the packages with the clients, I get Generated Package
not Available locally as stated in my last post.


> In other words, we no longer create dynamic packages for missing
> generated packages.

> As a consequence you must either deploy a generated package to all your
> clients, or initially commit a dynamic package to the repository.

That's exactly what I do. On store initilisation, on the place you have
pointed to and other places on the code I've tried, I do a dummy commit of
a simple EOBject of each package to the repository but this does not seem
to be enough as it causing the
org.eclipse.emf.cdo.common.util.CDOException: Generated package locally
not available when a client tries to load or commit a model that conforms
to this initialized packages, the stacktrace is available in my last post.

I'm not sure if their is any misunderstanding with my last post, if that's
the case please let me know.

Cheers,

Thank you,
Re: CDO Loading packages at activation time [message #425555 is a reply to message #425553] Mon, 01 December 2008 14:57 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
kaab schrieb:
> Hi Eike,
> Thanks for your rapid response as always. Comments below :
>
>> Kaab,
>
>> In the 2.0 stream we recently changed the handling of missing
>> generated packages at the client side. The new strategy is: If the
>> package originally committed was a generated one then a generated
>> package with the same nsURI and structure must be available on the
>> other clients as well.
>
> What happens if they're not ? When I try committing a model that
> conforms to the initiliazed ecore model (KDM) (commited to the store
> on init) without resgitering the packages with the clients, I get
> Generated Package not Available locally as stated in my last post.
I'm not sure about the question because you obviously already discovered
what happens ;-)

>
>
>> In other words, we no longer create dynamic packages for missing
>> generated packages.
>
>> As a consequence you must either deploy a generated package to all
>> your clients, or initially commit a dynamic package to the repository.
>
> That's exactly what I do. On store initilisation, on the place you
> have pointed to and other places on the code I've tried, I do a dummy
> commit of a simple EOBject of each package to the repository but this
> does not seem to be enough as it causing the
> org.eclipse.emf.cdo.common.util.CDOException: Generated package
> locally not available when a client tries to load or commit a model
> that conforms to this initialized packages, the stacktrace is
> available in my last post.
I must double check this: Are you saying that you initially committed a
generated package to the repository and then other clients that have the
same generated package installed can not work with this model?

That would probably indicate some sort of bug...

Cheers
/Eike

----
http://thegordian.blogspot.com


>
> I'm not sure if their is any misunderstanding with my last post, if
> that's the case please let me know.
> Cheers,
>
> Thank you,
>
>
>


Re: CDO Loading packages at activation time [message #425571 is a reply to message #425555] Mon, 01 December 2008 19:31 Go to previous messageGo to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi again,

I had to reconfigure a new workspace to be sure that the error is not
coming for custom code from our side. The error probably comes from the
code I am using to do the initial commit but since it seems correct to me
I really don't know for now.

When using CDO server AS IS (no custom code) :

-> Doing a commit using CDOClient distributes packages to all other clients
and they can use them without the need to reimport, it's great :), I did not
know that actually. I also made sure that this works with our implemenation of
MemStore. No problem.

-> Doing a commit using code, initialisation code below (i'm sorry for the
formating), raises the error :

final IPluginContainer container = IPluginContainer.INSTANCE;
final IJVMAcceptor acceptor = JVMUtil.getAcceptor(container, "repo-init");
JVMConnector connector = (JVMConnector)JVMUtil.getConnector(container,
"repo-init");
final CDOSessionConfiguration config =
CDOUtil.createSessionConfiguration();
config.setConnector(connector);
config.setRepositoryName(repository.getName());
session = config.openSession();
session.getPackageRegistry().putEPackage(ActionPackage.eINST ANCE);
session.getPackageRegistry().putEPackage(BuildPackage.eINSTA NCE);
session.getPackageRegistry().putEPackage(CodePackage.eINSTAN CE);
session.getPackageRegistry().putEPackage(ConceptualPackage.e INSTANCE);
session.getPackageRegistry().putEPackage(CorePackage.eINSTAN CE);
session.getPackageRegistry().putEPackage(DataPackage.eINSTAN CE);
session.getPackageRegistry().putEPackage(EventPackage.eINSTA NCE);
session.getPackageRegistry().putEPackage(KdmPackage.eINSTANC E);
session.getPackageRegistry().putEPackage(PlatformPackage.eIN STANCE);
session.getPackageRegistry().putEPackage(SourcePackage.eINST ANCE);
session.getPackageRegistry().putEPackage(StructurePackage.eI NSTANCE);
session.getPackageRegistry().putEPackage(UiPackage.eINSTANCE );

final InternalCDOTransaction transaction =
(InternalCDOTransaction)session.openTransaction();
final CDOResource initResource =
transaction.getOrCreateResource("/KDMDummies");
initResource.getContents().add(BuildFactory.eINSTANCE.create BuildComponent());
initResource.getContents().add(ActionFactory.eINSTANCE.creat eActionElement());
initResource.getContents().add(CodeFactory.eINSTANCE.createC odeElement());
initResource.getContents().add(ConceptualFactory.eINSTANCE.c reateConceptualElement());
initResource.getContents().add(CoreFactory.eINSTANCE.createA ggregatedRelationship());
initResource.getContents().add(DataFactory.eINSTANCE.createC atalog());
initResource.getContents().add(EventFactory.eINSTANCE.create Event());
initResource.getContents().add(KdmFactory.eINSTANCE.createAt tribute());
initResource.getContents().add(PlatformFactory.eINSTANCE.cre ateMachine());
initResource.getContents().add(SourceFactory.eINSTANCE.creat eBinaryFile());
initResource.getContents().add(StructureFactory.eINSTANCE.cr eateSoftwareSystem());
initResource.getContents().add(UiFactory.eINSTANCE.createDis plays());
transaction.commit();
transaction.close();
session.close();
connector.close();
acceptor.close();


The code seems correct to me, so I don't know if it's bug or just that I
am making wrong use of something ?

Thanks,
Re: CDO Loading packages at activation time [message #425578 is a reply to message #425571] Mon, 01 December 2008 22:43 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6496
Registered: July 2009
Senior Member
Kaab,

I think we need to reproduce it. Can you please file a bugzilla and
attach the example code below?

Cheers
/Eike

----
http://thegordian.blogspot.com



kaab schrieb:
> Hi again,
> I had to reconfigure a new workspace to be sure that the error is not
> coming for custom code from our side. The error probably comes from
> the code I am using to do the initial commit but since it seems
> correct to me I really don't know for now.
>
> When using CDO server AS IS (no custom code) :
>
> -> Doing a commit using CDOClient distributes packages to all other
> clients and they can use them without the need to reimport, it's great
> :), I did not know that actually. I also made sure that this works
> with our implemenation of MemStore. No problem.
>
> -> Doing a commit using code, initialisation code below (i'm sorry for
> the formating), raises the error :
> final IPluginContainer container = IPluginContainer.INSTANCE;
> final IJVMAcceptor acceptor = JVMUtil.getAcceptor(container,
> "repo-init");
> JVMConnector connector = (JVMConnector)JVMUtil.getConnector(container,
> "repo-init");
> final CDOSessionConfiguration config =
> CDOUtil.createSessionConfiguration();
> config.setConnector(connector);
> config.setRepositoryName(repository.getName());
> session = config.openSession();
>
> session.getPackageRegistry().putEPackage(ActionPackage.eINST ANCE);
> session.getPackageRegistry().putEPackage(BuildPackage.eINSTA NCE);
> session.getPackageRegistry().putEPackage(CodePackage.eINSTAN CE);
> session.getPackageRegistry().putEPackage(ConceptualPackage.e INSTANCE);
> session.getPackageRegistry().putEPackage(CorePackage.eINSTAN CE);
> session.getPackageRegistry().putEPackage(DataPackage.eINSTAN CE);
> session.getPackageRegistry().putEPackage(EventPackage.eINSTA NCE);
> session.getPackageRegistry().putEPackage(KdmPackage.eINSTANC E);
> session.getPackageRegistry().putEPackage(PlatformPackage.eIN STANCE);
> session.getPackageRegistry().putEPackage(SourcePackage.eINST ANCE);
> session.getPackageRegistry().putEPackage(StructurePackage.eI NSTANCE);
> session.getPackageRegistry().putEPackage(UiPackage.eINSTANCE );
>
> final InternalCDOTransaction transaction =
> (InternalCDOTransaction)session.openTransaction();
> final CDOResource initResource =
> transaction.getOrCreateResource("/KDMDummies");
> initResource.getContents().add(BuildFactory.eINSTANCE.create BuildComponent());
>
> initResource.getContents().add(ActionFactory.eINSTANCE.creat eActionElement());
>
> initResource.getContents().add(CodeFactory.eINSTANCE.createC odeElement());
>
> initResource.getContents().add(ConceptualFactory.eINSTANCE.c reateConceptualElement());
>
> initResource.getContents().add(CoreFactory.eINSTANCE.createA ggregatedRelationship());
>
> initResource.getContents().add(DataFactory.eINSTANCE.createC atalog());
> initResource.getContents().add(EventFactory.eINSTANCE.create Event());
> initResource.getContents().add(KdmFactory.eINSTANCE.createAt tribute());
> initResource.getContents().add(PlatformFactory.eINSTANCE.cre ateMachine());
>
> initResource.getContents().add(SourceFactory.eINSTANCE.creat eBinaryFile());
>
> initResource.getContents().add(StructureFactory.eINSTANCE.cr eateSoftwareSystem());
>
> initResource.getContents().add(UiFactory.eINSTANCE.createDis plays());
> transaction.commit();
> transaction.close();
> session.close();
> connector.close();
> acceptor.close();
>
>
> The code seems correct to me, so I don't know if it's bug or just that
> I am making wrong use of something ?
>
> Thanks,
>
>
>
>
>


Re: CDO Loading packages at activation time [message #425585 is a reply to message #425578] Tue, 02 December 2008 16:08 Go to previous message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi Eike,

Bugzilla filled in : https://bugs.eclipse.org/bugs/show_bug.cgi?id=257217.

Thank you,

Cheers,
Previous Topic:[CDO] User ID on revision
Next Topic:Ecore2Java not working from CLI
Goto Forum:
  


Current Time: Thu May 28 02:41:34 GMT 2020

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

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

Back to the top