Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Re: [CDO/Hibernate] Multiple issues
Re: [CDO/Hibernate] Multiple issues [message #420244] Tue, 24 June 2008 12:38 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Stefan,
Sorry to hear that you have all these issues.
Regarding issue 3 and 4, I checked this in cvs on the 15th of june. So this should be solved in the
next build, or can you cvs?
I also solved another issue related to cdopackage persistence. So maybe this is related to one of
your other issues....

btw, I cross-posted to the emf newsgroup because cdo is graduating/has graduated.

gr. Martin
Stefan Winkler wrote:
> Hi Eike, hi Martin,
>
> after a few weeks, I'm back from vacation and switched back to work mode
> this week.
> First, let me give my congratulations for the graduation.
>
> That said, I have persisting problems using CDO/Hibernate, some of which
> I have a workaround (which is ok but not satisfying), for some I don't.
>
> Here we go: (I updated to Ganymede (well, RC4 for now to be exact), and
> thus to CDO 1.0.0)
>
> Issue 1:
> Is it intentional that CDO does not run out of the box when downloaded
> binary as part of Ganymede?
>
> => Workaround: I have to copy the libraries to
> eclipse\plugins\org.eclipse.emf.cdo.server.hibernate.librari es_1.0.0.v200806111412\lib
>
>
>
> Issue 2:
> When starting up, I get a
>
> java.lang.NullPointerException
> at
> org.eclipse.core.internal.runtime.Activator.getURLConverter( Activator.java:313)
>
> at org.eclipse.core.runtime.FileLocator.resolve(FileLocator.jav a:186)
> at
> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>
> at
> org.eclipse.net4j.internal.util.bundle.AbstractBundle.getInp utStream(AbstractBundle.java:222)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.initConfiguration(HibernatePackageHandler.java:391 )
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.doActivate(HibernatePackageHandler.java:364)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .doActivate(HibernateStore.java:197)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:262)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>
> at test.cdo.classpath.Activator.getSession(Activator.java:84)
> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
> at test.cdo.classpath.Activator.getResource(Activator.java:113)
> at test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>
> because at
> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>
>
> URL entry = getBundleContext().getBundle().getEntry(".");
> //$NON-NLS-1$
>
> getEntry(".") returns null ...
>
> => Workaround: Imprt the Plug-In as source into the workspace
>
> Net4j util seems to not like CDO as JAR bundles...
>
>
> Issue 3:
>
> org.hibernate.MappingException: entity class not found:
> org.eclipse.emf.cdo.internal.protocol.model.CDOModelElementI mpl
> at
> org.hibernate.mapping.PersistentClass.getMappedClass(Persist entClass.java:99)
>
> at
> org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactor y.java:168)
> at
> org.hibernate.tuple.PropertyFactory.buildIdentifierProperty( PropertyFactory.java:44)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:124)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:434)
>
> at
> org.hibernate.persister.entity.JoinedSubclassEntityPersister . <init>(JoinedSubclassEntityPersister.java:91)
>
> at
> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:58)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1300)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getSessionFactory(HibernatePackageHandler.java:334 )
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageInfos(HibernatePackageHandler.java:292)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getCDOPackageInfos(HibernatePackageHandler.java:21 4)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readPackageInfos(HibernateStoreReader.java:79)
>
> at
> org.eclipse.emf.cdo.internal.server.PackageManager.doActivat e(PackageManager.java:72)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:263)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>
> at test.cdo.classpath.Activator.getSession(Activator.java:84)
> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
> at test.cdo.classpath.Activator.getResource(Activator.java:113)
> at test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>
> Refactoring problem?
>
> meta.hbm.xml reads
> <hibernate-mapping package="org.eclipse.emf.cdo.internal.protocol.model">
> but should be
> <hibernate-mapping package="org.eclipse.emf.cdo.internal.common.model">
> now?
>
> => Workaround: edit meta.hbm.xml (as described) -
> org.eclipse.emf.cdo.server.hibernate has been copied into workspace
> alreday (see issue 2)
>
>
> Issue 4:
>
> org.hibernate.MappingException: entity class not found:
> org.eclipse.emf.cdo.internal.common.model.CDOClassProxy
>
> This class seems not to exist any more ...
>
> => no workaround! => STOPPER
>
> Eike, Martin - can you please provide a working meta.hbm.xml file, so I
> can continue with 1.0?
>
>
> --- for now I'm comtinuing with my issues I have with 0.8.0 (as of end
> of June) and which I suspect to be in 1.0.0 still:
>
> Issue 5:
>
> When calling getOrCreateResource() in a plugin activator's start()
> method, I run into a deadlock.
>
> => Workaround: always do resource initialization lazyly
>
>
> Issue 6:
>
> EPackages only containing interfaces are not being taken by the package
> manager -> ClassRefs can not be resolved (see Bugzilla – Bug 230387)
>
> => Workaround: introduce Dummy class in the package in question and
> store one Dummy instance in the Database
>
>
> Issue 7:
>
> With all of these workarounds, I get to store and read my models in one
> session alright.
> However, when I close my application and reopen it, initialization fails
> consistently when trying to get the contents of a resource:
> getResource("/test").getContents() seems to not initialize the thread
> context variables on the server:
>
> [...]
> 24.06.2008 13:32:40 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
> INFO: schema update complete
> Thread-4 [debug] Setting session in threadlocal
> Thread-4 [debug.revision] Setting version for
> CDOResource@HBM-CDOResource-1v0: v1
> Thread-4 [debug] Stored hb list in threadlocal: CDOResource.contents
> Thread-4 [debug.session] Registering resource: HBM-CDOResource-1 <-->
> /my/test/resource
> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 03 01 00 00 00 01 00
> 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
> Thread-4 [debug] Releasing hibernate session
> main [debug.model] Reading CDOID of type 1 (OBJECT)
> Thread-4 [debug] Clearing session in threadlocal
> Thread-4 [debug] Removing hibernate session
> Thread-4 [debug] Closing hibernate session
> main [debug.protocol] Read ID: HBM-CDOResource-1
> [INFO] Legacy system not available
> main [debug.object] Setting ID: HBM-CDOResource-1
> main [debug.object] Setting view: CDOTransaction(1)
> main [debug.object] Setting state PROXY for CDOResource@HBM-CDOResource-1
> main [debug.object] PREPARE: CDOResource@HBM-CDOResource-1 -->
> CDOTransaction(1)
> main [debug.protocol] Writing path: /my/test/resource
> main [debug] Multiplexing 00 00 00 00 00 00 00 05 00 04 01 00 11 2f 6d
> 79 2f 74 65 73 74 2f 72 65 73 6f 75 72 63 65 00
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug.protocol] Read path: /my/test/resource
> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 04 01 00 00 00 01 00
> 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
> main [debug.model] Reading CDOID of type 1 (OBJECT)
> main [debug.protocol] Read ID: HBM-CDOResource-1
> main [debug.object] Setting ID: HBM-CDOResource-1
> main [debug.object] Setting view: CDOTransaction(1)
> Thread-4 [debug] Releasing hibernate session
> main [debug.view] Registering CDOResource@HBM-CDOResource-1
> Thread-4 [debug] Clearing session in threadlocal
> Thread-4 [debug] Removing hibernate session
> main [debug.object] ATTACH: CDOResource@HBM-CDOResource-1 -->
> CDOTransaction(1)
> main [debug.object] size(CDOResource@HBM-CDOResource-1, CDOFeature(ID=2,
> name=contents, type=OBJECT, referenceType=CDOClass(ID=0, name=CDOObject)))
> main [debug.object] READ:
> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl
> main [debug.protocol] Writing referenceChunk: -1
> main [debug.protocol] Writing 1 IDs
> main [debug.protocol] Writing ID: HBM-CDOResource-1
> main [debug.model] Writing CDOID of type 1 (OBJECT)
> main [debug] Multiplexing 00 00 00 00 00 00 00 06 00 07 00 00 00 00 00
> 00 00 01 01 00 00 00 01 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65
> 73 6f 75 72 63 65 00 00 00 00 00
> main [debug.protocol] Reading 1 revisions
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug.protocol] Read referenceChunk: -1
> Thread-4 [debug.protocol] Reading 1 IDs
> Thread-4 [debug.model] Reading CDOID of type 1 (OBJECT)
> Thread-4 [debug.protocol] Read ID: HBM-CDOResource-1
> Thread-4 [debug.protocol] Writing 1 revisions
> Thread-4 [debug] Releasing hibernate session
> Thread-4 [debug] Clearing session in threadlocal
> Thread-4 [debug] Removing hibernate session
> [ERROR] CommitContext not set
> java.lang.IllegalStateException: CommitContext not set
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateThrea dContext.getCommitContext(HibernateThreadContext.java:69)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil. getCDORevision(HibernateUtil.java:117)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readRevision(HibernateStoreReader.java:155)
>
> at
> org.eclipse.emf.cdo.internal.server.RevisionManager.loadRevi sion(RevisionManager.java:210)
>
> at
> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:282)
>
> at
> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:144)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.getRevision(LoadRevisionIndication.java:171)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.responding(LoadRevisionIndication.java:147)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:54)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> => no workaround => STOPPER!
>
>
> Should I open bugs for these issues?
> Can you provide quick fixes to my two stoppers?
>
>
> Cheers,
> Stefan


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO/Hibernate] Multiple issues [message #420249 is a reply to message #420244] Tue, 24 June 2008 13:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Stefan,

I'm answering to Martin's comment to reduce noise in the EMF newgroup.

Comments below...


Stefan Winkler schrieb:
> Hi Eike, hi Martin,
>
> after a few weeks, I'm back from vacation and switched back to work
> mode this week.
> First, let me give my congratulations for the graduation.
>
> That said, I have persisting problems using CDO/Hibernate, some of
> which I have a workaround (which is ok but not satisfying), for some I
> don't.
>
> Here we go: (I updated to Ganymede (well, RC4 for now to be exact),
> and thus to CDO 1.0.0)
>
> Issue 1:
> Is it intentional that CDO does not run out of the box when downloaded
> binary as part of Ganymede?
>
> => Workaround: I have to copy the libraries to
> eclipse\plugins\org.eclipse.emf.cdo.server.hibernate.librari es_1.0.0.v200806111412\lib
>
Yes, unfortunately it's currently intentional since we are not allowed
to ship non EPL compatible stuff and we didn't find a better way so far
to use 3rd party components like Hibernate. Can you please open an
enhancement request where we can discuss alternative approaches. The EMO
legal department will want to have a chance to review possible
solutions, too.


> Issue 2:
> When starting up, I get a
>
> java.lang.NullPointerException
> at
> org.eclipse.core.internal.runtime.Activator.getURLConverter( Activator.java:313)
>
> at org.eclipse.core.runtime.FileLocator.resolve(FileLocator.jav a:186)
> at
> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>
> at
> org.eclipse.net4j.internal.util.bundle.AbstractBundle.getInp utStream(AbstractBundle.java:222)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.initConfiguration(HibernatePackageHandler.java:391 )
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.doActivate(HibernatePackageHandler.java:364)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .doActivate(HibernateStore.java:197)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:262)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>
> at test.cdo.classpath.Activator.getSession(Activator.java:84)
> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
> at test.cdo.classpath.Activator.getResource(Activator.java:113)
> at
> test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>
> because at
> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>
>
> URL entry = getBundleContext().getBundle().getEntry(".");
> //$NON-NLS-1$
>
> getEntry(".") returns null ...
>
> => Workaround: Imprt the Plug-In as source into the workspace
>
> Net4j util seems to not like CDO as JAR bundles...
I digged a bit but have no explanation so far. Please open a Bugzilla so
that you can track progress.


> Issue 3:
>
> org.hibernate.MappingException: entity class not found:
> org.eclipse.emf.cdo.internal.protocol.model.CDOModelElementI mpl
> at
> org.hibernate.mapping.PersistentClass.getMappedClass(Persist entClass.java:99)
>
> at
> org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactor y.java:168)
> at
> org.hibernate.tuple.PropertyFactory.buildIdentifierProperty( PropertyFactory.java:44)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:124)
>
> at
> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:434)
>
> at
> org.hibernate.persister.entity.JoinedSubclassEntityPersister . <init>(JoinedSubclassEntityPersister.java:91)
>
> at
> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:58)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1300)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getSessionFactory(HibernatePackageHandler.java:334 )
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageInfos(HibernatePackageHandler.java:292)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getCDOPackageInfos(HibernatePackageHandler.java:21 4)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readPackageInfos(HibernateStoreReader.java:79)
>
> at
> org.eclipse.emf.cdo.internal.server.PackageManager.doActivat e(PackageManager.java:72)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:263)
>
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>
> at
> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>
> at test.cdo.classpath.Activator.getSession(Activator.java:84)
> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
> at test.cdo.classpath.Activator.getResource(Activator.java:113)
> at
> test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>
> Refactoring problem?
>
> meta.hbm.xml reads
> <hibernate-mapping
> package="org.eclipse.emf.cdo.internal.protocol.model">
> but should be
> <hibernate-mapping package="org.eclipse.emf.cdo.internal.common.model">
> now?
>
> => Workaround: edit meta.hbm.xml (as described) -
> org.eclipse.emf.cdo.server.hibernate has been copied into workspace
> alreday (see issue 2)
Seems to be answered by Martin.


> Issue 4:
>
> org.hibernate.MappingException: entity class not found:
> org.eclipse.emf.cdo.internal.common.model.CDOClassProxy
>
> This class seems not to exist any more ...
>
> => no workaround! => STOPPER
>
> Eike, Martin - can you please provide a working meta.hbm.xml file, so
> I can continue with 1.0?
>
>
> --- for now I'm comtinuing with my issues I have with 0.8.0 (as of end
> of June) and which I suspect to be in 1.0.0 still:
Seems to be answered by Martin.


> Issue 5:
>
> When calling getOrCreateResource() in a plugin activator's start()
> method, I run into a deadlock.
>
> => Workaround: always do resource initialization lazyly
I'd need to know more about your activator and its plugin. Can you
please open a Bugzilla and attach code so that I can reproduce the
deadlock (is it reproducible?).


> Issue 6:
>
> EPackages only containing interfaces are not being taken by the
> package manager -> ClassRefs can not be resolved (see Bugzilla – Bug
> 230387)
>
> => Workaround: introduce Dummy class in the package in question and
> store one Dummy instance in the Database
Is there a stack trace or a log message?
I can't see how this problem relates to bug #230387 since that one is
about multiple packages and not about packages with only interfaces. Can
you please explain why you see a relation here?
I suggest that you enter a new Bugzilla to track this issue.


> Issue 7:
>
> With all of these workarounds, I get to store and read my models in
> one session alright.
> However, when I close my application and reopen it, initialization
> fails consistently when trying to get the contents of a resource:
> getResource("/test").getContents() seems to not initialize the thread
> context variables on the server:
>
> [...]
> 24.06.2008 13:32:40 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
> INFO: schema update complete
> Thread-4 [debug] Setting session in threadlocal
> Thread-4 [debug.revision] Setting version for
> CDOResource@HBM-CDOResource-1v0: v1
> Thread-4 [debug] Stored hb list in threadlocal: CDOResource.contents
> Thread-4 [debug.session] Registering resource: HBM-CDOResource-1 <-->
> /my/test/resource
> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 03 01 00 00 00 01
> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
> Thread-4 [debug] Releasing hibernate session
> main [debug.model] Reading CDOID of type 1 (OBJECT)
> Thread-4 [debug] Clearing session in threadlocal
> Thread-4 [debug] Removing hibernate session
> Thread-4 [debug] Closing hibernate session
> main [debug.protocol] Read ID: HBM-CDOResource-1
> [INFO] Legacy system not available
> main [debug.object] Setting ID: HBM-CDOResource-1
> main [debug.object] Setting view: CDOTransaction(1)
> main [debug.object] Setting state PROXY for CDOResource@HBM-CDOResource-1
> main [debug.object] PREPARE: CDOResource@HBM-CDOResource-1 -->
> CDOTransaction(1)
> main [debug.protocol] Writing path: /my/test/resource
> main [debug] Multiplexing 00 00 00 00 00 00 00 05 00 04 01 00 11 2f 6d
> 79 2f 74 65 73 74 2f 72 65 73 6f 75 72 63 65 00
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug.protocol] Read path: /my/test/resource
> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 04 01 00 00 00 01
> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
> main [debug.model] Reading CDOID of type 1 (OBJECT)
> main [debug.protocol] Read ID: HBM-CDOResource-1
> main [debug.object] Setting ID: HBM-CDOResource-1
> main [debug.object] Setting view: CDOTransaction(1)
> Thread-4 [debug] Releasing hibernate session
> main [debug.view] Registering CDOResource@HBM-CDOResource-1
> Thread-4 [debug] Clearing session in threadlocal
> Thread-4 [debug] Removing hibernate session
> main [debug.object] ATTACH: CDOResource@HBM-CDOResource-1 -->
> CDOTransaction(1)
> main [debug.object] size(CDOResource@HBM-CDOResource-1,
> CDOFeature(ID=2, name=contents, type=OBJECT,
> referenceType=CDOClass(ID=0, name=CDOObject)))
> main [debug.object] READ:
> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl
> main [debug.protocol] Writing referenceChunk: -1
> main [debug.protocol] Writing 1 IDs
> main [debug.protocol] Writing ID: HBM-CDOResource-1
> main [debug.model] Writing CDOID of type 1 (OBJECT)
> main [debug] Multiplexing 00 00 00 00 00 00 00 06 00 07 00 00 00 00 00
> 00 00 01 01 00 00 00 01 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52
> 65 73 6f 75 72 63 65 00 00 00 00 00
> main [debug.protocol] Reading 1 revisions
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug] Created
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
> repository repo1
> Thread-4 [debug.protocol] Read referenceChunk: -1
> Thread-4 [debug.protocol] Reading 1 IDs
> Thread-4 [debug.model] Reading CDOID of type 1 (OBJECT)
> Thread-4 [debug.protocol] Read ID: HBM-CDOResource-1
> Thread-4 [debug.protocol] Writing 1 revisions
> Thread-4 [debug] Releasing hibernate session
> Thread-4 [debug] Clearing session in threadlocal
> Thread-4 [debug] Removing hibernate session
> [ERROR] CommitContext not set
> java.lang.IllegalStateException: CommitContext not set
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateThrea dContext.getCommitContext(HibernateThreadContext.java:69)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil. getCDORevision(HibernateUtil.java:117)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readRevision(HibernateStoreReader.java:155)
>
> at
> org.eclipse.emf.cdo.internal.server.RevisionManager.loadRevi sion(RevisionManager.java:210)
>
> at
> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:282)
>
> at
> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:144)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.getRevision(LoadRevisionIndication.java:171)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.responding(LoadRevisionIndication.java:147)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:54)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> => no workaround => STOPPER!
IIrc. Simon, Martin and I discussed this or a similar problem some time
ago. I even believe that this was fixed already. Simon, Martin, can you
remember if we have a Bugzilla/fix for this?


> Should I open bugs for these issues?
See above.


> Can you provide quick fixes to my two stoppers?
I (and Martin) believe the two stoppers are already fixed. Martin, right?
For the other issues I have just created a 1.0 maintenance branch to
beat the boredom ;-)

Cheers
/Eike


Re: [CDO/Hibernate] Multiple issues [message #420250 is a reply to message #420249] Tue, 24 June 2008 14:06 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
Yes I think that a number of the issues below have been fixed in cvs (and your latest maintenance
build). So it would be great Stefan, if you could try the latest build.

gr. Martin

Eike Stepper wrote:
> Hi Stefan,
>
> I'm answering to Martin's comment to reduce noise in the EMF newgroup.
>
> Comments below...
>
>
> Stefan Winkler schrieb:
>> Hi Eike, hi Martin,
>>
>> after a few weeks, I'm back from vacation and switched back to work
>> mode this week.
>> First, let me give my congratulations for the graduation.
>>
>> That said, I have persisting problems using CDO/Hibernate, some of
>> which I have a workaround (which is ok but not satisfying), for some I
>> don't.
>>
>> Here we go: (I updated to Ganymede (well, RC4 for now to be exact),
>> and thus to CDO 1.0.0)
>>
>> Issue 1:
>> Is it intentional that CDO does not run out of the box when downloaded
>> binary as part of Ganymede?
>>
>> => Workaround: I have to copy the libraries to
>> eclipse\plugins\org.eclipse.emf.cdo.server.hibernate.librari es_1.0.0.v200806111412\lib
>>
> Yes, unfortunately it's currently intentional since we are not allowed
> to ship non EPL compatible stuff and we didn't find a better way so far
> to use 3rd party components like Hibernate. Can you please open an
> enhancement request where we can discuss alternative approaches. The EMO
> legal department will want to have a chance to review possible
> solutions, too.
>
>
>> Issue 2:
>> When starting up, I get a
>>
>> java.lang.NullPointerException
>> at
>> org.eclipse.core.internal.runtime.Activator.getURLConverter( Activator.java:313)
>>
>> at org.eclipse.core.runtime.FileLocator.resolve(FileLocator.jav a:186)
>> at
>> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>>
>> at
>> org.eclipse.net4j.internal.util.bundle.AbstractBundle.getInp utStream(AbstractBundle.java:222)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.initConfiguration(HibernatePackageHandler.java:391 )
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.doActivate(HibernatePackageHandler.java:364)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .doActivate(HibernateStore.java:197)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:262)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>>
>> at test.cdo.classpath.Activator.getSession(Activator.java:84)
>> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
>> at test.cdo.classpath.Activator.getResource(Activator.java:113)
>> at
>> test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>>
>> because at
>> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>>
>>
>> URL entry = getBundleContext().getBundle().getEntry(".");
>> //$NON-NLS-1$
>>
>> getEntry(".") returns null ...
>>
>> => Workaround: Imprt the Plug-In as source into the workspace
>>
>> Net4j util seems to not like CDO as JAR bundles...
> I digged a bit but have no explanation so far. Please open a Bugzilla so
> that you can track progress.
>
>
>> Issue 3:
>>
>> org.hibernate.MappingException: entity class not found:
>> org.eclipse.emf.cdo.internal.protocol.model.CDOModelElementI mpl
>> at
>> org.hibernate.mapping.PersistentClass.getMappedClass(Persist entClass.java:99)
>>
>> at
>> org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactor y.java:168)
>> at
>> org.hibernate.tuple.PropertyFactory.buildIdentifierProperty( PropertyFactory.java:44)
>>
>> at
>> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:124)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:434)
>>
>> at
>> org.hibernate.persister.entity.JoinedSubclassEntityPersister . <init>(JoinedSubclassEntityPersister.java:91)
>>
>> at
>> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:58)
>>
>> at
>> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1300)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getSessionFactory(HibernatePackageHandler.java:334 )
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageInfos(HibernatePackageHandler.java:292)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getCDOPackageInfos(HibernatePackageHandler.java:21 4)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readPackageInfos(HibernateStoreReader.java:79)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.PackageManager.doActivat e(PackageManager.java:72)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:263)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>>
>> at test.cdo.classpath.Activator.getSession(Activator.java:84)
>> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
>> at test.cdo.classpath.Activator.getResource(Activator.java:113)
>> at
>> test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>>
>> Refactoring problem?
>>
>> meta.hbm.xml reads
>> <hibernate-mapping
>> package="org.eclipse.emf.cdo.internal.protocol.model">
>> but should be
>> <hibernate-mapping package="org.eclipse.emf.cdo.internal.common.model">
>> now?
>>
>> => Workaround: edit meta.hbm.xml (as described) -
>> org.eclipse.emf.cdo.server.hibernate has been copied into workspace
>> alreday (see issue 2)
> Seems to be answered by Martin.
>
>
>> Issue 4:
>>
>> org.hibernate.MappingException: entity class not found:
>> org.eclipse.emf.cdo.internal.common.model.CDOClassProxy
>>
>> This class seems not to exist any more ...
>>
>> => no workaround! => STOPPER
>>
>> Eike, Martin - can you please provide a working meta.hbm.xml file, so
>> I can continue with 1.0?
>>
>>
>> --- for now I'm comtinuing with my issues I have with 0.8.0 (as of end
>> of June) and which I suspect to be in 1.0.0 still:
> Seems to be answered by Martin.
>
>
>> Issue 5:
>>
>> When calling getOrCreateResource() in a plugin activator's start()
>> method, I run into a deadlock.
>>
>> => Workaround: always do resource initialization lazyly
> I'd need to know more about your activator and its plugin. Can you
> please open a Bugzilla and attach code so that I can reproduce the
> deadlock (is it reproducible?).
>
>
>> Issue 6:
>>
>> EPackages only containing interfaces are not being taken by the
>> package manager -> ClassRefs can not be resolved (see Bugzilla – Bug
>> 230387)
>>
>> => Workaround: introduce Dummy class in the package in question and
>> store one Dummy instance in the Database
> Is there a stack trace or a log message?
> I can't see how this problem relates to bug #230387 since that one is
> about multiple packages and not about packages with only interfaces. Can
> you please explain why you see a relation here?
> I suggest that you enter a new Bugzilla to track this issue.
>
>
>> Issue 7:
>>
>> With all of these workarounds, I get to store and read my models in
>> one session alright.
>> However, when I close my application and reopen it, initialization
>> fails consistently when trying to get the contents of a resource:
>> getResource("/test").getContents() seems to not initialize the thread
>> context variables on the server:
>>
>> [...]
>> 24.06.2008 13:32:40 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
>> INFO: schema update complete
>> Thread-4 [debug] Setting session in threadlocal
>> Thread-4 [debug.revision] Setting version for
>> CDOResource@HBM-CDOResource-1v0: v1
>> Thread-4 [debug] Stored hb list in threadlocal: CDOResource.contents
>> Thread-4 [debug.session] Registering resource: HBM-CDOResource-1 <-->
>> /my/test/resource
>> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
>> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 03 01 00 00 00 01
>> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
>> Thread-4 [debug] Releasing hibernate session
>> main [debug.model] Reading CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> Thread-4 [debug] Closing hibernate session
>> main [debug.protocol] Read ID: HBM-CDOResource-1
>> [INFO] Legacy system not available
>> main [debug.object] Setting ID: HBM-CDOResource-1
>> main [debug.object] Setting view: CDOTransaction(1)
>> main [debug.object] Setting state PROXY for CDOResource@HBM-CDOResource-1
>> main [debug.object] PREPARE: CDOResource@HBM-CDOResource-1 -->
>> CDOTransaction(1)
>> main [debug.protocol] Writing path: /my/test/resource
>> main [debug] Multiplexing 00 00 00 00 00 00 00 05 00 04 01 00 11 2f 6d
>> 79 2f 74 65 73 74 2f 72 65 73 6f 75 72 63 65 00
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
>> repository repo1
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
>> repository repo1
>> Thread-4 [debug.protocol] Read path: /my/test/resource
>> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
>> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 04 01 00 00 00 01
>> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
>> main [debug.model] Reading CDOID of type 1 (OBJECT)
>> main [debug.protocol] Read ID: HBM-CDOResource-1
>> main [debug.object] Setting ID: HBM-CDOResource-1
>> main [debug.object] Setting view: CDOTransaction(1)
>> Thread-4 [debug] Releasing hibernate session
>> main [debug.view] Registering CDOResource@HBM-CDOResource-1
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> main [debug.object] ATTACH: CDOResource@HBM-CDOResource-1 -->
>> CDOTransaction(1)
>> main [debug.object] size(CDOResource@HBM-CDOResource-1,
>> CDOFeature(ID=2, name=contents, type=OBJECT,
>> referenceType=CDOClass(ID=0, name=CDOObject)))
>> main [debug.object] READ:
>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl
>> main [debug.protocol] Writing referenceChunk: -1
>> main [debug.protocol] Writing 1 IDs
>> main [debug.protocol] Writing ID: HBM-CDOResource-1
>> main [debug.model] Writing CDOID of type 1 (OBJECT)
>> main [debug] Multiplexing 00 00 00 00 00 00 00 06 00 07 00 00 00 00 00
>> 00 00 01 01 00 00 00 01 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52
>> 65 73 6f 75 72 63 65 00 00 00 00 00
>> main [debug.protocol] Reading 1 revisions
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
>> repository repo1
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
>> repository repo1
>> Thread-4 [debug.protocol] Read referenceChunk: -1
>> Thread-4 [debug.protocol] Reading 1 IDs
>> Thread-4 [debug.model] Reading CDOID of type 1 (OBJECT)
>> Thread-4 [debug.protocol] Read ID: HBM-CDOResource-1
>> Thread-4 [debug.protocol] Writing 1 revisions
>> Thread-4 [debug] Releasing hibernate session
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> [ERROR] CommitContext not set
>> java.lang.IllegalStateException: CommitContext not set
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateThrea dContext.getCommitContext(HibernateThreadContext.java:69)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil. getCDORevision(HibernateUtil.java:117)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readRevision(HibernateStoreReader.java:155)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RevisionManager.loadRevi sion(RevisionManager.java:210)
>>
>> at
>> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:282)
>>
>> at
>> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:144)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.getRevision(LoadRevisionIndication.java:171)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.responding(LoadRevisionIndication.java:147)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:54)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>>
>> => no workaround => STOPPER!
> IIrc. Simon, Martin and I discussed this or a similar problem some time
> ago. I even believe that this was fixed already. Simon, Martin, can you
> remember if we have a Bugzilla/fix for this?
>
>
>> Should I open bugs for these issues?
> See above.
>
>
>> Can you provide quick fixes to my two stoppers?
> I (and Martin) believe the two stoppers are already fixed. Martin, right?
> For the other issues I have just created a 1.0 maintenance branch to
> beat the boredom ;-)
>
> Cheers
> /Eike
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO/Hibernate] Multiple issues [message #420251 is a reply to message #420244] Tue, 24 June 2008 14:15 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi,
> Regarding issue 3 and 4, I checked this in cvs on the 15th of june. So
> this should be solved in the next build, or can you cvs?
Ok, got the sources from CVS. Fixes issues 3 and 4, but results in a

java.lang.NoClassDefFoundError:
org/eclipse/emf/cdo/protocol/id/CDOIDObjectFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.emf.internal.cdo.CDOSessionImpl.handleLibraryDes criptor(CDOSessionImpl.java:750)
at
org.eclipse.emf.internal.cdo.CDOSessionImpl.doActivate(CDOSe ssionImpl.java:680)
at
org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
at
org.eclipse.emf.internal.cdo.CDOSessionConfigurationImpl.ope nSession(CDOSessionConfigurationImpl.java:134)
at test.cdo.classpath.Activator.getSession(Activator.java:96)
at test.cdo.classpath.Activator.getTransaction(Activator.java:1 05)
at test.cdo.classpath.Activator.getResource(Activator.java:115)
at test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
[...]
Caused by: java.lang.ClassNotFoundException:
org.eclipse.emf.cdo.protocol.id.CDOIDObjectFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 65 more

This happens when
org.eclipse.emf.cdo.server.hibernate.internal.id.CDOIDHibern ateFactoryImpl
is to be loaded and the cause is that my checked-out version of
hibernate-id-v1.jar still references the org.eclipse.emf.cdo.protocol
package.
Do I have to rebuild this library (how? ant-script anywhere?)
> btw, I cross-posted to the emf newsgroup because cdo is graduating/has
> graduated.
Thaks - didn't know that the main newsgroup is now this one. Sorry for that.

Cheers,
Stefan
Re: [CDO/Hibernate] Multiple issues [message #420252 is a reply to message #420249] Tue, 24 June 2008 14:43 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi Eike,

it's always a pleasure to reduce your boredom ;-)

Comments below:
>>
>> Issue 1:
>> Is it intentional that CDO does not run out of the box when
>> downloaded binary as part of Ganymede?
>>
>> => Workaround: I have to copy the libraries to
>> eclipse\plugins\org.eclipse.emf.cdo.server.hibernate.librari es_1.0.0.v200806111412\lib
>>
> Yes, unfortunately it's currently intentional since we are not allowed
> to ship non EPL compatible stuff and we didn't find a better way so
> far to use 3rd party components like Hibernate. Can you please open an
> enhancement request where we can discuss alternative approaches. The
> EMO legal department will want to have a chance to review possible
> solutions, too.
-> Bug 238251 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=238251>

>
>
>> Issue 2:
>> When starting up, I get a
>>
>> java.lang.NullPointerException
>> at
>> org.eclipse.core.internal.runtime.Activator.getURLConverter( Activator.java:313)
>>
>> at org.eclipse.core.runtime.FileLocator.resolve(FileLocator.jav a:186)
>> at
>> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>>
>> at
>> org.eclipse.net4j.internal.util.bundle.AbstractBundle.getInp utStream(AbstractBundle.java:222)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.initConfiguration(HibernatePackageHandler.java:391 )
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.doActivate(HibernatePackageHandler.java:364)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .doActivate(HibernateStore.java:197)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:262)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>>
>> at test.cdo.classpath.Activator.getSession(Activator.java:84)
>> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
>> at test.cdo.classpath.Activator.getResource(Activator.java:113)
>> at
>> test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>>
>> because at
>> org.eclipse.net4j.internal.util.om.OSGiBundle.getBaseURL(OSG iBundle.java:47)
>>
>>
>> URL entry = getBundleContext().getBundle().getEntry(".");
>> //$NON-NLS-1$
>>
>> getEntry(".") returns null ...
>>
>> => Workaround: Imprt the Plug-In as source into the workspace
>>
>> Net4j util seems to not like CDO as JAR bundles...
> I digged a bit but have no explanation so far. Please open a Bugzilla
> so that you can track progress.
=> Bug 238254 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=238254>
>
>> Issue 3:
>>
>> org.hibernate.MappingException: entity class not found:
>> org.eclipse.emf.cdo.internal.protocol.model.CDOModelElementI mpl
>> at
>> org.hibernate.mapping.PersistentClass.getMappedClass(Persist entClass.java:99)
>>
>> at
>> org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactor y.java:168)
>> at
>> org.hibernate.tuple.PropertyFactory.buildIdentifierProperty( PropertyFactory.java:44)
>>
>> at
>> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:124)
>>
>> at
>> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:434)
>>
>> at
>> org.hibernate.persister.entity.JoinedSubclassEntityPersister . <init>(JoinedSubclassEntityPersister.java:91)
>>
>> at
>> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:58)
>>
>> at
>> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
>>
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1300)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getSessionFactory(HibernatePackageHandler.java:334 )
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.readPackageInfos(HibernatePackageHandler.java:292)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.getCDOPackageInfos(HibernatePackageHandler.java:21 4)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readPackageInfos(HibernateStoreReader.java:79)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.PackageManager.doActivat e(PackageManager.java:72)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.activateRepos itory(Repository.java:263)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Re pository.java:250)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycl e.java:53)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:69)
>>
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(Life cycleUtil.java:59)
>>
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOSe rverUtil.java:67)
>>
>> at test.cdo.classpath.Activator.getSession(Activator.java:84)
>> at test.cdo.classpath.Activator.getTransaction(Activator.java:1 03)
>> at test.cdo.classpath.Activator.getResource(Activator.java:113)
>> at
>> test.cdo.classpath.ClasspathTest.testClasspath(ClasspathTest .java:9)
>>
>> Refactoring problem?
>>
>> meta.hbm.xml reads
>> <hibernate-mapping
>> package="org.eclipse.emf.cdo.internal.protocol.model">
>> but should be
>> <hibernate-mapping package="org.eclipse.emf.cdo.internal.common.model">
>> now?
>>
>> => Workaround: edit meta.hbm.xml (as described) -
>> org.eclipse.emf.cdo.server.hibernate has been copied into workspace
>> alreday (see issue 2)
> Seems to be answered by Martin.
yes. solved in HEAD
>
>> Issue 4:
>>
>> org.hibernate.MappingException: entity class not found:
>> org.eclipse.emf.cdo.internal.common.model.CDOClassProxy
>>
>> This class seems not to exist any more ...
>>
>> => no workaround! => STOPPER
>>
>> Eike, Martin - can you please provide a working meta.hbm.xml file, so
>> I can continue with 1.0?
>>
>>
>> --- for now I'm comtinuing with my issues I have with 0.8.0 (as of
>> end of June) and which I suspect to be in 1.0.0 still:
> Seems to be answered by Martin.
yes, solved in HEAD (see other post)
>
>> Issue 5:
>>
>> When calling getOrCreateResource() in a plugin activator's start()
>> method, I run into a deadlock.
>>
>> => Workaround: always do resource initialization lazyly
> I'd need to know more about your activator and its plugin. Can you
> please open a Bugzilla and attach code so that I can reproduce the
> deadlock (is it reproducible?).
I'll have a try on that one as soon as I get the basics running.

>
>> Issue 6:
>>
>> EPackages only containing interfaces are not being taken by the
>> package manager -> ClassRefs can not be resolved (see Bugzilla – Bug
>> 230387)
>>
>> => Workaround: introduce Dummy class in the package in question and
>> store one Dummy instance in the Database
> Is there a stack trace or a log message?
> I can't see how this problem relates to bug #230387 since that one is
> about multiple packages and not about packages with only interfaces.
> Can you please explain why you see a relation here?
> I suggest that you enter a new Bugzilla to track this issue.
Sorry, I haven't been precise on that one.
I was referring exactly to the case in bug #230387 but it seems that the
problem I described there was initially described to general.
Added an attachment note about this to the bug.

>
>
>> Issue 7:
>>
>> With all of these workarounds, I get to store and read my models in
>> one session alright.
>> However, when I close my application and reopen it, initialization
>> fails consistently when trying to get the contents of a resource:
>> getResource("/test").getContents() seems to not initialize the thread
>> context variables on the server:
>>
>> [...]
>> 24.06.2008 13:32:40 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
>> INFO: schema update complete
>> Thread-4 [debug] Setting session in threadlocal
>> Thread-4 [debug.revision] Setting version for
>> CDOResource@HBM-CDOResource-1v0: v1
>> Thread-4 [debug] Stored hb list in threadlocal: CDOResource.contents
>> Thread-4 [debug.session] Registering resource: HBM-CDOResource-1 <-->
>> /my/test/resource
>> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
>> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 03 01 00 00 00 01
>> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
>> Thread-4 [debug] Releasing hibernate session
>> main [debug.model] Reading CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> Thread-4 [debug] Closing hibernate session
>> main [debug.protocol] Read ID: HBM-CDOResource-1
>> [INFO] Legacy system not available
>> main [debug.object] Setting ID: HBM-CDOResource-1
>> main [debug.object] Setting view: CDOTransaction(1)
>> main [debug.object] Setting state PROXY for
>> CDOResource@HBM-CDOResource-1
>> main [debug.object] PREPARE: CDOResource@HBM-CDOResource-1 -->
>> CDOTransaction(1)
>> main [debug.protocol] Writing path: /my/test/resource
>> main [debug] Multiplexing 00 00 00 00 00 00 00 05 00 04 01 00 11 2f
>> 6d 79 2f 74 65 73 74 2f 72 65 73 6f 75 72 63 65 00
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug.protocol] Read path: /my/test/resource
>> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
>> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 04 01 00 00 00 01
>> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
>> main [debug.model] Reading CDOID of type 1 (OBJECT)
>> main [debug.protocol] Read ID: HBM-CDOResource-1
>> main [debug.object] Setting ID: HBM-CDOResource-1
>> main [debug.object] Setting view: CDOTransaction(1)
>> Thread-4 [debug] Releasing hibernate session
>> main [debug.view] Registering CDOResource@HBM-CDOResource-1
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> main [debug.object] ATTACH: CDOResource@HBM-CDOResource-1 -->
>> CDOTransaction(1)
>> main [debug.object] size(CDOResource@HBM-CDOResource-1,
>> CDOFeature(ID=2, name=contents, type=OBJECT,
>> referenceType=CDOClass(ID=0, name=CDOObject)))
>> main [debug.object] READ:
>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl
>> main [debug.protocol] Writing referenceChunk: -1
>> main [debug.protocol] Writing 1 IDs
>> main [debug.protocol] Writing ID: HBM-CDOResource-1
>> main [debug.model] Writing CDOID of type 1 (OBJECT)
>> main [debug] Multiplexing 00 00 00 00 00 00 00 06 00 07 00 00 00 00
>> 00 00 00 01 01 00 00 00 01 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f
>> 52 65 73 6f 75 72 63 65 00 00 00 00 00
>> main [debug.protocol] Reading 1 revisions
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug.protocol] Read referenceChunk: -1
>> Thread-4 [debug.protocol] Reading 1 IDs
>> Thread-4 [debug.model] Reading CDOID of type 1 (OBJECT)
>> Thread-4 [debug.protocol] Read ID: HBM-CDOResource-1
>> Thread-4 [debug.protocol] Writing 1 revisions
>> Thread-4 [debug] Releasing hibernate session
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> [ERROR] CommitContext not set
>> java.lang.IllegalStateException: CommitContext not set
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateThrea dContext.getCommitContext(HibernateThreadContext.java:69)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil. getCDORevision(HibernateUtil.java:117)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readRevision(HibernateStoreReader.java:155)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RevisionManager.loadRevi sion(RevisionManager.java:210)
>>
>> at
>> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:282)
>>
>> at
>> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:144)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.getRevision(LoadRevisionIndication.java:171)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.responding(LoadRevisionIndication.java:147)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:54)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>>
>> => no workaround => STOPPER!
> IIrc. Simon, Martin and I discussed this or a similar problem some
> time ago. I even believe that this was fixed already. Simon, Martin,
> can you remember if we have a Bugzilla/fix for this?
Again, I'll revisit this one with the current version.

Thanks for your support!

Cheers,
Stefan
Re: [CDO/Hibernate] Multiple issues [message #420253 is a reply to message #420251] Tue, 24 June 2008 14:54 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Small update:
>
> java.lang.NoClassDefFoundError:
> org/eclipse/emf/cdo/protocol/id/CDOIDObjectFactory
>
> This happens when
> org.eclipse.emf.cdo.server.hibernate.internal.id.CDOIDHibern ateFactoryImpl
> is to be loaded and the cause is that my checked-out version of
> hibernate-id-v1.jar still references the org.eclipse.emf.cdo.protocol
> package.
> Do I have to rebuild this library (how? ant-script anywhere?)
Rebuilt library (export as jar file, then copy jar into workspace
overwriting existing hibernate-id-v1.jar)

=> works
Re: [CDO/Hibernate] Multiple issues [message #420258 is a reply to message #420249] Tue, 24 June 2008 15:35 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi,

new comments below ...

>> Issue 5:
>>
>> When calling getOrCreateResource() in a plugin activator's start()
>> method, I run into a deadlock.
>>
>> => Workaround: always do resource initialization lazyly
> I'd need to know more about your activator and its plugin. Can you
> please open a Bugzilla and attach code so that I can reproduce the
> deadlock (is it reproducible?).
Well, that was a problem in 0.8.0 in a rather complex scenario. I just
tried 1.0.0 with my simple scenario and was not able to reproduce.
I'll keep this one in mind and will open a bug if I come across it again.


I am now able to execute this once:

public void writeObject() {
System.out.println("resource now contains " +
Activator.getDefault().getResource().getContents().size() + " products");

Product p = Model1Factory.eINSTANCE.createProduct();
p.setName("test");
p.setVat(VAT.VAT0);

Activator.getDefault().getResource().getContents().add(p);
Activator.getDefault().getTransaction().commit();
}

When the testcase ends and the process terminates, I start the same
thing again and get a:

[Serverside]
java.lang.ClassCastException:
org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or cannot be
cast to org.eclipse.emf.ecore.EPackage
at
org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.resolveSubPackages(TeneoHibernateMappingProvide r.java:133)
at
org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.generateMapping(TeneoHibernateMappingProvider.j ava:111)
at
org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.addMapping(TeneoHibernateMappingProvider.java:5 3)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .initConfiguration(HibernateStore.java:260)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .getHibernateSessionFactory(HibernateStore.java:96)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.createHibernateSession(HibernateStoreAccessor.java: 60)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.getHibernateSession(HibernateStoreAccessor.java:115 )
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readResourceID(HibernateStoreReader.java:89)
at
org.eclipse.emf.cdo.internal.server.ResourceManager.loadID(R esourceManager.java:92)
at
org.eclipse.emf.cdo.internal.server.ResourceManager.getResou rceID(ResourceManager.java:53)
at
org.eclipse.emf.cdo.internal.server.protocol.ResourceIDIndic ation.indicating(ResourceIDIndication.java:53)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:46)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

[Clientside hangs at (stack copy):]
Unsafe.park(boolean, long) line: not available [native method]
LockSupport.parkNanos(Object, long) line: not available
AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) line: not
available
LinkedBlockingQueue<E>.poll(long, TimeUnit) line: not available
SignalProtocol$SignalInputStream(BufferInputStream).ensureBu ffer() line:
118
SignalProtocol$SignalInputStream(BufferInputStream).read() line: 64
ExtendedDataInputStream(DataInputStream).readByte() line: not available
CDOIDUtil.read(ExtendedDataInput, CDOIDObjectFactory, boolean) line: 101
CDOIDUtil.read(ExtendedDataInput, CDOIDObjectFactory) line: 96
ResourceIDRequest.confirming(ExtendedDataInputStream) line: 62
ResourceIDRequest.confirming(ExtendedDataInputStream) line: 1
ResourceIDRequest(RequestWithConfirmation<RESULT>).execute(BufferInputStream,
BufferOutputStream) line: 57
ResourceIDRequest(Signal).runSync() line: 143
CDOClientProtocol(SignalProtocol).startSignal(SignalActor<? >, long)
line: 236
ResourceIDRequest(SignalActor<RESULT>).send(long) line: 50
ResourceIDRequest(SignalActor<RESULT>).send() line: 40
NOOPFailOverStrategy.send(RequestWithConfirmation<RESULT>) line: 29
CDOTransactionImpl(CDOViewImpl).getResourceID(String) line: 211
CDOTransactionImpl.getOrCreateResource(String) line: 202
Activator.getResource() line: 115
ClasspathTest.writeObject() line: 14

Any hints?

Cheers,
Stefan
Re: [CDO/Hibernate] Multiple issues [message #420265 is a reply to message #420253] Tue, 24 June 2008 16:44 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Stefan Winkler schrieb:
> Small update:
>>
>> java.lang.NoClassDefFoundError:
>> org/eclipse/emf/cdo/protocol/id/CDOIDObjectFactory
>>
>> This happens when
>> org.eclipse.emf.cdo.server.hibernate.internal.id.CDOIDHibern ateFactoryImpl
>> is to be loaded and the cause is that my checked-out version of
>> hibernate-id-v1.jar still references the org.eclipse.emf.cdo.protocol
>> package.
>> Do I have to rebuild this library (how? ant-script anywhere?)
> Rebuilt library (export as jar file, then copy jar into workspace
> overwriting existing hibernate-id-v1.jar)
>
> => works
I'll have to include this into the automated build, too ;-(
Can you please file one more Bugzilla?

Cheers
/Eike


Re: [CDO/Hibernate] Multiple issues [message #420267 is a reply to message #420258] Tue, 24 June 2008 16:57 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.
--------------070207000405030500050701
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit

Hi Martin, Stefan,

I propose the following fix in TeneoHibernateMappingProvider:

| *protected *List<EPackage> resolveSubPackages(EPackage ePackage)
{
*final *List<EPackage> result = *new *ArrayList<EPackage>();
resolveSubPackages(ePackage, result);
*return *result;
}

*private **void *resolveSubPackages(EPackage ePackage, List<EPackage> result)
{
EPackage globalPackage = EPackage.Registry.INSTANCE.getEPackage(ePackage.getNsURI());
*if *(globalPackage != *null*)
{
ePackage = globalPackage;
}

result.add(ePackage);
*for *(EPackage subEPackage : ePackage.getESubpackages())
{
resolveSubPackages(subEPackage, result);
}
}|


Stefan, if you file a Bugzilla, I can commit this fix, or do you want
to, Martin?

Cheers
/Eike



Stefan Winkler schrieb:
> Hi,
>
> new comments below ...
>
>>> Issue 5:
>>>
>>> When calling getOrCreateResource() in a plugin activator's start()
>>> method, I run into a deadlock.
>>>
>>> => Workaround: always do resource initialization lazyly
>> I'd need to know more about your activator and its plugin. Can you
>> please open a Bugzilla and attach code so that I can reproduce the
>> deadlock (is it reproducible?).
> Well, that was a problem in 0.8.0 in a rather complex scenario. I just
> tried 1.0.0 with my simple scenario and was not able to reproduce.
> I'll keep this one in mind and will open a bug if I come across it again.
>
>
> I am now able to execute this once:
>
> public void writeObject() {
> System.out.println("resource now contains " +
> Activator.getDefault().getResource().getContents().size() + " products");
> Product p = Model1Factory.eINSTANCE.createProduct();
> p.setName("test");
> p.setVat(VAT.VAT0);
> Activator.getDefault().getResource().getContents().add(p);
> Activator.getDefault().getTransaction().commit();
> }
>
> When the testcase ends and the process terminates, I start the same
> thing again and get a:
>
> [Serverside]
> java.lang.ClassCastException:
> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or cannot
> be cast to org.eclipse.emf.ecore.EPackage
> at
> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.resolveSubPackages(TeneoHibernateMappingProvide r.java:133)
>
> at
> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.generateMapping(TeneoHibernateMappingProvider.j ava:111)
>
> at
> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.addMapping(TeneoHibernateMappingProvider.java:5 3)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .initConfiguration(HibernateStore.java:260)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .getHibernateSessionFactory(HibernateStore.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.createHibernateSession(HibernateStoreAccessor.java: 60)
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.getHibernateSession(HibernateStoreAccessor.java:115 )
>
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readResourceID(HibernateStoreReader.java:89)
>
> at
> org.eclipse.emf.cdo.internal.server.ResourceManager.loadID(R esourceManager.java:92)
>
> at
> org.eclipse.emf.cdo.internal.server.ResourceManager.getResou rceID(ResourceManager.java:53)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.ResourceIDIndic ation.indicating(ResourceIDIndication.java:53)
>
> at
> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:46)
>
> at
> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> [Clientside hangs at (stack copy):]
> Unsafe.park(boolean, long) line: not available [native method]
> LockSupport.parkNanos(Object, long) line: not available
> AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) line: not
> available LinkedBlockingQueue<E>.poll(long, TimeUnit) line: not
> available
> SignalProtocol$SignalInputStream(BufferInputStream).ensureBu ffer()
> line: 118 SignalProtocol$SignalInputStream(BufferInputStream).read()
> line: 64 ExtendedDataInputStream(DataInputStream).readByte() line:
> not available CDOIDUtil.read(ExtendedDataInput, CDOIDObjectFactory,
> boolean) line: 101 CDOIDUtil.read(ExtendedDataInput,
> CDOIDObjectFactory) line: 96
> ResourceIDRequest.confirming(ExtendedDataInputStream) line: 62
> ResourceIDRequest.confirming(ExtendedDataInputStream) line: 1
> ResourceIDRequest(RequestWithConfirmation<RESULT>).execute(BufferInputStream,
> BufferOutputStream) line: 57 ResourceIDRequest(Signal).runSync()
> line: 143
> CDOClientProtocol(SignalProtocol).startSignal(SignalActor<? >, long)
> line: 236 ResourceIDRequest(SignalActor<RESULT>).send(long) line:
> 50 ResourceIDRequest(SignalActor<RESULT>).send() line: 40
> NOOPFailOverStrategy.send(RequestWithConfirmation<RESULT>) line: 29
> CDOTransactionImpl(CDOViewImpl).getResourceID(String) line: 211
> CDOTransactionImpl.getOrCreateResource(String) line: 202
> Activator.getResource() line: 115 ClasspathTest.writeObject() line:
> 14
> Any hints?
>
> Cheers,
> Stefan

--------------070207000405030500050701
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Martin, Stefan,<br>
<br>
I propose the following fix in TeneoHibernateMappingProvider:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">


Re: [CDO/Hibernate] Multiple issues [message #420274 is a reply to message #420267] Tue, 24 June 2008 17:47 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
Fine for me, the getEPackage is ofcourse the correct one (I used get, assuming that the EPackage
registry would only contain EPackages...).
Regarding that the subpackages are not checked against the registry anymore. I agree that the change
that a subpackage is registered before the parent package is very unlikely (if not impossible), so
your proposal below is correct afaics.

Can you check it in?

gr. Martin

Eike Stepper wrote:
> Hi Martin, Stefan,
>
> I propose the following fix in TeneoHibernateMappingProvider:
>
> | *protected *List<EPackage> resolveSubPackages(EPackage ePackage)
> {
> *final *List<EPackage> result = *new *ArrayList<EPackage>();
> resolveSubPackages(ePackage, result);
> *return *result;
> }
>
> *private **void *resolveSubPackages(EPackage ePackage, List<EPackage> result)
> {
> EPackage globalPackage = EPackage.Registry.INSTANCE.getEPackage(ePackage.getNsURI());
> *if *(globalPackage != *null*)
> {
> ePackage = globalPackage;
> }
>
> result.add(ePackage);
> *for *(EPackage subEPackage : ePackage.getESubpackages())
> {
> resolveSubPackages(subEPackage, result);
> }
> }|
>
>
> Stefan, if you file a Bugzilla, I can commit this fix, or do you want
> to, Martin?
>
> Cheers
> /Eike
>
>
>
> Stefan Winkler schrieb:
>> Hi,
>>
>> new comments below ...
>>
>>>> Issue 5:
>>>>
>>>> When calling getOrCreateResource() in a plugin activator's start()
>>>> method, I run into a deadlock.
>>>>
>>>> => Workaround: always do resource initialization lazyly
>>> I'd need to know more about your activator and its plugin. Can you
>>> please open a Bugzilla and attach code so that I can reproduce the
>>> deadlock (is it reproducible?).
>> Well, that was a problem in 0.8.0 in a rather complex scenario. I just
>> tried 1.0.0 with my simple scenario and was not able to reproduce.
>> I'll keep this one in mind and will open a bug if I come across it again.
>>
>>
>> I am now able to execute this once:
>>
>> public void writeObject() {
>> System.out.println("resource now contains " +
>> Activator.getDefault().getResource().getContents().size() + " products");
>> Product p = Model1Factory.eINSTANCE.createProduct();
>> p.setName("test");
>> p.setVat(VAT.VAT0);
>> Activator.getDefault().getResource().getContents().add(p);
>> Activator.getDefault().getTransaction().commit();
>> }
>>
>> When the testcase ends and the process terminates, I start the same
>> thing again and get a:
>>
>> [Serverside]
>> java.lang.ClassCastException:
>> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or cannot
>> be cast to org.eclipse.emf.ecore.EPackage
>> at
>> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.resolveSubPackages(TeneoHibernateMappingProvide r.java:133)
>>
>> at
>> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.generateMapping(TeneoHibernateMappingProvider.j ava:111)
>>
>> at
>> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.addMapping(TeneoHibernateMappingProvider.java:5 3)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .initConfiguration(HibernateStore.java:260)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .getHibernateSessionFactory(HibernateStore.java:96)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.createHibernateSession(HibernateStoreAccessor.java: 60)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.getHibernateSession(HibernateStoreAccessor.java:115 )
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readResourceID(HibernateStoreReader.java:89)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.ResourceManager.loadID(R esourceManager.java:92)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.ResourceManager.getResou rceID(ResourceManager.java:53)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.ResourceIDIndic ation.indicating(ResourceIDIndication.java:53)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:46)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>>
>> [Clientside hangs at (stack copy):]
>> Unsafe.park(boolean, long) line: not available [native method]
>> LockSupport.parkNanos(Object, long) line: not available
>> AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) line: not
>> available LinkedBlockingQueue<E>.poll(long, TimeUnit) line: not
>> available
>> SignalProtocol$SignalInputStream(BufferInputStream).ensureBu ffer()
>> line: 118 SignalProtocol$SignalInputStream(BufferInputStream).read()
>> line: 64 ExtendedDataInputStream(DataInputStream).readByte() line:
>> not available CDOIDUtil.read(ExtendedDataInput, CDOIDObjectFactory,
>> boolean) line: 101 CDOIDUtil.read(ExtendedDataInput,
>> CDOIDObjectFactory) line: 96
>> ResourceIDRequest.confirming(ExtendedDataInputStream) line: 62
>> ResourceIDRequest.confirming(ExtendedDataInputStream) line: 1
>> ResourceIDRequest(RequestWithConfirmation<RESULT>).execute(BufferInputStream,
>> BufferOutputStream) line: 57 ResourceIDRequest(Signal).runSync()
>> line: 143
>> CDOClientProtocol(SignalProtocol).startSignal(SignalActor<? >, long)
>> line: 236 ResourceIDRequest(SignalActor<RESULT>).send(long) line:
>> 50 ResourceIDRequest(SignalActor<RESULT>).send() line: 40
>> NOOPFailOverStrategy.send(RequestWithConfirmation<RESULT>) line: 29
>> CDOTransactionImpl(CDOViewImpl).getResourceID(String) line: 211
>> CDOTransactionImpl.getOrCreateResource(String) line: 202
>> Activator.getResource() line: 115 ClasspathTest.writeObject() line:
>> 14
>> Any hints?
>>
>> Cheers,
>> Stefan


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO/Hibernate] Multiple issues [message #420275 is a reply to message #420274] Tue, 24 June 2008 17:55 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Martin Taal schrieb:
> Hi Eike,
> Fine for me, the getEPackage is ofcourse the correct one (I used get,
> assuming that the EPackage registry would only contain EPackages...).
> Regarding that the subpackages are not checked against the registry
> anymore. I agree that the change that a subpackage is registered
> before the parent package is very unlikely (if not impossible), so
> your proposal below is correct afaics.
>
> Can you check it in?
Done: https://bugs.eclipse.org/238300

Btw. the hanging of the client in case of a server processing failure is
the expected behaviour. It should be gracefully finished by a timeout
expiration.

Cheers
/Eike


>
> gr. Martin
>
> Eike Stepper wrote:
>> Hi Martin, Stefan,
>>
>> I propose the following fix in TeneoHibernateMappingProvider:
>>
>> | *protected *List<EPackage> resolveSubPackages(EPackage ePackage)
>> {
>> *final *List<EPackage> result = *new *ArrayList<EPackage>();
>> resolveSubPackages(ePackage, result);
>> *return *result;
>> }
>>
>> *private **void *resolveSubPackages(EPackage ePackage,
>> List<EPackage> result)
>> {
>> EPackage globalPackage =
>> EPackage.Registry.INSTANCE.getEPackage(ePackage.getNsURI());
>> *if *(globalPackage != *null*)
>> {
>> ePackage = globalPackage;
>> }
>>
>> result.add(ePackage);
>> *for *(EPackage subEPackage : ePackage.getESubpackages())
>> {
>> resolveSubPackages(subEPackage, result);
>> }
>> }|
>>
>>
>> Stefan, if you file a Bugzilla, I can commit this fix, or do you want
>> to, Martin?
>>
>> Cheers
>> /Eike
>>
>>
>>
>> Stefan Winkler schrieb:
>>> Hi,
>>>
>>> new comments below ...
>>>
>>>>> Issue 5:
>>>>>
>>>>> When calling getOrCreateResource() in a plugin activator's start()
>>>>> method, I run into a deadlock.
>>>>>
>>>>> => Workaround: always do resource initialization lazyly
>>>> I'd need to know more about your activator and its plugin. Can you
>>>> please open a Bugzilla and attach code so that I can reproduce the
>>>> deadlock (is it reproducible?).
>>> Well, that was a problem in 0.8.0 in a rather complex scenario. I
>>> just tried 1.0.0 with my simple scenario and was not able to reproduce.
>>> I'll keep this one in mind and will open a bug if I come across it
>>> again.
>>>
>>>
>>> I am now able to execute this once:
>>>
>>> public void writeObject() {
>>> System.out.println("resource now contains " +
>>> Activator.getDefault().getResource().getContents().size() + "
>>> products");
>>> Product p = Model1Factory.eINSTANCE.createProduct();
>>> p.setName("test");
>>> p.setVat(VAT.VAT0);
>>> Activator.getDefault().getResource().getContents().add(p);
>>> Activator.getDefault().getTransaction().commit();
>>> }
>>>
>>> When the testcase ends and the process terminates, I start the same
>>> thing again and get a:
>>>
>>> [Serverside]
>>> java.lang.ClassCastException:
>>> org.eclipse.emf.ecore.plugin.RegistryReader$EPackageDescript or
>>> cannot be cast to org.eclipse.emf.ecore.EPackage
>>> at
>>> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.resolveSubPackages(TeneoHibernateMappingProvide r.java:133)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.generateMapping(TeneoHibernateMappingProvider.j ava:111)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.hibernate.teneo.TeneoHibernateMap pingProvider.addMapping(TeneoHibernateMappingProvider.java:5 3)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .initConfiguration(HibernateStore.java:260)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore .getHibernateSessionFactory(HibernateStore.java:96)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.createHibernateSession(HibernateStoreAccessor.java: 60)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Accessor.getHibernateSession(HibernateStoreAccessor.java:115 )
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readResourceID(HibernateStoreReader.java:89)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.server.ResourceManager.loadID(R esourceManager.java:92)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.server.ResourceManager.getResou rceID(ResourceManager.java:53)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.server.protocol.ResourceIDIndic ation.indicating(ResourceIDIndication.java:53)
>>>
>>> at
>>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:46)
>>>
>>> at
>>> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>>>
>>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
>>> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>>> Source)
>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>>> Source)
>>> at java.lang.Thread.run(Unknown Source)
>>>
>>> [Clientside hangs at (stack copy):]
>>> Unsafe.park(boolean, long) line: not available [native method]
>>> LockSupport.parkNanos(Object, long) line: not available
>>> AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) line:
>>> not available LinkedBlockingQueue<E>.poll(long, TimeUnit) line:
>>> not available
>>> SignalProtocol$SignalInputStream(BufferInputStream).ensureBu ffer()
>>> line: 118
>>> SignalProtocol$SignalInputStream(BufferInputStream).read() line:
>>> 64 ExtendedDataInputStream(DataInputStream).readByte() line: not
>>> available CDOIDUtil.read(ExtendedDataInput, CDOIDObjectFactory,
>>> boolean) line: 101 CDOIDUtil.read(ExtendedDataInput,
>>> CDOIDObjectFactory) line: 96
>>> ResourceIDRequest.confirming(ExtendedDataInputStream) line: 62
>>> ResourceIDRequest.confirming(ExtendedDataInputStream) line: 1
>>> ResourceIDRequest(RequestWithConfirmation<RESULT>).execute(BufferInputStream,
>>> BufferOutputStream) line: 57 ResourceIDRequest(Signal).runSync()
>>> line: 143
>>> CDOClientProtocol(SignalProtocol).startSignal(SignalActor<? >, long)
>>> line: 236 ResourceIDRequest(SignalActor<RESULT>).send(long) line:
>>> 50 ResourceIDRequest(SignalActor<RESULT>).send() line: 40
>>> NOOPFailOverStrategy.send(RequestWithConfirmation<RESULT>) line:
>>> 29 CDOTransactionImpl(CDOViewImpl).getResourceID(String) line:
>>> 211 CDOTransactionImpl.getOrCreateResource(String) line: 202
>>> Activator.getResource() line: 115 ClasspathTest.writeObject()
>>> line: 14 Any hints?
>>>
>>> Cheers,
>>> Stefan
>
>


Re: [CDO/Hibernate] Multiple issues [message #420336 is a reply to message #420265] Wed, 25 June 2008 07:36 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi Eike,

Eike Stepper schrieb:
> Stefan Winkler schrieb:
>> Small update:
>>>
>>> java.lang.NoClassDefFoundError:
>>> org/eclipse/emf/cdo/protocol/id/CDOIDObjectFactory
>>>
>>> This happens when
>>> org.eclipse.emf.cdo.server.hibernate.internal.id.CDOIDHibern ateFactoryImpl
>>> is to be loaded and the cause is that my checked-out version of
>>> hibernate-id-v1.jar still references the
>>> org.eclipse.emf.cdo.protocol package.
>>> Do I have to rebuild this library (how? ant-script anywhere?)
>> Rebuilt library (export as jar file, then copy jar into workspace
>> overwriting existing hibernate-id-v1.jar)
>>
>> => works
> I'll have to include this into the automated build, too ;-(
> Can you please file one more Bugzilla?
=> Bug 238382

Cheers,
Stefan
Re: [CDO/Hibernate] Multiple issues [message #420337 is a reply to message #420249] Wed, 25 June 2008 08:36 Go to previous message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
This is a multi-part message in MIME format.
--------------040307020804000809050705
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit

Hi Eike, hi Martin,

I updated to head and found an issue not directly like my initial issue
7, but seems kind of related. See below:

>> Issue 7:
>>
>> With all of these workarounds, I get to store and read my models in
>> one session alright.
>> However, when I close my application and reopen it, initialization
>> fails consistently when trying to get the contents of a resource:
>> getResource("/test").getContents() seems to not initialize the thread
>> context variables on the server:
>>
>> [...]
>> 24.06.2008 13:32:40 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
>> INFO: schema update complete
>> Thread-4 [debug] Setting session in threadlocal
>> Thread-4 [debug.revision] Setting version for
>> CDOResource@HBM-CDOResource-1v0: v1
>> Thread-4 [debug] Stored hb list in threadlocal: CDOResource.contents
>> Thread-4 [debug.session] Registering resource: HBM-CDOResource-1 <-->
>> /my/test/resource
>> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
>> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 03 01 00 00 00 01
>> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
>> Thread-4 [debug] Releasing hibernate session
>> main [debug.model] Reading CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> Thread-4 [debug] Closing hibernate session
>> main [debug.protocol] Read ID: HBM-CDOResource-1
>> [INFO] Legacy system not available
>> main [debug.object] Setting ID: HBM-CDOResource-1
>> main [debug.object] Setting view: CDOTransaction(1)
>> main [debug.object] Setting state PROXY for
>> CDOResource@HBM-CDOResource-1
>> main [debug.object] PREPARE: CDOResource@HBM-CDOResource-1 -->
>> CDOTransaction(1)
>> main [debug.protocol] Writing path: /my/test/resource
>> main [debug] Multiplexing 00 00 00 00 00 00 00 05 00 04 01 00 11 2f
>> 6d 79 2f 74 65 73 74 2f 72 65 73 6f 75 72 63 65 00
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug.protocol] Read path: /my/test/resource
>> Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
>> Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
>> Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 04 01 00 00 00 01
>> 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
>> main [debug.model] Reading CDOID of type 1 (OBJECT)
>> main [debug.protocol] Read ID: HBM-CDOResource-1
>> main [debug.object] Setting ID: HBM-CDOResource-1
>> main [debug.object] Setting view: CDOTransaction(1)
>> Thread-4 [debug] Releasing hibernate session
>> main [debug.view] Registering CDOResource@HBM-CDOResource-1
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> main [debug.object] ATTACH: CDOResource@HBM-CDOResource-1 -->
>> CDOTransaction(1)
>> main [debug.object] size(CDOResource@HBM-CDOResource-1,
>> CDOFeature(ID=2, name=contents, type=OBJECT,
>> referenceType=CDOClass(ID=0, name=CDOObject)))
>> main [debug.object] READ:
>> org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl
>> main [debug.protocol] Writing referenceChunk: -1
>> main [debug.protocol] Writing 1 IDs
>> main [debug.protocol] Writing ID: HBM-CDOResource-1
>> main [debug.model] Writing CDOID of type 1 (OBJECT)
>> main [debug] Multiplexing 00 00 00 00 00 00 00 06 00 07 00 00 00 00
>> 00 00 00 01 01 00 00 00 01 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f
>> 52 65 73 6f 75 72 63 65 00 00 00 00 00
>> main [debug.protocol] Reading 1 revisions
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug] Created
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader
>> for repository repo1
>> Thread-4 [debug.protocol] Read referenceChunk: -1
>> Thread-4 [debug.protocol] Reading 1 IDs
>> Thread-4 [debug.model] Reading CDOID of type 1 (OBJECT)
>> Thread-4 [debug.protocol] Read ID: HBM-CDOResource-1
>> Thread-4 [debug.protocol] Writing 1 revisions
>> Thread-4 [debug] Releasing hibernate session
>> Thread-4 [debug] Clearing session in threadlocal
>> Thread-4 [debug] Removing hibernate session
>> [ERROR] CommitContext not set
>> java.lang.IllegalStateException: CommitContext not set
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateThrea dContext.getCommitContext(HibernateThreadContext.java:69)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil. getCDORevision(HibernateUtil.java:117)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readRevision(HibernateStoreReader.java:155)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.RevisionManager.loadRevi sion(RevisionManager.java:210)
>>
>> at
>> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:282)
>>
>> at
>> org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionRe solverImpl.getRevision(CDORevisionResolverImpl.java:144)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.getRevision(LoadRevisionIndication.java:171)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.responding(LoadRevisionIndication.java:147)
>>
>> at
>> org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:54)
>>
>> at
>> org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
>>
>> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
>> at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
>> Source)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> at java.lang.Thread.run(Unknown Source)
>>
>> => no workaround => STOPPER!
> IIrc. Simon, Martin and I discussed this or a similar problem some
> time ago. I even believe that this was fixed already. Simon, Martin,
> can you remember if we have a Bugzilla/fix for this?

The console says:

INFO: Running hbm2ddl schema update
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: fetching database metadata
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: updating schema
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.address
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [orderaddress_product_e_id, street, testattribute,
company_customers_idx, e_id, preferred, company_suppliers_idx, city,
price, company_customers_e_id, name, dtype, orderaddress_order_e_id,
company_suppliers_e_id, e_version]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [orderdetail_product, company_customers,
company_suppliers, orderdetail_order]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [company_customers, orderdetail_product,
company_suppliers, primary, orderdetail_order]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.category
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [category_categories_idx, company_categories_idx,
company_categories_e_id, name, dtype, category_categories_e_id,
e_version, e_id]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [category_categories, company_categories]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [category_categories, company_categories, primary]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.cdo_resources
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [path, dtype, e_version, e_id]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: []
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [primary]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.customer_salesorders
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [customer_salesorders_idx, salesorder_e_id, customer_e_id]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk2df8b410a82fb2f4, fk2df8b41087204954]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [fk2df8b410a82fb2f4, primary, fk2df8b41087204954]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.order
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, purchaseorder_supplier_e_id,
company_salesorders_idx, salesorder_customer_e_id,
company_purchaseorders_e_id, company_salesorders_e_id,
company_purchaseorders_idx, dtype, date, e_version, e_id]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [purchaseorder_supplier, salesorder_customer,
company_purchaseorders, company_salesorders]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [purchaseorder_supplier, salesorder_customer, primary,
company_purchaseorders, company_salesorders]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.orderdetail
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [orderdetail_product_e_id, orderaddressdetail_order_e_id,
price, orderdetail_order_e_id, dtype, order_orderdetails_idx, e_version,
e_id, orderaddress_orderdetails_idx]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk7d606d1f1f4a92f4]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [fk7d606d1f1f4a92f4, primary]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.product_orderdetails
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [product_e_id, orderdetail_e_id, product_orderdetails_idx]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk8b9990848d386954, fk8b999084c35b0374]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [fk8b9990848d386954, fk8b999084c35b0374, primary]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.product
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [name, category_products_idx, category_products_e_id,
vat, dtype, e_version, e_id]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [category_products]
25.06.2008 10:22:08 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [primary, category_products]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.supplier_purchaseorders
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [purchaseorder_e_id, supplier_e_id,
supplier_purchaseorders_idx]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fk385305f971ef1ff4, fk385305f91cf4b7b4]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [primary, fk385305f971ef1ff4, fk385305f91cf4b7b4]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: requipse.contents
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [id, idx, entityname, idstring, idbinary]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: foreign keys: [fkde2f5b1a8c014b57]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: indexes: [primary, fkde2f5b1a8c014b57]
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
SCHWERWIEGEND: Unsuccessful: alter table `orderdetail` add index
orderdetail_order (`orderdetail_order_e_id`), add constraint
orderdetail_order foreign key (`orderdetail_order_e_id`) references
`order` (e_id)
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
SCHWERWIEGEND: Can't create table '.\requipse\#sql-334_c.frm' (errno: 121)
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
SCHWERWIEGEND: Unsuccessful: alter table `orderdetail` add index
orderdetail_product (`orderdetail_product_e_id`), add constraint
orderdetail_product foreign key (`orderdetail_product_e_id`) references
`product` (e_id)
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
SCHWERWIEGEND: Can't create table '.\requipse\#sql-334_c.frm' (errno: 121)
25.06.2008 10:22:09 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: schema update complete
[INFO] Legacy system not available
[ERROR] Session not set
java.lang.IllegalStateException: Session not set
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateThrea dContext.getSession(HibernateThreadContext.java:36)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateUtil. getCDORevision(HibernateUtil.java:145)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader.readRevision(HibernateStoreReader.java:147)
at
org.eclipse.emf.cdo.internal.server.RevisionManager.loadRevi sion(RevisionManager.java:210)
at
org.eclipse.emf.cdo.internal.common.revision.CDORevisionReso lverImpl.getRevision(CDORevisionResolverImpl.java:283)
at
org.eclipse.emf.cdo.internal.common.revision.CDORevisionReso lverImpl.getRevision(CDORevisionResolverImpl.java:145)
at
org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.getRevision(LoadRevisionIndication.java:171)
at
org.eclipse.emf.cdo.internal.server.protocol.LoadRevisionInd ication.responding(LoadRevisionIndication.java:147)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:54)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOReadIndicati on.execute(CDOReadIndication.java:38)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:143)
at org.eclipse.net4j.signal.Signal.run(Signal.java:124)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


The client hangs (or, more detailed, waits until timeout) at

Unsafe.park(boolean, long) line: not available [native method]
LockSupport.parkNanos(Object, long) line: not available
AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) line: not
available
LinkedBlockingQueue<E>.poll(long, TimeUnit) line: not available
SignalProtocol$SignalInputStream(BufferInputStream).ensureBu ffer() line:
118
SignalProtocol$SignalInputStream(BufferInputStream).read() line: 64
ExtendedDataInputStream(DataInputStream).readBoolean() line: not
available
ExtendedIOUtil.readString(DataInput) line: 187
ExtendedDataInputStream.readString() line: 36
CDOClassRefImpl.<init>(ExtendedDataInput, String) line: 48
CDOModelUtil.readClassRef(ExtendedDataInput, String) line: 134
CDOModelUtil.readClassRef(ExtendedDataInput) line: 139
CDORevisionImpl.<init>(ExtendedDataInput, CDORevisionResolver,
CDOPackageManager) line: 113
CDORevisionUtil.read(ExtendedDataInput, CDORevisionResolver,
CDOPackageManager) line: 48
LoadRevisionRequest.confirming(ExtendedDataInputStream) line: 122
LoadRevisionRequest.confirming(ExtendedDataInputStream) line: 1
LoadRevisionRequest(RequestWithConfirmation<RESULT>).execute(BufferInputStream,
BufferOutputStream) line: 57
LoadRevisionRequest(Signal).runSync() line: 143
CDOClientProtocol(SignalProtocol).startSignal(SignalActor<? >, long)
line: 236
LoadRevisionRequest(SignalActor<RESULT>).send(long) line: 50
LoadRevisionRequest(SignalActor<RESULT>).send() line: 40
NOOPFailOverStrategy.send(RequestWithConfirmation<RESULT>) line: 29
CDORevisionManagerImpl.send(LoadRevisionRequest) line: 257
CDORevisionManagerImpl.loadRevision(CDOID, int) line: 222
CDORevisionManagerImpl(CDORevisionResolverImpl).getRevision( CDOID, int,
boolean) line: 283
CDORevisionManagerImpl(CDORevisionResolverImpl).getRevision( CDOID, int,
boolean) line: 1
CDOTransactionImpl(CDOViewImpl).getRevision(CDOID, boolean) line: 300
CDOStateMachine$LoadTransition.execute(InternalCDOObject, CDOState,
CDOEvent, Object) line: 568
CDOStateMachine$LoadTransition.execute(Object, Enum, Enum, Object) line:
1
CDOStateMachine(FiniteStateMachine<STATE,EVENT,SUBJECT>).process(SUBJECT,
EVENT, DATA) line: 161
CDOStateMachine.read(InternalCDOObject) line: 181
CDOStore.getRevisionForReading(InternalCDOObject) line: 537
CDOStore.size(InternalEObject, EStructuralFeature) line: 220
CDOResourceImpl$PersistentContents(CDOObjectImpl$CDOStoreELi st <E>).delegateSize()
line: 777
CDOResourceImpl$PersistentContents(DelegatingEList<E>).size() line: 224
ClasspathTest.writeObject() line: 14

The code leading to this is, as in my previous tests:

| @Test
*public **void *writeObject() {
System.out.println("resource now contains " + Activator.getDefault().getResource().getContents().size() + " products");

Product p = Model1Factory.eINSTANCE.createProduct();
p.setName("test");
p.setVat(VAT.VAT0);

Activator.getDefault().getResource().getContents().add(p);
Activator.getDefault().getTransaction().commit();
}|


It is executed without error the first time.
When the test runs the second time (on the DB initialized the first
time) I get the error. (BTW line 14 - the line triggering the error is
still the |getResource().getContents().size()|). (seems to be the
..size() operation)

If you need a trace, I can do one for you. (Just let me know which
components).

Is this related to a known bug or should I open a new one?

Cheers
Stefan




--------------040307020804000809050705
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Eike, hi Martin,<br>
<br>
I updated to head and found an issue not directly like my initial issue
7, but seems kind of related. See below:<br>
<br>
<blockquote cite="mid:g3quad$deb$1@build.eclipse.org" type="cite">
<blockquote type="cite">Issue 7:
<br>
<br>
With all of these workarounds, I get to store and read my models in one
session alright.
<br>
However, when I close my application and reopen it, initialization
fails consistently when trying to get the contents of a resource:
<br>
getResource("/test").getContents() seems to not initialize the thread
context variables on the server:
<br>
<br>
[...]
<br>
24.06.2008 13:32:40 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
<br>
INFO: schema update complete
<br>
Thread-4 [debug] Setting session in threadlocal
<br>
Thread-4 [debug.revision] Setting version for
CDOResource@HBM-CDOResource-1v0: v1
<br>
Thread-4 [debug] Stored hb list in threadlocal: CDOResource.contents
<br>
Thread-4 [debug.session] Registering resource: HBM-CDOResource-1
&lt;--&gt; /my/test/resource
<br>
Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
<br>
Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
<br>
Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 03 01 00 00 00 01 00
00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
<br>
Thread-4 [debug] Releasing hibernate session
<br>
main [debug.model] Reading CDOID of type 1 (OBJECT)
<br>
Thread-4 [debug] Clearing session in threadlocal
<br>
Thread-4 [debug] Removing hibernate session
<br>
Thread-4 [debug] Closing hibernate session
<br>
main [debug.protocol] Read ID: HBM-CDOResource-1
<br>
[INFO] Legacy system not available
<br>
main [debug.object] Setting ID: HBM-CDOResource-1
<br>
main [debug.object] Setting view: CDOTransaction(1)
<br>
main [debug.object] Setting state PROXY for
CDOResource@HBM-CDOResource-1
<br>
main [debug.object] PREPARE: CDOResource@HBM-CDOResource-1 --&gt;
CDOTransaction(1)
<br>
main [debug.protocol] Writing path: /my/test/resource
<br>
main [debug] Multiplexing 00 00 00 00 00 00 00 05 00 04 01 00 11 2f 6d
79 2f 74 65 73 74 2f 72 65 73 6f 75 72 63 65 00
<br>
Thread-4 [debug] Created
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
repository repo1
<br>
Thread-4 [debug] Created
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
repository repo1
<br>
Thread-4 [debug.protocol] Read path: /my/test/resource
<br>
Thread-4 [debug.protocol] Writing ID: HBM-CDOResource-1
<br>
Thread-4 [debug.model] Writing CDOID of type 1 (OBJECT)
<br>
Thread-4 [debug] Multiplexing 00 00 00 00 00 00 00 04 01 00 00 00 01 00
00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65 73 6f 75 72 63 65 00
<br>
main [debug.model] Reading CDOID of type 1 (OBJECT)
<br>
main [debug.protocol] Read ID: HBM-CDOResource-1
<br>
main [debug.object] Setting ID: HBM-CDOResource-1
<br>
main [debug.object] Setting view: CDOTransaction(1)
<br>
Thread-4 [debug] Releasing hibernate session
<br>
main [debug.view] Registering CDOResource@HBM-CDOResource-1
<br>
Thread-4 [debug] Clearing session in threadlocal
<br>
Thread-4 [debug] Removing hibernate session
<br>
main [debug.object] ATTACH: CDOResource@HBM-CDOResource-1 --&gt;
CDOTransaction(1)
<br>
main [debug.object] size(CDOResource@HBM-CDOResource-1,
CDOFeature(ID=2, name=contents, type=OBJECT,
referenceType=CDOClass(ID=0, name=CDOObject)))
<br>
main [debug.object] READ:
org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl
<br>
main [debug.protocol] Writing referenceChunk: -1
<br>
main [debug.protocol] Writing 1 IDs
<br>
main [debug.protocol] Writing ID: HBM-CDOResource-1
<br>
main [debug.model] Writing CDOID of type 1 (OBJECT)
<br>
main [debug] Multiplexing 00 00 00 00 00 00 00 06 00 07 00 00 00 00 00
00 00 01 01 00 00 00 01 00 00 00 00 00 00 00 01 01 00 0b 43 44 4f 52 65
73 6f 75 72 63 65 00 00 00 00 00
<br>
main [debug.protocol] Reading 1 revisions
<br>
Thread-4 [debug] Created
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
repository repo1
<br>
Thread-4 [debug] Created
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Reader for
repository repo1
<br>
Thread-4 [debug.protocol] Read referenceChunk: -1
<br>
Thread-4 [debug.protocol] Reading 1 IDs
<br>
Thread-4 [debug.model] Reading CDOID of type 1 (OBJECT)
<br>
Thread-4 [debug.protocol] Read ID: HBM-CDOResource-1
<br>
Thread-4 [debug.protocol] Writing 1 revisions
<br>
Thread-4 [debug] Releasing hibernate session
<br>
Thread-4 [debug] Clearing session in threadlocal
<br>
Thread-4 [debug] Removing hibernate session
<br>
[ERROR] CommitContext not set
<br>
java.lang.IllegalStateException: CommitContext not set
<br>
Previous Topic:[CDO] How to remove a resource from the repository
Next Topic:Encoded attribute style
Goto Forum:
  


Current Time: Tue Apr 16 06:05:56 GMT 2024

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

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

Back to the top