Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » how to use CDO dynamic ....?( Is there dynamic CDO?)
how to use CDO dynamic ....? [message #518434] Thu, 04 March 2010 06:12 Go to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
in the FAQ this question is answerd like this
Quote:

Is there dynamic CDO?
Yes. You can register dynamic EPackages with a CDOSession and commit them to the repository.
Note, that you can generally only register top-level packages with a CDO session.
Nested packages are registered implicitely if they have a namespace URI.


Ok the question is now how? or better what is wrong in the following code?
EPackage rootPackage = createRootPackage();
cdoSession.getPackageRegistry().putEPackage(rootPackage);
		
cdoResource = cdoTransaction.getOrCreateResource("/model");	
cdoResource.getContents().add(rootPackage);
		
cdoTransaction.commit();


becase this throw a
java.lang.IllegalStateException: Revision was not registered: CDOResource@OID1:0v2



The seconed question is how to create dynamic objects?
EFactory eFactory = eClass.getEPackage().getEFactoryInstance();
EObject newObject = eFactory.create(eClass);
cdoResource.getContents().add(newObject);


thows ...
 java.lang.IllegalArgumentException: Use CDOFactory to create dynamic object:org.eclipse.emf.ecore.impl.DynamicEObjectImpl@2ebade60 


So how to use CDOFactory?

Are there some CDO dynamic tutorials?

THX

Stephan

[Updated on: Thu, 04 March 2010 06:17]

Report message to a moderator

Re: how to use CDO dynamic ....? [message #518456 is a reply to message #518434] Thu, 04 March 2010 02:36 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 04.03.2010 07:13, schrieb Stephan Zehrer:
> in the FAQ this question is answerd like this
> Quote:
>> Is there dynamic CDO?
>> Yes. You can register dynamic EPackages with a CDOSession and commit
>> them to the repository. Note, that you can generally only register
>> top-level packages with a CDO session. Nested packages are registered
>> implicitely if they have a namespace URI.
>
>
>
> Ok the qestion is now how? or better what is wrong in the following code?
>
> EPackage rootPackage = createRootPackage();
> cdoSession.getPackageRegistry().putEPackage(rootPackage);
That looks good.

>
> cdoResource = cdoTransaction.getOrCreateResource("/model");
> cdoResource.getContents().add(rootPackage);
I don't think you want to add an EPackage to a resource, right?

>
> cdoTransaction.commit();
>
> becase this throw a java.lang.IllegalStateException: Revision was not
> registered: CDOResource@OID1:0v2
OID1 is generally the internal root resource of the resource (folder)
structure. Recently I fixed a problem in that area and possibly this
exception does not appear with the latest sources or builds. Can you
confirm this?


>
>
> The seconed question is how to create dynamic objects?
>
> EFactory eFactory = eClass.getEPackage().getEFactoryInstance();
> EObject newObject = eFactory.create(eClass);
This is shorter:

EObject newObject = EcoreUtil.create(eClass);

> cdoResource.getContents().add(newObject);
>
>
> thows ...
>
> java.lang.IllegalArgumentException: Use CDOFactory to create dynamic
> object:org.eclipse.emf.ecore.impl.DynamicEObjectImpl@2ebade60
>
> So how to use CDOFactory?
Usually the CDOPackageRegistry recognizes dynamic packages automatically
and replaces the EFactory instance. But you must ensure that you are
using that factory. So, after registering the package with the session
registry you can create new DynamicCDOObjectImpl instances. You can not
use instances with CDO that you created *before* the package was
registered with CDO!

>
> Are there some CDO dynamic tutorials?
I don't think so. Please feel free to add one to
http://wiki.eclipse.org/User_Contributed_CDO_Documentation ;-)

Cheers
/Eike

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


Re: how to use CDO dynamic ....? [message #518738 is a reply to message #518456] Thu, 04 March 2010 20:43 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
>> cdoResource = cdoTransaction.getOrCreateResource("/model");
>> cdoResource.getContents().add(rootPackage);
>I don't think you want to add an EPackage to a resource, right?
Why not?
Where else they will be stored?
How do I commit the "add" of my (root)Package on a session?

I my test code I have a transaction open but is this required for
the registration of a package?

Maybe some background infos:
In my current pure EMF implementation I have all my (dynamic) classes
definition in a "metamodel" resource and my objects several other resources.
No i try to migrate to CDO ...


>> cdoTransaction.commit();
>> becase this throw a java.lang.IllegalStateException: Revision was not
>> registered: CDOResource@OID1:0v2
>OID1 is generally the internal root resource of the resource (folder) structure. Recently I fixed a problem in that area and possibly this exception does not appear with the latest sources or builds. Can you confirm this?
Well now i updated on CDO 3.0.0v20100304-1006 but now run into this line (class EmbeddedClientSessionProtocol) (by calling openTransaction)

      // TODO: implement EmbeddedClientSessionProtocol.loadRevisions(infos, branchPoint, referenceChunk, prefetchDepth)
      throw new UnsupportedOperationException();


I there a better change if I go back to CDO 2.X?

>> EFactory eFactory = eClass.getEPackage().getEFactoryInstance();
>> EObject newObject = eFactory.create(eClass);
>This is shorter:
> EObject newObject = EcoreUtil.create(eClass);
Ok thx

>> So how to use CDOFactory?
>Usually the CDOPackageRegistry recognizes dynamic packages automatically and replaces the EFactory instance. But you must ensure that you are using that factory.
>So, after registering the package with the session registry you can create new DynamicCDOObjectImpl instances. You can not use instances with CDO that you created *before* the package was registered with CDO!
Ok .. but I think i have complied this order...


>I don't think so. Please feel free to add one to
>http://wiki.eclipse.org/User_Contributed_CDO_Documentation Wink
As far as it will work Smile

Re: how to use CDO dynamic ....? [message #518801 is a reply to message #518738] Fri, 05 March 2010 04:22 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090304040101030607030709
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Am 04.03.2010 21:43, schrieb Stephan Zehrer:
>>> cdoResource = cdoTransaction.getOrCreateResource("/model");
>>> cdoResource.getContents().add(rootPackage);
>> I don't think you want to add an EPackage to a resource, right?
> Why not?
Because there is no implementation of EPackage that implements
InternalCDOObject at the same time. In other word, Ecore itself is not a
CDO native model. Hence it can not be stored in CDOResources in a
repository. Please note that this will change very soon when Martin has
finished the implementation of our new "legacy" mode. That will allow
you to store non-native objects in CDO resources.

> Where else they will be stored? How do I commit the "add" of my
> (root)Package on a session?
Packages are committed implicitely, if needed. You just need to register
them with the session package registry and CDO will recognize if you're
going to commit objects of classes of these packages. Please note that
even the registration of needed packages happens automatically. Only in
the case of dynamic packages you need to do it *before* you even create
objects (because the CDOFactory has to be set).

>
> I my test code I have a transaction open but is this required for
> the registration of a package?
You can not commit packages if they are not needed by objects (in a
commit operation).

>
> Maybe some background infos:
> In my current pure EMF implementation I have all my (dynamic) classes
> definition in a "metamodel" resource and my objects several other
> resources. No i try to migrate to CDO ...
>
>>> cdoTransaction.commit();
>>> becase this throw a java.lang.IllegalStateException: Revision was
>>> not registered: mailto:CDOResource@OID1:0v2
>> OID1 is generally the internal root resource of the resource (folder)
>> structure. Recently I fixed a problem in that area and possibly this
>> exception does not appear with the latest sources or builds. Can you
>> confirm this?
> Well now i updated on CDO 3.0.0v20100304-1006 but now run into this
> line (class EmbeddedClientSessionProtocol) (by calling openTransaction)
>
> // TODO: implement
> EmbeddedClientSessionProtocol.loadRevisions(infos, branchPoint,
> referenceChunk, prefetchDepth)
> throw new UnsupportedOperationException();
>
> I there a better change if I go back to CDO 2.X?
No, CDO 3.0 is recommended. But the embedded session is not yet fully
implemented. It's work in progress that has been suspended in favour of
the branching support and offline mode work. I've added an
UnsupportedOperationException to the constructor of
EmbeddedClientSessionConfiguration to make this obvious a bit earlier in
your setup. Sorry for the inconvenience.

That said, you can already embed sessions via Net4j JVM transport. Just
create a normal CDONet4jSessionConfiguration and configure a JVMConnector:

| IAcceptor acceptor =
(IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors ",
"jvm", "myAcceptor");
IConnector connector =
(IConnector)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.connectors ",
"jvm", "myAcceptor");|

|
CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration();
configuration.setConnector(connector);
configuration.setRepositoryName(repositoryName);|



Cheers
/Eike

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


>
>>> EFactory eFactory = eClass.getEPackage().getEFactoryInstance();
>>> EObject newObject = eFactory.create(eClass);
>> This is shorter:
>> EObject newObject = EcoreUtil.create(eClass);
> Ok thx
>
>>> So how to use CDOFactory?
>> Usually the CDOPackageRegistry recognizes dynamic packages
>> automatically and replaces the EFactory instance. But you must ensure
>> that you are using that factory. So, after registering the package
>> with the session registry you can create new DynamicCDOObjectImpl
>> instances. You can not use instances with CDO that you created
>> *before* the package was registered with CDO!
> Ok .. but I think i have complied this order...
>
>
>> I don't think so. Please feel free to add one to
>> http://wiki.eclipse.org/User_Contributed_CDO_Documentation ;)
> As far as it will work :)
>
>

--------------090304040101030607030709
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 04.03.2010 21:43, schrieb Stephan Zehrer:
<blockquote cite="mid:hmp61r$1ml$1@build.eclipse.org" type="cite">
<blockquote type="cite">
<blockquote type="cite">cdoResource =
cdoTransaction.getOrCreateResource("/model");
<br>
cdoResource.getContents().add(rootPackage);
<br>
</blockquote>
I don't think you want to add an EPackage to a resource, right?
<br>
</blockquote>
Why not?
<br>
</blockquote>
Because there is no implementation of EPackage that implements
InternalCDOObject at the same time. In other word, Ecore itself is not
a CDO native model. Hence it can not be stored in CDOResources in a
repository. Please note that this will change very soon when Martin has
finished the implementation of our new "legacy" mode. That will allow
you to store non-native objects in CDO resources.<br>
<br>
<blockquote cite="mid:hmp61r$1ml$1@build.eclipse.org" type="cite">Where
else they will be stored? How do I commit the "add" of my (root)Package
on a session?
<br>
</blockquote>
Packages are committed implicitely, if needed. You just need to
register them with the session package registry and CDO will recognize
if you're going to commit objects of classes of these packages. Please
note that even the registration of needed packages happens
automatically. Only in the case of dynamic packages you need to do it
*before* you even create objects (because the CDOFactory has to be set).<br>
<br>
<blockquote cite="mid:hmp61r$1ml$1@build.eclipse.org" type="cite"><br>
I my test code I have a transaction open but is this required for
<br>
the registration of a package?
<br>
</blockquote>
You can not commit packages if they are not needed by objects (in a
commit operation).<br>
<br>
<blockquote cite="mid:hmp61r$1ml$1@build.eclipse.org" type="cite"><br>
Maybe some background infos:
<br>
In my current pure EMF implementation I have all my (dynamic) classes
definition in a "metamodel" resource and my objects several other
resources. No i try to migrate to CDO ... <br>
<br>
<blockquote type="cite">
<blockquote type="cite">cdoTransaction.commit();
<br>
becase this throw a java.lang.IllegalStateException: Revision was not
registered: <a class="moz-txt-link-freetext" href="mailto:CDOResource@OID1:0v2">mailto:CDOResource@OID1:0v2</a>
<br>
</blockquote>
OID1 is generally the internal root resource of the resource (folder)
structure. Recently I fixed a problem in that area and possibly this
exception does not appear with the latest sources or builds. Can you
confirm this?
<br>
</blockquote>
Well now i updated on CDO 3.0.0v20100304-1006 but now run into this
line (class EmbeddedClientSessionProtocol) (by calling openTransaction)
<br>
<br>
     // TODO: implement
EmbeddedClientSessionProtocol.loadRevisions(infos, branchPoint,
referenceChunk, prefetchDepth)
<br>
     throw new UnsupportedOperationException();
<br>
<br>
I there a better change if I go back to CDO 2.X?
<br>
</blockquote>
No, CDO 3.0 is recommended. But the embedded session is not yet fully
implemented. It's work in progress that has been suspended in favour of
the branching support and offline mode work. I've added an
UnsupportedOperationException to the constructor of
EmbeddedClientSessionConfiguration to make this obvious a bit earlier
in your setup. Sorry for the inconvenience.<br>
<br>
That said, you can already embed sessions via Net4j JVM transport. Just
create a normal CDONet4jSessionConfiguration and configure a
JVMConnector:<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=UTF-8">
<!-- ======================================================== -->
<!-- = 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">      </font><font
color="#000000">IAcceptor acceptor = </font><font color="#000000">(</font><font
color="#000000">IAcceptor</font><font color="#000000">)</font><font
color="#000000">IPluginContainer.INSTANCE.getElement</font ><font
color="#000000">(</font><font color="#2a00ff">"org.eclipse.net4j.acceptors"</font><font
color="#000000">, </font><font color="#2a00ff">"jvm"</font><font
color="#000000">, </font><font color="#2a00ff">"myAcceptor"</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">      </font><font color="#000000">IConnector connector = </font><font
color="#000000">(</font><font color="#000000">IConnector</font><font
color="#000000">)</font><font color="#000000">IPluginContainer.INSTANCE.getElement</font ><font
color="#000000">(</font><font color="#2a00ff">"org.eclipse.net4j.connectors"</font><font
color="#000000">, </font><font color="#2a00ff">"jvm"</font><font
color="#000000">, </font><font color="#2a00ff">"myAcceptor"</font><font
color="#000000">)</font><font color="#000000">;</font></code> </td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --> 
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td align="left" nowrap="nowrap" valign="top"><code><font
color="#ffffff">      </font><font color="#000000"> CDOSessionConfiguration configuration = CDONet4jUtil.crea teSessionConfiguration </font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff">      </font><font color="#000000">configuration.setConnector</font><font
color="#000000">(</font><font color="#000000">connector</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">      </font><font color="#000000">configuration.setRepositoryName</font><font
color="#000000">(</font><font color="#000000">repositoryName</font><font
color="#000000">)</font><font color="#000000">;</font></code> </td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== --><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>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
<blockquote cite="mid:hmp61r$1ml$1@build.eclipse.org" type="cite"><br>
<blockquote type="cite">
<blockquote type="cite">EFactory eFactory =
eClass.getEPackage().getEFactoryInstance();
<br>
EObject newObject = eFactory.create(eClass);
<br>
</blockquote>
This is shorter:
<br>
    EObject newObject = EcoreUtil.create(eClass);
<br>
</blockquote>
Ok thx
<br>
<br>
<blockquote type="cite">
<blockquote type="cite">So how to use CDOFactory?
<br>
</blockquote>
Usually the CDOPackageRegistry recognizes dynamic packages
automatically and replaces the EFactory instance. But you must ensure
that you are using that factory. So, after registering the package with
the session registry you can create new DynamicCDOObjectImpl instances.
You can not use instances with CDO that you created *before* the
package was registered with CDO!
<br>
</blockquote>
Ok .. but I think i have complied this order...
<br>
<br>
<br>
<blockquote type="cite">I don't think so. Please feel free to add one
to <a class="moz-txt-link-freetext" href="http://wiki.eclipse.org/User_Contributed_CDO_Documentation">http://wiki.eclipse.org/User_Contributed_CDO_Documentation</a> ;)
<br>
</blockquote>
As far as it will work :)
<br>
<br>
<br>
</blockquote>
</body>
</html>

--------------090304040101030607030709--


Re: how to use CDO dynamic ....? [message #519220 is a reply to message #518801] Mon, 08 March 2010 06:58 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
[quote title=Eike Stepper wrote on Thu, 04 March 2010 23:22]

>>> I don't think you want to add an EPackage to a resource, right?
>> Why not?
>Because there is no implementation of EPackage that implements InternalCDOObject at the same time. In other word, Ecore itself is not a CDO native model. Hence it can not be stored in CDOResources in a repository. Please note that this will change very soon when Martin has
>finished the implementation of our new "legacy" mode. That will allow you to store non-native objects in CDO resources.
Ok I will discuss this later cause I thought I was already able to do this with the Gastro Server and standard CDO UI Eclipse plugin.


>> Where else they will be stored? How do I commit the "add" of my
>> (root)Package on a session?
>Packages are committed implicitely, if needed. You just need to register them with the session package registry and CDO will recognize if you're going to commit objects of classes of these packages. Please note that
>even the registration of needed packages happens automatically. Only in the case of dynamic packages you need to do it *before* you even create objects (because the CDOFactory has to be set).
Ah ok ... maybe you should update your FAQ entry ...
Quote:

Yes. You can register dynamic EPackages with a CDOSession and commit them to the repository.



>> Well now i updated on CDO 3.0.0v20100304-1006 but now run into this
>> line (class EmbeddedClientSessionProtocol) (by calling openTransaction)
>>
>> // TODO: implement
>> EmbeddedClientSessionProtocol.loadRevisions(infos, branchPoint,
>> referenceChunk, prefetchDepth)
>> throw new UnsupportedOperationException();
>>
>> I there a better change if I go back to CDO 2.X?
>No, CDO 3.0 is recommended. But the embedded session is not yet fully implemented. It's work in progress that has been suspended in favour of the branching support and offline mode work. I've added an
>UnsupportedOperationException to the constructor of EmbeddedClientSessionConfiguration to make this obvious a bit earlier in your setup. Sorry for the inconvenience.

>That said, you can already embed sessions via Net4j JVM transport. Just create a normal CDONet4jSessionConfiguration and configure a JVMConnector:

>| IAcceptor acceptor =
>(IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors ",
>"jvm", "myAcceptor");
>IConnector connector =
>(IConnector)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.connectors ",
>"jvm", "myAcceptor");|
>|
>CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration();
>configuration.setConnector(connector);
>configuration.setRepositoryName(repositoryName);|
>> I don't think so. Please feel free to add one to
>> http://wiki.eclipse.org/User_Contributed_CDO_Documentation Wink

Ok now I wrote some (standalone) example code
http://wiki.eclipse.org/CDO_Embedded

I am using a container wired configuration. I is required to use 2 containers?
Because I run into this problem ...
Exception in thread "main" java.lang.UnsupportedOperationException
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(ResourceImpl.java:1438)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1406)
	at org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EMFUtil.java:250)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEPackageBytes(MetaDataManager.java:201)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:227)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:267)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:158)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:573)
	at org.eclipse.emf.cdo.internal.server.Repository.initSystemPackages(Repository.java:1073)
	at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1036)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:70)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:98)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:88)
	at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:90)
	at StandaloneCDODynamic.run(StandaloneCDODynamic.java:73)
	at StandaloneCDODynamic.main(StandaloneCDODynamic.java:61)
Re: how to use CDO dynamic ....? [message #519230 is a reply to message #519220] Mon, 08 March 2010 03:18 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 08.03.2010 07:58, schrieb Stephan Zehrer:
>> Packages are committed implicitely, if needed. You just need to
>> register them with the session package registry and CDO will
>> recognize if you're going to commit objects of classes of these
>> packages. Please note that even the registration of needed packages
>> happens automatically. Only in the case of dynamic packages you need
>> to do it *before* you even create objects (because the CDOFactory has
>> to be set).
>
> Ah ok ... maybe you should update your FAQ entry ...
Done:
http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#IllegalArgumen tException:_Use_CDOFactory_to_create_dynamic_object

>
> Ok now I wrote some (standalone) example code
> http://wiki.eclipse.org/CDO_Embedded
Thank you! I added some sentences...

>
> I am using a container wired configuration. I is required to use 2
> containers?
No.

> Because I run into this problem ...
>
> Exception in thread "main" java.lang.UnsupportedOperationException
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso urceImpl.java:1438)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406)
>
> at
> org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EM FUtil.java:250)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEP ackageBytes(MetaDataManager.java:201)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:227)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:267)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.write PackageUnits(MetaDataManager.java:158)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write PackageUnits(DBStoreAccessor.java:573)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.initSystemPac kages(Repository.java:1073)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:1036)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:70)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:98)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:88)
>
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:90)
>
> at StandaloneCDODynamic.run(StandaloneCDODynamic.java:73)
> at StandaloneCDODynamic.main(StandaloneCDODynamic.java:61)
That looks like something we haven't considered for dynamic packages. Is
it possible that you provide the used package and ideally the code
you're using?

Cheers
/Eike

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


Re: how to use CDO dynamic ....? [message #519417 is a reply to message #519230] Mon, 08 March 2010 18:28 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
[quote title=Eike Stepper wrote on Sun, 07 March 2010 22:18]Am
> http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#IllegalArgumen tException:_Use_CDOFactory_to_create_dynamic_object

I meant this question
Quote:
Is there dynamic CDO? Yes. You can register dynamic EPackages with a CDOSession and commit them to the repository.


I found the comment regarding commit of packages misleading, therefore I ask how to how I can do it.
Whats like :
Yes. You can register dynamic EPackages with a CDOSession and afterward commit new related objects to the repository.

>> http://wiki.eclipse.org/CDO_Embedded
>Thank you! I added some sentences...
Ohh thx

>> Because I run into this problem ...
>>
>> Exception in thread "main" java.lang.UnsupportedOperationException
>> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso urceImpl.java:1438)
>> ....
>> at StandaloneCDODynamic.run(StandaloneCDODynamic.java:73)
>> at StandaloneCDODynamic.main(StandaloneCDODynamic.java:61)
>>
>That looks like something we haven't considered for dynamic packages. Is it possible that you provide the used package and ideally the code
>you're using?
ok sorry seems my statement was not clear, the example produces this exceptions in line 73:
CDOServerUtil.addRepository(container, cdoRepository);


Do you have an idea?

T.G.I.F
Stephan
Re: how to use CDO dynamic ....? [message #519436 is a reply to message #519417] Mon, 08 March 2010 19:40 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 08.03.2010 19:28, schrieb Stephan Zehrer:
> [quote title=Eike Stepper wrote on Sun, 07 March 2010 22:18]Am
>> http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#IllegalArgumen tException:_Use_CDOFactory_to_create_dynamic_object
>>
>
> I meant this question
> Quote:
>> Is there dynamic CDO? Yes. You can register dynamic EPackages with a
>> CDOSession and commit them to the repository.
>
> I found the comment regarding commit of packages misleading, therefore
> I ask how to how I can do it.
> Whats like :
> Yes. You can register dynamic EPackages with a CDOSession and
> afterward commit new related objects to the repository.
I changed it:
http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#Is_there_dynam ic_CDO.3F

>>> http://wiki.eclipse.org/CDO_Embedded
>> Thank you! I added some sentences...
> Ohh thx
>
>>> Because I run into this problem ...
>>>
>>> Exception in thread "main" java.lang.UnsupportedOperationException
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso
>>> urceImpl.java:1438) ....
>>> at StandaloneCDODynamic.run(StandaloneCDODynamic.java:73)
>>> at StandaloneCDODynamic.main(StandaloneCDODynamic.java:61)
>>>
>> That looks like something we haven't considered for dynamic packages.
>> Is it possible that you provide the used package and ideally the code
>> you're using?
> ok sorry seems my statement was not clear,
> http://wiki.eclipse.org/CDO_Embedded produces this exceptions in line
> 73:
> CDOServerUtil.addRepository(container, cdoRepository);
Dinner is ready so I'll look into it tomorrow ;-)

Cheers
/Eike

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


>
> Do you have an idea?
>
> T.G.I.F
> Stephan


Re: how to use CDO dynamic ....? [message #519764 is a reply to message #519436] Tue, 09 March 2010 21:22 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
[quote title=Eike Stepper wrote on Mon, 08 March 2010 14:40]
>I changed it:
http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#Is_there_dynam ic_CDO.3F
Perfect

>> CDOServerUtil.addRepository(container, cdoRepository);
>Dinner is ready so I'll look into it tomorrow Wink
yes .. priorities are important ... my girlfried is calling Smile

T.G.I.F
Stephan
Re: how to use CDO dynamic ....? [message #519765 is a reply to message #519436] Tue, 09 March 2010 21:22 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
[quote title=Eike Stepper wrote on Mon, 08 March 2010 14:40]
>I changed it:
http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#Is_there_dynam ic_CDO.3F
Perfect

>> CDOServerUtil.addRepository(container, cdoRepository);
>Dinner is ready so I'll look into it tomorrow Wink
yes .. priorities are important ... my girlfriend is calling Smile

T.G.I.F
Stephan
Re: how to use CDO dynamic ....? [message #519831 is a reply to message #519417] Wed, 10 March 2010 06:15 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Stephan,

Your example code was missing this important piece of code:
CDONet4jServerUtil.prepareContainer(container);

But that didn't cause your problem. Although the stack trace you showed
is different, I found a bug in your snippet. You're calling
resource.eContents() instead of resource.getContents(). Read the JavaDoc
and you'll realize the small but important difference ;-)

I fixed your wiki article accordingly.

Cheers
/Eike

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




Am 08.03.2010 19:28, schrieb Stephan Zehrer:
> [quote title=Eike Stepper wrote on Sun, 07 March 2010 22:18]Am
>> http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#IllegalArgumen tException:_Use_CDOFactory_to_create_dynamic_object
>>
>
> I meant this question
> Quote:
>> Is there dynamic CDO? Yes. You can register dynamic EPackages with a
>> CDOSession and commit them to the repository.
>
> I found the comment regarding commit of packages misleading, therefore
> I ask how to how I can do it.
> Whats like :
> Yes. You can register dynamic EPackages with a CDOSession and
> afterward commit new related objects to the repository.
>>> http://wiki.eclipse.org/CDO_Embedded
>> Thank you! I added some sentences...
> Ohh thx
>
>>> Because I run into this problem ...
>>>
>>> Exception in thread "main" java.lang.UnsupportedOperationException
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso
>>> urceImpl.java:1438) ....
>>> at StandaloneCDODynamic.run(StandaloneCDODynamic.java:73)
>>> at StandaloneCDODynamic.main(StandaloneCDODynamic.java:61)
>>>
>> That looks like something we haven't considered for dynamic packages.
>> Is it possible that you provide the used package and ideally the code
>> you're using?
> ok sorry seems my statement was not clear,
> http://wiki.eclipse.org/CDO_Embedded produces this exceptions in line
> 73:
> CDOServerUtil.addRepository(container, cdoRepository);
>
> Do you have an idea?
>
> T.G.I.F
> Stephan


Re: how to use CDO dynamic ....? [message #520029 is a reply to message #519831] Wed, 10 March 2010 21:33 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
Hi Eike,

[quote title=Eike Stepper wrote on Wed, 10 March 2010 01:15]
>Your example code was missing this important piece of code:
>CDONet4jServerUtil.prepareContainer(container);
Ahh thx, well I already mentioned the problem of finding all relevent documentation.

In your Gastro Server Example you call first "addRepository" and afterwards "prepareContainer". But this will not fix the issue .. Sad

>But that didn't cause your problem. Although the stack trace you showed is different, I found a bug in your snippet. You're calling
>resource.eContents() instead of resource.getContents(). Read the JavaDoc and you'll realize the small but important difference Wink
Ups .. just a type I know the different but I never reach the point during debuging Smile

>I fixed your wiki article accordingly.
Thx but ... did you test it?
Because in my setup i still have the problem in the line

CDOServerUtil.addRepository(container, cdoRepository);

even I have added the CDONet4jServerUtil.prepareContainer(container); line.

It started to setup the database but agin this error
main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl] Registering http://www.eclipse.org/emf/2002/Ecore --> org.eclipse.emf.ecore.impl.EcorePackageImpl@2eda2cef (name: ecore) (nsURI: http://www.eclipse.org/emf/2002/Ecore, nsPrefix: ecore)
main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl] Registering http://www.eclipse.org/emf/CDO/Eresource/2.0.0 --> org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@d5c0f9 (name: eresource) (nsURI: http://www.eclipse.org/emf/CDO/Eresource/2.0.0, nsPrefix: eresource)
main [org.eclipse.emf.cdo.server.internal.db.MetaDataManager] Writing package unit: CDOPackageUnit[id=http://www.eclipse.org/emf/2002/Ecore, state=LOADED, type=LEGACY, originalType=LEGACY, timeStamp=Mar 10, 2010 22:11:20:139]
main [org.eclipse.net4j.db.DBUtil] INSERT IGNORE INTO cdo_package_units VALUES (?, ?, ?, ?)
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating DBStoreAccessor@20
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating SmartPreparedStatementCache@21
Exception in thread "main" java.lang.UnsupportedOperationException
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(ResourceImpl.java:1438)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1406)
	at org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EMFUtil.java:250)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEPackageBytes(MetaDataManager.java:201)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:227)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:267)
	at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:158)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:573)
	at org.eclipse.emf.cdo.internal.server.Repository.initSystemPackages(Repository.java:1073)
	at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1036)
	at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:70)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:98)
	at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:88)
	at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:90)
	at StandaloneCDODynamic.run(StandaloneCDODynamic.java:74)
	at StandaloneCDODynamic2.main(StandaloneCDODynamic2.java:62)





T.G.I.F
Stephan
Re: how to use CDO dynamic ....? [message #520082 is a reply to message #520029] Thu, 11 March 2010 06:09 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 10.03.2010 22:33, schrieb Stephan Zehrer:
> Hi Eike,
>
> [quote title=Eike Stepper wrote on Wed, 10 March 2010 01:15]
>> Your example code was missing this important piece of code:
>> CDONet4jServerUtil.prepareContainer(container);
> Ahh thx, well I already mentioned the problem of finding all relevent
> documentation.
>
> In your Gastro Server Example you call first "addRepository" and
> afterwards "prepareContainer". But this will not fix the issue .. :(

The background:

When a client opens a session through the Net4j protocol a new IChannel
through the IConnector is created and needs to be associated with the
CDO protocol on the server side. This protocol instance is the
"connection" between the Net4j channel and the repository. For this
purpose the server-side IConnector has a protocol factory configured
(contributed to the IManagedContainer with the
CDONet4jServerUtil.prepareContainer() call). That is the
CDOServerProtocolFactory. To find the appropriate repository this
factory needs an IRepositoryProvider. You can also create your own
provider that only knows the repository that you explicitely created.
But in the example you're using a container-based provider, i.e. one
that looks up the repository by name in the container. This is the
reason why you need both, the repository instance in the container and
the protocol factory *before* the first session is opened. The order of
these two calls is not relevant.

>> But that didn't cause your problem. Although the stack trace you
>> showed is different, I found a bug in your snippet. You're calling
>> resource.eContents() instead of resource.getContents(). Read the
>> JavaDoc and you'll realize the small but important difference ;)
> Ups .. just a type I know the different but I never reach the point
> during debuging :)
>
>> I fixed your wiki article accordingly.
> Thx but ... did you test it?
Yes, it worked nicely. I attached my console log.


> Because in my setup i still have the problem in the line
>
> CDOServerUtil.addRepository(container, cdoRepository);
>
> even I have added the CDONet4jServerUtil.prepareContainer(container);
> line.
> It started to setup the database but agin this error
>
> main
> [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl]
> Registering http://www.eclipse.org/emf/2002/Ecore -->
> org.eclipse.emf.ecore.impl.EcorePackageImpl@2eda2cef (name: ecore)
> (nsURI: http://www.eclipse.org/emf/2002/Ecore, nsPrefix: ecore)
> main
> [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl]
> Registering http://www.eclipse.org/emf/CDO/Eresource/2.0.0 -->
> org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@d5c0f9 (name:
> eresource) (nsURI: http://www.eclipse.org/emf/CDO/Eresource/2.0.0,
> nsPrefix: eresource)
> main [org.eclipse.emf.cdo.server.internal.db.MetaDataManager] Writing
> package unit: CDOPackageUnit[id=http://www.eclipse.org/emf/2002/Ecore,
> state=LOADED, type=LEGACY, originalType=LEGACY, timeStamp=Mar 10, 2010
> 22:11:20:139]
> main [org.eclipse.net4j.db.DBUtil] INSERT IGNORE INTO cdo_package_units
> VALUES (?, ?, ?, ?)
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating
> DBStoreAccessor@20
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating
> SmartPreparedStatementCache@21
> Exception in thread "main" java.lang.UnsupportedOperationException
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso urceImpl.java:1438)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406)
>
> at
> org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EM FUtil.java:250)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEP ackageBytes(MetaDataManager.java:201)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:227)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:267)
>
> at
> org.eclipse.emf.cdo.server.internal.db.MetaDataManager.write PackageUnits(MetaDataManager.java:158)
>
> at
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write PackageUnits(DBStoreAccessor.java:573)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.initSystemPac kages(Repository.java:1073)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:1036)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:70)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:98)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:88)
>
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:90)
>
> at StandaloneCDODynamic.run(StandaloneCDODynamic.java:74)
> at StandaloneCDODynamic2.main(StandaloneCDODynamic2.java:62)
This stack trace does not match latest HEAD. Can you retry with that?

Cheers
/Eike

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


Re: how to use CDO dynamic ....? [message #520274 is a reply to message #520082] Thu, 11 March 2010 19:19 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
[quote title=Eike Stepper wrote on Thu, 11 March 2010 01:09]
>> In your Gastro Server Example you call first "addRepository" and
>> afterwards "prepareContainer". But this will not fix the issue .. Sad

>The background:

>When a client opens a session through the Net4j protocol a new IChannel
>through the IConnector is created and needs to be associated with the
>CDO protocol on the server side. This protocol instance is the
>"connection" between the Net4j channel and the repository. For this
>purpose the server-side IConnector has a protocol factory configured
>(contributed to the IManagedContainer with the
>CDONet4jServerUtil.prepareContainer() call). That is the
>CDOServerProtocolFactory. To find the appropriate repository this
>factory needs an IRepositoryProvider. You can also create your own
>provider that only knows the repository that you explicitely created.
>But in the example you're using a container-based provider, i.e. one
>that looks up the repository by name in the container. This is the
>reason why you need both, the repository instance in the container and
>the protocol factory *before* the first session is opened. The order of
>these two calls is not relevant.

Well ... I will try to understand later Smile

>This stack trace does not match latest HEAD. Can you retry with that?
Well it seems my installation is still not correct.
I just updated the libs, but again still the issue.
I used the build from here

https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2

I added on the wiki page ( http://wiki.eclipse.org/CDO_Embedded) a list of my library versions.

It this source not similar to head?

But the good news, i have this problem only in the standalone version.
My Eclipse Plugin uses "IPluginContainer.INSTANCE" and here it works.

T.G.I.F.
Stephan
Re: how to use CDO dynamic ....? [message #520429 is a reply to message #520274] Fri, 12 March 2010 10:47 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Stephan,

I hope that you can compare what happens in OSGi and in stand-alone and
then see what's wrong.

Cheers
/Eike

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



Am 11.03.2010 20:19, schrieb Stephan Zehrer:
> [quote title=Eike Stepper wrote on Thu, 11 March 2010 01:09]
>>> In your Gastro Server Example you call first "addRepository" and
>>> afterwards "prepareContainer". But this will not fix the issue .. :(
>
>> The background:
>
>> When a client opens a session through the Net4j protocol a new
>> IChannel through the IConnector is created and needs to be associated
>> with the CDO protocol on the server side. This protocol instance is
>> the "connection" between the Net4j channel and the repository. For
>> this purpose the server-side IConnector has a protocol factory
>> configured (contributed to the IManagedContainer with the
>> CDONet4jServerUtil.prepareContainer() call). That is the
>> CDOServerProtocolFactory. To find the appropriate repository this
>> factory needs an IRepositoryProvider. You can also create your own
>> provider that only knows the repository that you explicitely created.
>> But in the example you're using a container-based provider, i.e. one
>> that looks up the repository by name in the container. This is the
>> reason why you need both, the repository instance in the container
>> and the protocol factory *before* the first session is opened. The
>> order of these two calls is not relevant.
>
> Well ... I will try to understand later :)
>
>> This stack trace does not match latest HEAD. Can you retry with that?
> Well it seems my installation is still not correct. I just updated the
> libs, but again still the issue.
> I used the build from here
> https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2
>
>
> I added on the wiki page ( http://wiki.eclipse.org/CDO_Embedded) a
> list of my library versions.
>
> It this source not similar to head?
>
> But the good news, i have this problem only in the standalone version.
> My Eclipse Plugin uses "IPluginContainer.INSTANCE" and here it works.
>
> T.G.I.F.
> Stephan


Re: how to use CDO dynamic ....? [message #522059 is a reply to message #520429] Fri, 19 March 2010 19:04 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
Hi Eike,

Eike Stepper wrote on Fri, 12 March 2010 05:47

I hope that you can compare what happens in OSGi and in stand-alone and
then see what's wrong.



No sorry .. still the same error in my standalone version.
Even with the latest update of today. (I updated the libraries on the wiki page) I could not find it yet ... it seems it throws the exception the following line

1163     writer.writePackageUnits(systemUnits, new Monitor());
of the class org.eclipse.emf.cdo.internal.server.Repository.

It seems for "org.eclipse.emf.cdo.server.db" there is no source code bundle.

In my Eclipse "embedded" version I run now in the following error
(with the same setup as in the wiki example):

java.lang.IllegalStateException: BranchingSupport of MappingStrategy and Store do not match. Please check configuration.
	at org.eclipse.net4j.util.CheckUtil.checkState(CheckUtil.java:50)


If "IRepository.Props.SUPPORTING_BRANCHES" is disabled it works.

Is the configuration of the example wrong?

T.G.I.F.
Stephan
Re: how to use CDO dynamic ....? [message #522075 is a reply to message #522059] Fri, 19 March 2010 19:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 19.03.2010 20:04, schrieb Stephan Zehrer:
> Hi Eike,
>
> Eike Stepper wrote on Fri, 12 March 2010 05:47
>> I hope that you can compare what happens in OSGi and in stand-alone
>> and then s what's wrong.
>
>
> No sorry .. still the same error in my standalone version.
> Even with the latest update of today. (I updated the libraries on the
> wiki page) I could not find it yet ... it seems it throws the
> exception the following line
That's odd. And I'm already packing for the EclipseCon and can not
investigate ;-(

>
>
> 1163 writer.writePackageUnits(systemUnits, new Monitor());
> of the class org.eclipse.emf.cdo.internal.server.Repository.
>
> It seems for "org.eclipse.emf.cdo.server.db" there is no source code
> bundle.
I can see org.eclipse.emf.cdo.server.db.source_3.0.0.v20100317-1547.ja r

>
> In my Eclipse "embedded" version I run now in the following error
> (with the same setup as in the wiki example):
>
> java.lang.IllegalStateException: BranchingSupport of MappingStrategy
> and Store do not match. Please check configuration.
> at org.eclipse.net4j.util.CheckUtil.checkState(CheckUtil.java:5 0)
Yes, we added a last minute hot fix that checks that the store
properties (SUPPORTING_BRANCHES) are in line with the adequate mapping
strategy.

>
>
> If "IRepository.Props.SUPPORTING_BRANCHES" is disabled it works.
>
> Is the configuration of the example wrong?
What example?


Cheers
/Eike

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


Re: how to use CDO dynamic ....? [message #522141 is a reply to message #522075] Sat, 20 March 2010 12:00 Go to previous messageGo to next message
Stephan Zehrer is currently offline Stephan ZehrerFriend
Messages: 42
Registered: July 2009
Member
Eike Stepper wrote on Fri, 19 March 2010 15:55

> No sorry .. still the same error in my standalone version.
> Even with the latest update of today. (I updated the libraries on the
> wiki page) I could not find it yet ... it seems it throws the
> exception the following line
That's odd. And I'm already packing for the EclipseCon and can not
investigate ;-(



No problem, it is just an example, not high prio.


Quote:

> It seems for "org.eclipse.emf.cdo.server.db" there is no source code
> bundle.
I can see org.eclipse.emf.cdo.server.db.source_3.0.0.v20100317-1547.ja r



Yes sorry ... was my mistake, forgot to update a library.

The error is in following method of MetaDataManager (cdo.server)
  private byte[] getEPackageBytes(InternalCDOPackageUnit packageUnit)
  {
    EPackage ePackage = packageUnit.getTopLevelPackageInfo().getEPackage();
    CDOPackageRegistry packageRegistry = getStore().getRepository().getPackageRegistry();
    return EMFUtil.getEPackageBytes(ePackage, ZIP_PACKAGE_BYTES, packageRegistry);
  }


Within the EMFUtil.getEPackageBytes(...) method a "resource.save ..." is called but in this case the related resource is a EMF resource where save is not implemented.

My feeling says in general this problem is related of a wrong or missing lib.
Is there somewhere a full list of required libs if you run CDO standalone?


Quote:
Yes, we added a last minute hot fix that checks that the store
properties (SUPPORTING_BRANCHES) are in line with the adequate mapping strategy.


Ok Smile

Quote:
> If "IRepository.Props.SUPPORTING_BRANCHES" is disabled it works.
> Is the configuration of the example wrong?
What example?

as usually http://wiki.eclipse.org/CDO_Embedded#Libraries Smile

Have fun in Santa Clara Smile

T.G.I.F.
Stephan
Re: how to use CDO dynamic ....? [message #522229 is a reply to message #522141] Sun, 21 March 2010 14:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Stephan,

It strikes me that your problem could be related with this one:

303466: CDO not robust when using dynamic packages
https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466

I suggest you start a discussion there with Jasper...

Cheers
/Eike

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



Am 20.03.2010 05:01, schrieb Stephan Zehrer:
> Eike Stepper wrote on Fri, 19 March 2010 15:55
>> > No sorry .. still the same error in my standalone version.
>> > Even with the latest update of today. (I updated the libraries on
>> the > wiki page) I could not find it yet ... it seems it throws the >
>> exception the following line
>> That's odd. And I'm already packing for the EclipseCon and can not
>> investigate ;-(
>
>
> No problem, it is just an example, not high prio.
>
>
> Quote:
>> > It seems for "org.eclipse.emf.cdo.server.db" there is no source
>> code > bundle.
>> I can see
>> org.eclipse.emf.cdo.server.db.source_3.0.0.v20100317-1547.ja r
>
>
> Yes sorry ... was my mistake, forgot to update a library.
>
> The error is in following method of MetaDataManager (cdo.server)
>
> private byte[] getEPackageBytes(InternalCDOPackageUnit packageUnit)
> {
> EPackage ePackage =
> packageUnit.getTopLevelPackageInfo().getEPackage();
> CDOPackageRegistry packageRegistry =
> getStore().getRepository().getPackageRegistry();
> return EMFUtil.getEPackageBytes(ePackage, ZIP_PACKAGE_BYTES,
> packageRegistry);
> }
>
>
> Within the EMFUtil.getEPackageBytes(...) method a "resource.save ..."
> is called but in this case the related resource is a EMF resource
> where save is not implemented.
>
> My feeling says in general this problem is related of a wrong or
> missing lib.
> Is there somewhere a full list of required libs if you run CDO
> standalone?
>
>
> Quote:
>> Yes, we added a last minute hot fix that checks that the store
>> properties (SUPPORTING_BRANCHES) are in line with the adequate
>> mapping strategy.
>
> Ok :)
>
> Quote:
>> > If "IRepository.Props.SUPPORTING_BRANCHES" is disabled it works.
>> > Is the configuration of the example wrong?
>> What example?
>
> as usually http://wiki.eclipse.org/CDO_Embedded#Libraries :)
>
> Have fun in Santa Clara :)
>
> T.G.I.F.
> Stephan


Re: how to use CDO dynamic ....? [message #545453 is a reply to message #518434] Wed, 07 July 2010 20:24 Go to previous messageGo to next message
Suzanne  is currently offline Suzanne Friend
Messages: 6
Registered: June 2010
Junior Member
Hi everyone

I want to embed a database into my application to avoid communication with the server and so improve performances.
I use the example CDO_Embedded (http://wiki.eclipse.org/CDO_Embedded)
The server begins starting,
but the same error as in the previous posts occurs in CDOServerUtil.addRepository.

main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl] Registering http://www.eclipse.org/emf/2002/Ecore --> org.eclipse.emf.ecore.impl.EcorePackageImpl@8c436b (name: ecore) (nsURI: http://www.eclipse.org/emf/2002/Ecore, nsPrefix: ecore)
main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl] Registering http://www.eclipse.org/emf/CDO/Eresource/2.0.0 --> org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@1094d48 (name: eresource) (nsURI: http://www.eclipse.org/emf/CDO/Eresource/2.0.0, nsPrefix: eresource)
main [org.eclipse.emf.cdo.server.internal.db.MetaDataManager] Writing package unit: CDOPackageUnit[id=http://www.eclipse.org/emf/2002/Ecore, state=LOADED, type=LEGACY, originalType=LEGACY, timeStamp=7 juil. 2010 17:25:13:467]
main [org.eclipse.net4j.db.DBUtil] INSERT IGNORE INTO cdo_package_units VALUES (?, ?, ?, ?)
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating DBStoreAccessor@20
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating SmartPreparedStatementCache@21
Exception in thread "main" java.lang.UnsupportedOperationException
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(ResourceImpl.java:1438)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1406)
        at org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EMFUtil.java:254)
        at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEPackageBytes(MetaDataManager.java:174)
        at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:201)
        at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillSystemTables(MetaDataManager.java:244)
        at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.writePackageUnits(MetaDataManager.java:106)
        at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writePackageUnits(DBStoreAccessor.java:552)
        at org.eclipse.emf.cdo.internal.server.Repository.initSystemPackages(Repository.java:1349)
        at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1312)
        at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
        at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:98)
        at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:88)
        at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:128)
        at javaTestAutomaton.EmbeddedServer.start(EmbeddedServer.java:85)
        at javaTestAutomaton.EmbeddedServer.<init>(EmbeddedServer.java:66)
        at javaTestAutomaton.EmbeddedServer.main(EmbeddedServer.java:70)


(the org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave function I have has only one instruction : "throw java.lang.UnsupportedOperationException" )

I don't understand what you mean by dynamic packages. Is that the option when migrating a genmodel to CDO or loading ePackages automatically in the data base only when needed.

Did you manage to solve the error in the previous posts ?
( I don't understand what is in https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466)
I think I don't need CDO dynamic. If this is the problem, how to remove it from CDO_Embedded example http://wiki.eclipse.org/CDO_Embedded ?

The problem seems due to ePackage.
When CDOServerUtil.addRepository(container, cdoRepository); is called, the cdoRepository's PackageRegistry is null. So I cannot put any ePackage instance in it. is that the problem ?


Thank you for your help

Suzanne





Re: how to use CDO dynamic ....? [message #545506 is a reply to message #545453] Thu, 08 July 2010 06:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020800070103020207090204
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Suzanne,

Comments below...

Cheers
/Eike

Contact: http://www.esc-net.de Blogger <http://thegordian.blogspot.com>Twitter <http://twitter.com/eikestepper>Linkedin <http://de.linkedin.com/in/eikestepper>Xing <http://www.xing.com/profile/Eike_Stepper>
Article: What exactly is inside that p2 repository? < http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html>


Am 07.07.2010 22:24, schrieb Suzanne:
> Hi everyone
>
> I want to embed a database into my application to avoid communication with the server and so improve performances.
> I use the example CDO_Embedded (http://wiki.eclipse.org/CDO_Embedded)
> The server begins starting,
> but the same error as in the previous posts occurs in CDOServerUtil.addRepository.
What version of CDO are you using?

>
> main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl] Registering http://www.eclipse.org/emf/2002/Ecore --> org.eclipse.emf.ecore.impl.EcorePackageImpl@8c436b (name: ecore) (nsURI: http://www.eclipse.org/emf/2002/Ecore, nsPrefix: ecore)
> main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl] Registering http://www.eclipse.org/emf/CDO/Eresource/2.0.0 --> org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@1094d48 (name: eresource) (nsURI: http://www.eclipse.org/emf/CDO/Eresource/2.0.0, nsPrefix: eresource)
> main [org.eclipse.emf.cdo.server.internal.db.MetaDataManager] Writing package unit: CDOPackageUnit[id=http://www.eclipse.org/emf/2002/Ecore, state=LOADED, type=LEGACY, originalType=LEGACY, timeStamp=7 juil. 2010 17:25:13:467]
Does your instance model (one of your client resources) contain instances of EModelElement, e.g. EClasses?

The legacy mode is only present in CDO 3.0 and must be explicitely enabled per CDOView/CDOTransaction: http://www.eclipse.org/cdo/documentation/relnotes_30/relnote s-3.0.html#Legacy_models_are_now_supported

Please note that we've not yet tested if the legacy mode supports instances of Ecore itself, as this is really a special case.


> main [org.eclipse.net4j.db.DBUtil] INSERT IGNORE INTO cdo_package_units VALUES (?, ?, ?, ?)
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating DBStoreAccessor@20
> main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating SmartPreparedStatementCache@21
> Exception in thread "main" java.lang.UnsupportedOperationException
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso urceImpl.java:1438)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406)
> at org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EM FUtil.java:254)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEP ackageBytes(MetaDataManager.java:174)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:201)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:244)
> at org.eclipse.emf.cdo.server.internal.db.MetaDataManager.write PackageUnits(MetaDataManager.java:106)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write PackageUnits(DBStoreAccessor.java:552)
> at org.eclipse.emf.cdo.internal.server.Repository.initSystemPac kages(Repository.java:1349)
> at org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:1312)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:72)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:98)
> at org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:88)
> at org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:128)
> at javaTestAutomaton.EmbeddedServer.start(EmbeddedServer.java:8 5)
> at javaTestAutomaton.EmbeddedServer.<init>(EmbeddedServer.java:66)
> at javaTestAutomaton.EmbeddedServer.main(EmbeddedServer.java:70 )
>
>
> (the org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave function I have has only one instruction : "throw java.lang.UnsupportedOperationException" )
>
> I don't understand what you mean by dynamic packages. Is that the option when migrating a genmodel to CDO or loading ePackages automatically in the data base only when needed.
No, it means that an EPackage is loaded directly from an .ecore file at runtime, without a code generation step.

>
> Did you manage to solve the error in the previous posts ?
> ( I don't understand what is in https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466)
Yes, according to https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466#c19 the fix is available in CDO 3.0 GA (Helios).

> I think I don't need CDO dynamic. If this is the problem, how to remove it from CDO_Embedded example http://wiki.eclipse.org/CDO_Embedded ?
>
> The problem seems due to ePackage.
I think the problem is that you're either having EModelElement instances in your resources or are using legacy models (dynamic or static/generated) in CDO pre-3.0, or both.

> When CDOServerUtil.addRepository(container, cdoRepository); is called, the cdoRepository's PackageRegistry is null. So I cannot put any ePackage instance in it. is that the problem ?
No, see above...



--------------020800070103020207090204
Content-Type: multipart/related;
boundary="------------030900060908090006010205"


--------------030900060908090006010205
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
Hi Suzanne,<br>
<br>
Comments below...<br>
<br>
<!--WISESTAMP_SIG_75934_START--><span style="color: black;">
<div dir="ltr">
<div>Cheers
<br>
/Eike
<br>
<br>
</div>
<div style="padding: 5px 0pt; font-family: arial,sans-serif;
font-size: 13.3px;"><span style="color: gray;">Contact: <a
href="http://www.esc-net.de">http://www.esc-net.de</a></span>
<a href="http://thegordian.blogspot.com" style="padding: 0pt
2px; color: blue; font-size: 10pt;" _service=""><img
src="cid:part1.02090804.06090402@esc-net.de" alt="Blogger"
style="vertical-align: middle; padding-bottom: 5px;"
border="0" height="16" width="16"></a><a
href="http://twitter.com/eikestepper" style="padding: 0pt
2px; color: blue; font-size: 10pt;" _service=""><img
src="cid:part2.01010706.06000600@esc-net.de" alt="Twitter"
style="vertical-align: middle; padding-bottom: 5px;"
border="0" height="16" width="16"></a><a
href="http://de.linkedin.com/in/eikestepper" style="padding:
0pt 2px; color: blue; font-size: 10pt;" _service=""><img
src="cid:part3.05050606.00070209@esc-net.de"
alt="Linkedin" style="vertical-align: middle;
padding-bottom: 5px;" border="0" height="16" width="16"></a><a
href="http://www.xing.com/profile/Eike_Stepper"
style="padding: 0pt 2px; color: blue; font-size: 10pt;"
_service=""><img
src="cid:part4.01000607.04070200@esc-net.de" alt="Xing"
style="vertical-align: middle; padding-bottom: 5px;"
border="0" height="16" width="16"></a></div>
<div style="color: gray; font-size: 13.3px; padding-bottom:
5px;">Article: <span style="color: blue; text-decoration:
underline;"><a
href=" http://thegordian.blogspot.com/2010/05/what-exactly-is-insid e-that-p2.html"
undefined="">What exactly is inside that p2 repository?</a></span></div>
</div>
</span><!--WISESTAMP_SIG_75934_END--><br>
<br>
Am 07.07.2010 22:24, schrieb Suzanne:
<blockquote cite="mid:i12np1$ef5$1@build.eclipse.org" type="cite">Hi
everyone
<br>
<br>
I want to embed a database into my application to avoid
communication with the server and so improve performances.
<br>
I use the example CDO_Embedded
(<a class="moz-txt-link-freetext" href="http://wiki.eclipse.org/CDO_Embedded">http://wiki.eclipse.org/CDO_Embedded</a>)
<br>
The server begins starting,
<br>
but the same error as in the previous posts occurs in
CDOServerUtil.addRepository. <br>
</blockquote>
What version of CDO are you using?<br>
<br>
<blockquote cite="mid:i12np1$ef5$1@build.eclipse.org" type="cite">
<br>
main
[org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl]
Registering <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2002/Ecore">http://www.eclipse.org/emf/2002/Ecore</a> --&gt;
org.eclipse.emf.ecore.impl.EcorePackageImpl@8c436b (name: ecore)
(nsURI: <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2002/Ecore">http://www.eclipse.org/emf/2002/Ecore</a>, nsPrefix: ecore)
<br>
main
[org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl]
Registering <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/CDO/Eresource/2.0.0">http://www.eclipse.org/emf/CDO/Eresource/2.0.0</a> --&gt;
org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@1094d48
(name: eresource) (nsURI:
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/CDO/Eresource/2.0.0">http://www.eclipse.org/emf/CDO/Eresource/2.0.0</a>, nsPrefix:
eresource)
<br>
main [org.eclipse.emf.cdo.server.internal.db.MetaDataManager]
Writing package unit:
CDOPackageUnit[id=<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2002/Ecore">http://www.eclipse.org/emf/2002/Ecore</a>,
state=LOADED, type=LEGACY, originalType=LEGACY, timeStamp=7 juil.
2010 17:25:13:467]
<br>
</blockquote>
Does your instance model (one of your client resources) contain
instances of EModelElement, e.g. EClasses?<br>
<br>
The legacy mode is only present in CDO 3.0 and must be explicitely
enabled per CDOView/CDOTransaction:
<a class="moz-txt-link-freetext" href=" http://www.eclipse.org/cdo/documentation/relnotes_30/relnote s-3.0.html#Legacy_models_are_now_supported"> http://www.eclipse.org/cdo/documentation/relnotes_30/relnote s-3.0.html#Legacy_models_are_now_supported</a><br>
<br>
Please note that we've not yet tested if the legacy mode supports
instances of Ecore itself, as this is really a special case.<br>
<br>
<br>
<blockquote cite="mid:i12np1$ef5$1@build.eclipse.org" type="cite">main
[org.eclipse.net4j.db.DBUtil] INSERT IGNORE INTO cdo_package_units VALUES
(?, ?, ?, ?)
<br>
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating
DBStoreAccessor@20
<br>
main [org.eclipse.net4j.util.lifecycle.Lifecycle] Deactivating
SmartPreparedStatementCache@21
<br>
Exception in thread "main" java.lang.UnsupportedOperationException
<br>
       at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave(Reso urceImpl.java:1438) <br>
       at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:1406) <br>
       at
org.eclipse.emf.cdo.common.model.EMFUtil.getEPackageBytes(EM FUtil.java:254) <br>
       at
org.eclipse.emf.cdo.server.internal.db.MetaDataManager.getEP ackageBytes(MetaDataManager.java:174) <br>
       at
org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:201) <br>
       at
org.eclipse.emf.cdo.server.internal.db.MetaDataManager.fillS ystemTables(MetaDataManager.java:244) <br>
       at
org.eclipse.emf.cdo.server.internal.db.MetaDataManager.write PackageUnits(MetaDataManager.java:106) <br>
       at
org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.write PackageUnits(DBStoreAccessor.java:552) <br>
       at
org.eclipse.emf.cdo.internal.server.Repository.initSystemPac kages(Repository.java:1349) <br>
       at
org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:1312) <br>
       at
org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:72)
<br>
       at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:98) <br>
       at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:88) <br>
       at
org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:128) <br>
       at
javaTestAutomaton.EmbeddedServer.start(EmbeddedServer.java:8 5)
<br>
       at
javaTestAutomaton.EmbeddedServer.&lt;init&gt;(Embedd edServer.java:66)
<br>
       at
javaTestAutomaton.EmbeddedServer.main(EmbeddedServer.java:70 )
<br>
<br>
<br>
(the org.eclipse.emf.ecore.resource.impl.ResourceImpl.doSave
function I have has only one instruction : "throw
java.lang.UnsupportedOperationException" )
<br>
<br>
I don't understand what you mean by dynamic packages. Is that the
option when migrating a genmodel to CDO or loading ePackages
automatically in the data base only when needed.
<br>
</blockquote>
No, it means that an EPackage is loaded directly from an .ecore file
at runtime, without a code generation step.<br>
<br>
<blockquote cite="mid:i12np1$ef5$1@build.eclipse.org" type="cite">
<br>
Did you manage to solve the error in the previous posts ?
<br>
( I don't understand what is in
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466">https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466</a>)
<br>
</blockquote>
Yes, according to
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466#c19">https://bugs.eclipse.org/bugs/show_bug.cgi?id=303466#c19</a> the fix is
available in CDO 3.0 GA (Helios).<br>
<br>
<blockquote cite="mid:i12np1$ef5$1@build.eclipse.org" type="cite">I
think I don't need CDO dynamic. If this is the problem, how to
remove it from CDO_Embedded example
<a class="moz-txt-link-freetext" href="http://wiki.eclipse.org/CDO_Embedded">http://wiki.eclipse.org/CDO_Embedded</a> ?
<br>
<br>
The problem seems due to ePackage.
<br>
</blockquote>
I think the problem is that you're either having EModelElement
instances in your resources or are using legacy models (dynamic or
static/generated) in CDO pre-3.0, or both.<br>
<br>
<blockquote cite="mid:i12np1$ef5$1@build.eclipse.org" type="cite">When
CDOServerUtil.addRepository(container, cdoRepository); is called,
the cdoRepository's PackageRegistry is null. So I cannot put any
ePackage instance in it. is that the problem ?
<br>
</blockquote>
No, see above...<br>
<br>
<br>
</body>
</html>

--------------030900060908090006010205
Content-Type: image/png;
name="blogger.png"
Content-Transfer-Encoding: base64
Content-ID: <part1.02090804.06090402@esc-net.de>
Content-Disposition: inline;
filename="blogger.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/I NwWK6QAAABl0
RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADkUExURf9xEv9m AP////9lAP+Q
SP9kAP9jAP9fAP9nAf9vD//x5/9hAP/iz/9iAP9eAP/s4P9vEP9yEv9qAP9q B/+LRP+we/90
I/+RSP/z6/+jZv/y6P+8kP/59f5yE//awf/Ttv9hAf9nAv/17v+4if9sC/9o BP+bWP/r3v/k
0v+wfP+QRv/o2f9gAP+OQ/93HP/l0/+0gv/Rsv/9/P/j0P+pcP+0hf/dx//D m//+/v+td/9o
AP+NQv/Yvf+zgv/x6P/q2/9xG//p2f9pAP/s3//8+fxxE//ex/+AK/9oCP/j 0f/Uuv///4Xw
StcAAABMdFJOU/////////////////////////////////////////////// ////////////
/////////////////////////////////////////wCejeTMAAAAsklEQVR4 2kSP1w6DMBAE
7cMGQg0hvffee++d//+f2IaIeTlppNXtIo88UAjxEIlhjCUG5lwJQuwoulqh FuUGcWGSiTF7
bt40EEoXBKtyIPQS5PffFqyHlhCS2obTK5kDmJ8lXxgA0zsPXer0L3zSUVmI D9ip3SC+hKwQ
2CxCtXYYL25gu1S8bf4jib5fTM+MNE079jom/+KwJUojwnAVifcQ46jM4M23 BHmkEK53iPcT
YACE/Q4KzoVQVwAAAABJRU5ErkJggg==
--------------030900060908090006010205
Content-Type: image/png;
name="twitter.png"
Content-Transfer-Encoding: base64
Content-ID: <part2.01010706.06000600@esc-net.de>
Content-Disposition: inline;
filename="twitter.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/ AP+gvaeTAAAA
CXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAABxUlE QVQ4y4WTMW4U
QRBFX3X3zoy8FgZphTCYAEg4gAPEYbgBJEgEXIALkHMfAjIwItnAAfLK2JYB r3dmuj7BzI5m
2WBLqqzq//q/fxt9NTmrzo7MCIhgRpWSsaMSgEta5czcjYtWTKPxfALZXTEE 2wmAxLXD11VL
BZy2MAuJB/iuA3oAoJb4lUUCVkAGTM5t06gjATMjBiPFaFsADvx1MTFoBd/q zHkMeLcLgCEe
JqjbrCJ1IAkghGDz20Z/XEzMMMTnZTsSYANMAl7fq7YlZOBaUCCk4WowwyRA mBmL7CxcmwDu
rh+rzKU71YhQ/dnr8VbiaRF4MgmbAAZkxJU7lRk3Wby5W3FcJlbSICAjZjFS jJ42rSXWgoWL
fYPfLvaCMTVxJ0XoJTmQ/stF6GPABDhzcepi7uJ74yQDuXcDErjjGhkwNvHx xCjMOMkCg3eX
S85zyVEMtGt24GWVxvsM5yi3+nBV8/7iBmJv0gaZQMZhNL4cHXBYdDkY7HQL vD0oebVfQuud
a8FGHSAaP1vnpMmbHgDEECwafLq/x8fZlGfJKCVKiapvXLyoEsdl3JYwBMpd uW1YEjlz4aMh
AY+iURiU/Vf/B6EE4kjfs5YLAAAAAElFTkSuQmCC
--------------030900060908090006010205
Content-Type: image/png;
name="linkedin.png"
Content-Transfer-Encoding: base64
Content-ID: <part3.05050606.00070209@esc-net.de>
Content-Disposition: inline;
filename="linkedin.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/ AP+gvaeTAAAA
CXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAQAAAAEABcxq3DAAACGklE QVQ4y6WTO2sU
URTHf3dmdp0kTnZJzErSrPjKYqNY2GljodhoLRLB1sLCD2DrZxAsfCAE/AaC grY+SBQSFTSC
xizGzZ3MTiYz92UxY5KNYuOBP+eew/3/73lwxfWHT9yjuR8YL0CwyxygAAPo Cqr0ntFcvjBB
cH++x8WzJzm8v/EnWVdks0PEgNWO95/XePD4HZ4ADk6MAhD6Hs26/08yBjwr ODrZBK0JADyv
LP7GsX2Evse9xR5Lsvgr+XfsO7ctoKwj9AWh7wEQIFCF+3sFGjCmgiJwQFwY Yge3X3cZrwXM
r2SDg9tJ1rokaw1alRXI3NAO61w60AAHTkE7qtNu1PjSUywsb3L60AgjNcHz hZgXb39WApoA
C3FqsIGjMxYC8OZbxlQU0GmFTLdCznWireV0pobYSDKevuzilMZDg0wN/cxu XdrMLVqX53TT
cu3OJ87cmmdlrQBgemoYKTMwqhSI+4Z0QMBhjANgcTnj1UdJHGd8Xc0AmBit Ecu0moGGODH0
h7cF8tyidSmgjSWWG6AUWpkypw1xLwXA4z8tQINcN/T3moEWtLZbr0mZQV5s 55RFJuU8RHR1
1iWtIzQ8nxOtIVCw9D2lWbM06w4ZZ8wtrEJRcLw9TDMUyKRg7kOPSHQR0ZVZ lyRjMDkOOVAU
FfLS57viHRaJLsHM+THuPtuDUgLTW2U0X672t47rrw82vOu/z9w8xS+MkDzV Boy6+QAAAABJ
RU5ErkJggg==
--------------030900060908090006010205
Content-Type: image/png;
name="xing.png"
Content-Transfer-Encoding: base64
Content-ID: <part4.01000607.04070200@esc-net.de>
Content-Disposition: inline;
filename="xing.png"

iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAAsT AAALEwEAmpwY
AAABsklEQVR42mP8//8/AymAEb+G1x9333hU9fffZy52ZTONrQQ0/P7z7sLd hJfvN7Mw80mL
ROkqTodqAIKvv379+fuXhZmZh50dpv7f49dLLt1LYWD4ryRZCETsrJIIDYdu 3y5fu16AizPE
0CTFzgoo8fPXoxPX/T9/v8DHbWCito6LXRHFDw/evnXpm3D39Ws1Eck9xVmy wqLP3/SevlXC
ysKtLtuoJFmMxdObL17ymzqN8S9LnZddua/VrUcWD149FRNwNFFby8oiiEXD itNnImfN5WTi
nBhu7Gvw5OLdiv+MQnqKU6WEI7AE6+vPnx17+68+fmGrJL0wRe/rl/jbL94r isfqKs1kZuJE
1/Dt16/27TtatmzjYeZcnuZpqnDi3J16FmZxYDhKCAViibiVp8+Ur1v39N0H X12DFRkJ33/u
O3LVk+E/i5xYqq7iNCwaXn769PLTZ0ZGBnFePjE+3j9/3155kPvk9XIudgV9 5XnCfI6Ek8a7
T4dO3vD4+++HlHC4kepywhr+/P0ITEIPXk5jZxXTVpgE1EY48X36euHs7fBv P+8CVespzYGH
FSOpyRsAAuDh4a3m5z0AAAAASUVORK5CYII=
--------------030900060908090006010205--

--------------020800070103020207090204--


Re: how to use CDO dynamic ....? [message #545616 is a reply to message #518434] Thu, 08 July 2010 12:42 Go to previous messageGo to next message
Suzanne  is currently offline Suzanne Friend
Messages: 6
Registered: June 2010
Junior Member
Hi Eike

Thank you for your answer.
I was using a CDO 3.0 version which contains more recent version of CDO plugin than http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/. So I did not install it.

I have downloaded the lastest CDO version from https:// build.eclipse.org/hudson/job/emf-cdo-integration/lastSuccess fulBuild/artifact/result/site.p2/ (#625) I still have the same problem.

For the legacy problem, I added CDOUtil.setLegacyModeDefault(true); before CDOServerUtil.addRepository(container, cdoRepository); just in case. But it did not change anything.

Quote:

Does your instance model (one of your client resources) contain instances of EModelElement, e.g. EClasses?

The legacy mode is only present in CDO 3.0 and must be explicitely enabled per CDOView/CDOTransaction: http://www.eclipse.org/cdo/documentation/relnotes_30/relnote s-3.0.html#Legacy_models_are_now_supported

Please note that we've not yet tested if the legacy mode supports instances of Ecore itself, as this is really a special case.


I don't create a model and I don't register any package before the error occurs. But the LifecycleUtil.activate(cdoRepository) function registers Ecore package and Eresource package.

main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl] Registering http://www.eclipse.org/emf/2002/Ecore --> org.eclipse.emf.ecore.impl.EcorePackageImpl@60029d (name: ecore) (nsURI: http://www.eclipse.org/emf/2002/Ecore, nsPrefix: ecore)
main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl] Registering http://www.eclipse.org/emf/CDO/Eresource/2.0.0 --> org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@157bf4c (name: eresource) (nsURI: http://www.eclipse.org/emf/CDO/Eresource/2.0.0, nsPrefix: eresource)


Maybe the function LifecycleUtil.activate(cdoRepository) create a resource with EModelElement and a wrong legacy. Is it possible to avoid that or change the Ecore package legacy ?

If the problem has been solved before, I may have a problem with my plugin version. Can you give me a configuration with which the CDO_Embedded example worked ?

A new problem occurs after installing https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/ (#625) :
when I run a CDO server (org.eclipse.emf.cdo.server.product), it seems to start correctly but I cannot open a session neither with my program nor with the CDO session view. A timeout Exception occurs. I did not modify the cdo-server.xml file, it was working well before the update .

Thank you for your help

Suzanne
Re: how to use CDO dynamic ....? [message #545669 is a reply to message #518434] Thu, 08 July 2010 14:49 Go to previous messageGo to next message
Suzanne  is currently offline Suzanne Friend
Messages: 6
Registered: June 2010
Junior Member
Quote:

A new problem occurs after installing https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/ (#625) :
when I run a CDO server (org.eclipse.emf.cdo.server.product), it seems to start correctly but I cannot open a session neither with my program nor with the CDO session view. A timeout Exception occurs. I did not modify the cdo-server.xml file, it was working well before the update .



This problem is due to plugin version mismatch : org.eclipse.emf.cdo.server.product is expecting org.gastro.server_1.0.0. and I have org.gastro.server_4.0.0.v20100702 .

Thank you for your help.

Suzanne
Re: how to use CDO dynamic ....? [message #546035 is a reply to message #545616] Sat, 10 July 2010 06:21 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040808080508050705010605
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Am 08.07.2010 14:42, schrieb Suzanne:
> Hi Eike
>
> Thank you for your answer.
> I was using a CDO 3.0 version which contains more recent version of CDO plugin than http://download.eclipse.org/modeling/emf/cdo/updates/3.0-rel eases/ So I did not install it.
> I have downloaded the lastest CDO version from https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/ (#625) I still have the same problem.
Because you removed the previous questions and answers and did not respond to the former posts directly it's hard for me to remember what your problem was ;-(

> For the legacy problem, I added CDOUtil.setLegacyModeDefault(true); before CDOServerUtil.addRepository(container, cdoRepository); just in case. But it did not change anything.
You better remove that, unless you really really want to use legacy models.

>
> Quote:
>> Does your instance model (one of your client resources) contain instances of EModelElement, e.g. EClasses?
>>
>> The legacy mode is only present in CDO 3.0 and must be explicitely enabled per CDOView/CDOTransaction: http://www.eclipse.org/cdo/documentation/relnotes_30/relnote s-3.0.html#Legacy_models_are_now_supported
>>
>> Please note that we've not yet tested if the legacy mode supports instances of Ecore itself, as this is really a special case.
>
> I don't create a model and I don't register any package before the error occurs. But the LifecycleUtil.activate(cdoRepository) function registers Ecore package and Eresource package.
>
>
> main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl] Registering http://www.eclipse.org/emf/2002/Ecore --> org.eclipse.emf.ecore.impl.EcorePackageImpl@60029d (name: ecore) (nsURI: http://www.eclipse.org/emf/2002/Ecore, nsPrefix: ecore)
> main [org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl] Registering http://www.eclipse.org/emf/CDO/Eresource/2.0.0 --> org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@157bf4c (name: eresource) (nsURI: http://www.eclipse.org/emf/CDO/Eresource/2.0.0, nsPrefix: eresource)
>
>
> Maybe the function LifecycleUtil.activate(cdoRepository) create a resource with EModelElement and a wrong legacy. Is it possible to avoid that or change the Ecore package legacy ?
No resources are created during activation of a repository.

>
> If the problem has been solved before, I may have a problem with my plugin version. Can you give me a configuration with which the CDO_Embedded example worked ?
Can you post a zip with a reproducible example?

>
> A new problem occurs after installing https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/ (#625) :
> when I run a CDO server (org.eclipse.emf.cdo.server.product), it seems to start correctly but I cannot open a session neither with my program nor with the CDO session view. A timeout Exception occurs. I did not modify the cdo-server.xml file, it was working well before the update .
Do you have a stack trace of the timeout exception? Usually the reason can be found there.


--------------040808080508050705010605
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
Am 08.07.2010 14:42, schrieb Suzanne:
<blockquote cite="mid:i14h39$7so$1@build.eclipse.org" type="cite">Hi
Eike
<br>
<br>
Thank you for your answer.
<br>
I was using a CDO 3.0 version which contains more recent version
of CDO plugin than
<a class="moz-txt-link-freetext" href=" http://download.eclipse.org/modeling/emf/cdo/updates/3.0-rel eases/"> http://download.eclipse.org/modeling/emf/cdo/updates/3.0-rel eases/</a>.
So I did not install it. <br>
I have downloaded the lastest CDO version from
<a class="moz-txt-link-freetext" href=" https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/"> https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/</a>
(#625) I still have the same problem. <br>
</blockquote>
Because you removed the previous questions and answers and did not
respond to the former posts directly it's hard for me to remember
what your problem was ;-(<br>
<br>
<blockquote cite="mid:i14h39$7so$1@build.eclipse.org" type="cite">For
the legacy problem, I added CDOUtil.setLegacyModeDefault(true);
before CDOServerUtil.addRepository(container, cdoRepository); just
in case. But it did not change anything.
<br>
</blockquote>
You better remove that, unless you really really want to use legacy
models.<br>
<br>
<blockquote cite="mid:i14h39$7so$1@build.eclipse.org" type="cite">
<br>
Quote:
<br>
<blockquote type="cite">Does your instance model (one of your
client resources) contain instances of EModelElement, e.g.
EClasses?
<br>
<br>
The legacy mode is only present in CDO 3.0 and must be
explicitely enabled per CDOView/CDOTransaction: 
<a class="moz-txt-link-freetext" href=" http://www.eclipse.org/cdo/documentation/relnotes_30/relnote"> http://www.eclipse.org/cdo/documentation/relnotes_30/relnote</a>
s-3.0.html#Legacy_models_are_now_supported
<br>
<br>
Please note that we've not yet tested if the legacy mode
supports instances of Ecore itself, as this is really a special
case.
<br>
</blockquote>
<br>
I don't create a model and I don't register any package before the
error occurs. But the  LifecycleUtil.activate(cdoRepository)
function registers Ecore package and Eresource package.
<br>
<br>
<br>
main
[org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl]
Registering <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2002/Ecore">http://www.eclipse.org/emf/2002/Ecore</a> --&gt;
org.eclipse.emf.ecore.impl.EcorePackageImpl@60029d (name: ecore)
(nsURI: <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2002/Ecore">http://www.eclipse.org/emf/2002/Ecore</a>, nsPrefix: ecore)
<br>
main
[org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistr yImpl]
Registering <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/CDO/Eresource/2.0.0">http://www.eclipse.org/emf/CDO/Eresource/2.0.0</a> --&gt;
org.eclipse.emf.cdo.eresource.impl.EresourcePackageImpl@157bf4c
(name: eresource) (nsURI:
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/CDO/Eresource/2.0.0">http://www.eclipse.org/emf/CDO/Eresource/2.0.0</a>, nsPrefix:
eresource)
<br>
<br>
<br>
Maybe the function LifecycleUtil.activate(cdoRepository) create a
resource with EModelElement and a wrong legacy. Is it possible to
avoid that or change the Ecore package legacy ?
<br>
</blockquote>
No resources are created during activation of a repository.<br>
<br>
<blockquote cite="mid:i14h39$7so$1@build.eclipse.org" type="cite">
<br>
If the problem has been solved before, I may have a problem with
my plugin version. Can you give me a configuration with which the
CDO_Embedded example worked ?
<br>
</blockquote>
Can you post a zip with a reproducible example?<br>
<br>
<blockquote cite="mid:i14h39$7so$1@build.eclipse.org" type="cite">
<br>
A new problem occurs after installing
<a class="moz-txt-link-freetext" href=" https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/"> https://build.eclipse.org/hudson/job/emf-cdo-integration/las tSuccessfulBuild/artifact/result/site.p2/</a>
(#625) :
<br>
when I run a CDO server (org.eclipse.emf.cdo.server.product), it
seems to start correctly but I cannot open a session neither with
my program nor with the CDO session view. A timeout Exception
occurs. I did not modify the cdo-server.xml file, it was working
well before the update .
<br>
</blockquote>
Do you have a stack trace of the timeout exception? Usually the
reason can be found there.<br>
<br>
</body>
</html>

--------------040808080508050705010605--


Previous Topic:EMF Model migration dilemma.
Next Topic:[CDO] Creating repositories
Goto Forum:
  


Current Time: Thu Mar 28 18:31:52 GMT 2024

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

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

Back to the top