Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Problem with package on CDO M4, but not on M3
[CDO] Problem with package on CDO M4, but not on M3 [message #1007037] Mon, 04 February 2013 08:23 Go to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
Hi,

I recently created a project with CDO M3 installed in Eclipse. I now updated to M4, but my application doesn't work anymore.

First it complained about this line:

session.getPackageRegistry().putEPackage(ModelPackage.eINSTANCE);
CDOPackageRegistryPopulator.populate(session.getPackageRegistry());


The error was that no packages can be added during runtime, so use setInitial.. instead. So I deleted the line and added this line in the clone:

repo.setInitialPackages(ModelPackage.eINSTANCE);


I Also tried adding it only in the server, but this makes no difference. I keep getting this error when saving my CDOResource:

Package not found: http://model/1.0


What am I doing wrong? This code was working in M3..? Or should I add the setInitial is both the clone and the server?
Re: [CDO] Problem with package on CDO M4, but not on M3 [message #1007040 is a reply to message #1007037] Mon, 04 February 2013 08:30 Go to previous messageGo to next message
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member
Well.. I tried to set the setInitialPackages in both the clone and server and now it works. Is this the way it suppose to be done from M4?
Re: [CDO] Problem with package on CDO M4, but not on M3 [message #1007041 is a reply to message #1007037] Mon, 04 February 2013 08:30 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 04.02.2013 09:24, schrieb Ricky de Klerck:
> Hi,
>
> I recently created a project with CDO M3 installed in Eclipse. I now updated to M4, but my application doesn't work
> anymore.
>
> First it complained about this line:
>
> session.getPackageRegistry().putEPackage(ModelPackage.eINSTANCE);
> CDOPackageRegistryPopulator.populate(session.getPackageRegistry());
>
> The error was that no packages can be added during runtime,
And the full stack trace?

> so use setInitial.. instead. So I deleted the line and added this line in the clone:
So, you're talking about an offline replication scenario?

>
> repo.setInitialPackages(ModelPackage.eINSTANCE);
>
> I Also tried adding it only in the server, but this makes no difference. I keep getting this error when saving my
> CDOResource:
>
> Package not found: http://model/1.0
And the full stack trace?

>
> What am I doing wrong? This code was working in M3..? Or should I add the setInitial is both the clone and the server?
Offline replication does not support the addition of packages to clones that have been synchronized with their master at
least once. That's why setInitialPackages() should be called on both master and clone *before* they're activated the
first time. After this first activation the call is ignored.

Cheers
/Eike

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


Re: [CDO] Problem with package on CDO M4, but not on M3 [message #1007044 is a reply to message #1007040] Mon, 04 February 2013 08:34 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 04.02.2013 09:30, schrieb Ricky de Klerck:
> Well.. I tried to set the setInitialPackages in both the clone and server and now it works. Is this the way it suppose
> to be done from M4?
It's always been supposed to be done this way. I remember that an actual check was added later. With full stack traces
it would be easier for me to tell exactly when and where.

Cheers
/Eike

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


Previous Topic:[CDO] using the testbed
Next Topic:EcoreUtil.copyAll and EMap
Goto Forum:
  


Current Time: Thu Apr 25 19:40:04 GMT 2024

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

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

Back to the top