Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Problem using Proxy Annotation
[Teneo] Problem using Proxy Annotation [message #81504] Mon, 30 April 2007 10:23 Go to next message
Eclipse UserFriend
Originally posted by: cn.arcsolutions.de

Hi Martin!

I've tried to use the new @Proxy annotation in Teneo 0.8.0 but unfortunately I'll can't use it. Every time I try, I get this nice exception. It seems to be a CGLIB problem again, but I'm wondering why nobody else gets it.
Has someone here already solved this problem?
Thanx for any kind of help

Christian



org.hibernate.HibernateException: Could not build tuplizer [org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer]
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 110)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:48)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
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:1294)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
....
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 107)
... 12 more
Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:237)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy Factory(CGLIBLazyInitializer.java:117)
at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstant iate(CGLIBProxyFactory.java:43)
at org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:218)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:75)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java :384)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:219)
... 24 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
... 30 more
Re: [Teneo] Problem using Proxy Annotation [message #81521 is a reply to message #81504] Mon, 30 April 2007 10:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
The cause can be that you miss certain required libraries (maybe cglib?).
or/and related to plugin classloading.

A google search on:
cglib java.lang.NoClassDefFoundError HibernateProxy

will give a fair amount of hits. Did you try that?

gr. Martin

Christian Neudert wrote:
> Hi Martin!
>
> I've tried to use the new @Proxy annotation in Teneo 0.8.0 but
> unfortunately I'll can't use it. Every time I try, I get this nice
> exception. It seems to be a CGLIB problem again, but I'm wondering why
> nobody else gets it. Has someone here already solved this problem?
> Thanx for any kind of help
>
> Christian
>
>
>
> org.hibernate.HibernateException: Could not build tuplizer
> [org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer]
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 110)
>
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:48)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
> 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:1294)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
>
> ....
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n
> Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 107)
>
> ... 12 more
> Caused by: net.sf.cglib.core.CodeGenerationException:
> java.lang.reflect.InvocationTargetException-->null
> at
> net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:237)
>
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
> at
> org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy Factory(CGLIBLazyInitializer.java:117)
>
> at
> org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstant iate(CGLIBProxyFactory.java:43)
>
> at
> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:218)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
>
> at
> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:75)
>
> ... 17 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java :384)
> at
> net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:219)
>
> ... 24 more
> Caused by: java.lang.NoClassDefFoundError:
> org/hibernate/proxy/HibernateProxy
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> ... 30 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: [Teneo] Problem using Proxy Annotation [message #81616 is a reply to message #81521] Mon, 30 April 2007 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cn.arcsolutions.de

Hi Martin,

I've read several post on this sites but none of their problem was mine, or could be fixed with their hints.
I've read that setting default-lazy="false" in the hbm.xml would solve the problem but I can't use a static hbm file.

I've wrapped Hibernate in one plugin as recommended on your site,
so maybe you can send me your plugin, and I can check if it's my fault and where it is!?

thanx
Christian
Re: [Teneo] Problem using Proxy Annotation [message #81631 is a reply to message #81504] Mon, 30 April 2007 15:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cn.arcsolutions.de

Maybe this is eclipse 3.3M6 related because I also get Exceptions when trying to use c3p0, which was no problem under 3.2!?

Christian



!ENTRY de.arcsolutions.remarc.platform.data.hibernaterepository 4 1 2007-04-30 17:19:37.584
!MESSAGE
!STACK 0
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:350)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:495)
at de.arcsolutions.remarc.platform.data.hibernaterepository.Hib ernateDataRepositoryRoot.getIClassificationsProvider(Hiberna teDataRepositoryRoot.java:95)
at de.arcsolutions.remarc.platform.ui.classificationsview.Combo Provider.getElements(ComboProvider.java:109)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildr en(StructuredViewer.java:871)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren (StructuredViewer.java:994)
at org.eclipse.jface.viewers.AbstractListViewer.inputChanged(Ab stractListViewer.java:336)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
at org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1624)
at de.arcsolutions.remarc.platform.ui.classificationsview.Class ificationsViewPart.changeInput(ClassificationsViewPart.java: 424)
at de.arcsolutions.remarc.platform.ui.classificationsview.Switc hRepositioryAction.run(SwitchRepositioryAction.java:59)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:545)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3673)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3284)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2337)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2301)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 76)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:463)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:458)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at de.arcsolutions.remarc.rcp.application.PlatformRunnable.run( PlatformRunnable.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:533)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:148)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:356)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 476)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416)
at org.eclipse.equinox.launcher.Main.run(Main.java:1141)
at org.eclipse.equinox.launcher.Main.main(Main.java:1116)
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:471)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:430)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:413)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.a ttemptManageC3P0Registry(ActiveManagementCoordinator.java:52 )
at com.mchange.v2.c3p0.C3P0Registry.attemptRegisterRegistryMBea n(C3P0Registry.java:217)
at com.mchange.v2.c3p0.C3P0Registry.reregister(C3P0Registry.jav a:242)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:228)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:62)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:68)
at com.mchange.v2.c3p0.PoolBackedDataSource.<init>(PoolBackedDataSource.java:37)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:267)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:316)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3 P0ConnectionProvider.java:159)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.p repare(ManagedProviderConnectionHelper.java:27)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:127)
at org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:557)
at org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore(HbDataStore.java:199)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:74)
...
Root exception:
java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:471)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:430)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:413)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.a ttemptManageC3P0Registry(ActiveManagementCoordinator.java:52 )
at com.mchange.v2.c3p0.C3P0Registry.attemptRegisterRegistryMBea n(C3P0Registry.java:217)
at com.mchange.v2.c3p0.C3P0Registry.reregister(C3P0Registry.jav a:242)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:228)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:62)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:68)
at com.mchange.v2.c3p0.PoolBackedDataSource.<init>(PoolBackedDataSource.java:37)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:267)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:316)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3 P0ConnectionProvider.java:159)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.p repare(ManagedProviderConnectionHelper.java:27)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:127)
at org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:557)
at org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore(HbDataStore.java:199)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:74)
...
Re: [Teneo] Problem using Proxy Annotation [message #81646 is a reply to message #81616] Mon, 30 April 2007 17:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
I am sorry but I can't really help you on this one. I use Teneo/emf in a web environment and have
less to do with plugin classloading issues. You can set lazy to false but that is the same as not
using proxying. So the proxy annotation gives you many-to-one and one-to-one lazy loading but with
the disadvantage of using cglib.

You can try out different buddy policy settings and check out how cglib loads classes.

gr. Martin

Christian Neudert wrote:
> Hi Martin,
>
> I've read several post on this sites but none of their problem was mine,
> or could be fixed with their hints.
> I've read that setting default-lazy="false" in the hbm.xml would solve
> the problem but I can't use a static hbm file.
>
> I've wrapped Hibernate in one plugin as recommended on your site,
> so maybe you can send me your plugin, and I can check if it's my fault
> and where it is!?
>
> thanx Christian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: [Teneo] Problem using Proxy Annotation [message #81890 is a reply to message #81504] Fri, 04 May 2007 09:24 Go to previous messageGo to next message
Matthieu Helleboid is currently offline Matthieu HelleboidFriend
Messages: 18
Registered: July 2009
Junior Member
Hello,

I've made it work, after reading
http://www.eclipsezone.com/articles/eclipse-vms/.

Suppose you have 3 plugins : org.mycompany.client, org.mycompany.hibernate
(hibernate libs), org.mycompany.model.

Use :
org.mycompany.model/META-INF/MANIFEST.MF:Eclipse-BuddyPolicy : registered
org.mycompany.client/META-INF/MANIFEST.MF:Eclipse-BuddyPolic y: registered
org.mycompanytalend.hibernate/META-INF/MANIFEST.MF:Eclipse-R egisterBuddy:
org.mycompany.client, org.mycompany.model

and in your code :
Properties properties = new Properties();
properties.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "true");
properties.setProperty(PersistenceOptions.SET_PROXY, "true");
dataStore.setPersistenceProperties(properties);

Matthieu

Le Mon, 30 Apr 2007 12:23:00 +0200, Christian Neudert a écrit:

> Hi Martin!
>
> I've tried to use the new @Proxy annotation in Teneo 0.8.0 but unfortunately I'll can't use it. Every time I try, I get this nice exception. It seems to be a CGLIB problem again, but I'm wondering why nobody else gets it.
> Has someone here already solved this problem?
> Thanx for any kind of help
>
> Christian
>
>
>
> org.hibernate.HibernateException: Could not build tuplizer [org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer]
> at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 110)
> at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:48)
> at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
> 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:1294)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
> ....
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 107)
> ... 12 more
> Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:237)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy Factory(CGLIBLazyInitializer.java:117)
> at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstant iate(CGLIBProxyFactory.java:43)
> at org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:218)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
> at org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:75)
> ... 17 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java :384)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:219)
> ... 24 more
> Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> ... 30 more
Re: [Teneo] Problem using Proxy Annotation [message #82608 is a reply to message #81890] Tue, 08 May 2007 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cn.arcsolutions.de

Thanks a lot Matthieu!

After reading your post and the article i managed to get it working!
By the way there is some more todo if the datamodel is split over many plugins and has references to each other:

- of course all plugins must be registered as buddys to your hibernate plugin
- also under some circumstances its required to add "dependent" to Eclipse-BuddyPolicy in your hibernate (in my case also in client) plugin!
(for example: "Eclipse-BuddyPolicy: registered, dependent")

cheers

cn
Re: [Teneo] Problem using Proxy Annotation [message #82724 is a reply to message #82608] Thu, 10 May 2007 09:57 Go to previous message
Matthieu Helleboid is currently offline Matthieu HelleboidFriend
Messages: 18
Registered: July 2009
Junior Member
You are totally right

I found the ciscumstances you're talking about, with this error
org.hibernate.MappingException: Could not determine type for:
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType

The documentation talks about this problem :
http://www.elver.org/hibernate/tutorialtwo/tutorial2_1.html and
http://www.elver.org/hibernate/installation.html#Hibernate+L ibraries

So, thanks Christian

Le Tue, 08 May 2007 17:44:52 +0200, Christian Neudert a écrit:

> Thanks a lot Matthieu!
>
> After reading your post and the article i managed to get it working!
> By the way there is some more todo if the datamodel is split over many plugins and has references to each other:
>
> - of course all plugins must be registered as buddys to your hibernate plugin
> - also under some circumstances its required to add "dependent" to Eclipse-BuddyPolicy in your hibernate (in my case also in client) plugin!
> (for example: "Eclipse-BuddyPolicy: registered, dependent")
>
> cheers
>
> cn
Re: [Teneo] Problem using Proxy Annotation [message #605150 is a reply to message #81504] Mon, 30 April 2007 10:58 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
The cause can be that you miss certain required libraries (maybe cglib?).
or/and related to plugin classloading.

A google search on:
cglib java.lang.NoClassDefFoundError HibernateProxy

will give a fair amount of hits. Did you try that?

gr. Martin

Christian Neudert wrote:
> Hi Martin!
>
> I've tried to use the new @Proxy annotation in Teneo 0.8.0 but
> unfortunately I'll can't use it. Every time I try, I get this nice
> exception. It seems to be a CGLIB problem again, but I'm wondering why
> nobody else gets it. Has someone here already solved this problem?
> Thanx for any kind of help
>
> Christian
>
>
>
> org.hibernate.HibernateException: Could not build tuplizer
> [org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer]
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 110)
>
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:48)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
> 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:1294)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
>
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
>
> ....
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n
> Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 107)
>
> ... 12 more
> Caused by: net.sf.cglib.core.CodeGenerationException:
> java.lang.reflect.InvocationTargetException-->null
> at
> net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:237)
>
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
> at
> org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy Factory(CGLIBLazyInitializer.java:117)
>
> at
> org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstant iate(CGLIBProxyFactory.java:43)
>
> at
> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:218)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
>
> at
> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:75)
>
> ... 17 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java :384)
> at
> net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:219)
>
> ... 24 more
> Caused by: java.lang.NoClassDefFoundError:
> org/hibernate/proxy/HibernateProxy
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> ... 30 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: [Teneo] Problem using Proxy Annotation [message #605172 is a reply to message #81521] Mon, 30 April 2007 15:01 Go to previous message
Christian Neudert is currently offline Christian NeudertFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Martin,

I've read several post on this sites but none of their problem was mine, or could be fixed with their hints.
I've read that setting default-lazy="false" in the hbm.xml would solve the problem but I can't use a static hbm file.

I've wrapped Hibernate in one plugin as recommended on your site,
so maybe you can send me your plugin, and I can check if it's my fault and where it is!?

thanx
Christian
Re: [Teneo] Problem using Proxy Annotation [message #605174 is a reply to message #81504] Mon, 30 April 2007 15:23 Go to previous message
Christian Neudert is currently offline Christian NeudertFriend
Messages: 13
Registered: July 2009
Junior Member
Maybe this is eclipse 3.3M6 related because I also get Exceptions when trying to use c3p0, which was no problem under 3.2!?

Christian



!ENTRY de.arcsolutions.remarc.platform.data.hibernaterepository 4 1 2007-04-30 17:19:37.584
!MESSAGE
!STACK 0
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:350)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:495)
at de.arcsolutions.remarc.platform.data.hibernaterepository.Hib ernateDataRepositoryRoot.getIClassificationsProvider(Hiberna teDataRepositoryRoot.java:95)
at de.arcsolutions.remarc.platform.ui.classificationsview.Combo Provider.getElements(ComboProvider.java:109)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(St ructuredViewer.java:937)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildr en(StructuredViewer.java:871)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren (StructuredViewer.java:994)
at org.eclipse.jface.viewers.AbstractListViewer.inputChanged(Ab stractListViewer.java:336)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
at org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1624)
at de.arcsolutions.remarc.platform.ui.classificationsview.Class ificationsViewPart.changeInput(ClassificationsViewPart.java: 424)
at de.arcsolutions.remarc.platform.ui.classificationsview.Switc hRepositioryAction.run(SwitchRepositioryAction.java:59)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:545)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3673)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3284)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2337)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2301)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 76)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:463)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:458)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at de.arcsolutions.remarc.rcp.application.PlatformRunnable.run( PlatformRunnable.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hod(EclipseAppContainer.java:533)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:148)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:356)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 476)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:416)
at org.eclipse.equinox.launcher.Main.run(Main.java:1141)
at org.eclipse.equinox.launcher.Main.main(Main.java:1116)
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:471)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:430)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:413)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.a ttemptManageC3P0Registry(ActiveManagementCoordinator.java:52 )
at com.mchange.v2.c3p0.C3P0Registry.attemptRegisterRegistryMBea n(C3P0Registry.java:217)
at com.mchange.v2.c3p0.C3P0Registry.reregister(C3P0Registry.jav a:242)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:228)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:62)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:68)
at com.mchange.v2.c3p0.PoolBackedDataSource.<init>(PoolBackedDataSource.java:37)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:267)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:316)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3 P0ConnectionProvider.java:159)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.p repare(ManagedProviderConnectionHelper.java:27)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:127)
at org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:557)
at org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore(HbDataStore.java:199)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:74)
...
Root exception:
java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:501)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:471)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:430)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:413)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:408)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.a ttemptManageC3P0Registry(ActiveManagementCoordinator.java:52 )
at com.mchange.v2.c3p0.C3P0Registry.attemptRegisterRegistryMBea n(C3P0Registry.java:217)
at com.mchange.v2.c3p0.C3P0Registry.reregister(C3P0Registry.jav a:242)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:228)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:62)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init >(AbstractPoolBackedDataSource.java:68)
at com.mchange.v2.c3p0.PoolBackedDataSource.<init>(PoolBackedDataSource.java:37)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:267)
at com.mchange.v2.c3p0.DataSources.pooledDataSource(DataSources .java:316)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3 P0ConnectionProvider.java:159)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnec tionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.p repare(ManagedProviderConnectionHelper.java:27)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate .java:127)
at org.eclipse.emf.teneo.hibernate.HbDataStore.updateDatabaseSc hema(HbDataStore.java:557)
at org.eclipse.emf.teneo.hibernate.HbDataStore.initializeDataSt ore(HbDataStore.java:199)
at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:74)
...
Re: [Teneo] Problem using Proxy Annotation [message #605177 is a reply to message #81616] Mon, 30 April 2007 17:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Christian,
I am sorry but I can't really help you on this one. I use Teneo/emf in a web environment and have
less to do with plugin classloading issues. You can set lazy to false but that is the same as not
using proxying. So the proxy annotation gives you many-to-one and one-to-one lazy loading but with
the disadvantage of using cglib.

You can try out different buddy policy settings and check out how cglib loads classes.

gr. Martin

Christian Neudert wrote:
> Hi Martin,
>
> I've read several post on this sites but none of their problem was mine,
> or could be fixed with their hints.
> I've read that setting default-lazy="false" in the hbm.xml would solve
> the problem but I can't use a static hbm file.
>
> I've wrapped Hibernate in one plugin as recommended on your site,
> so maybe you can send me your plugin, and I can check if it's my fault
> and where it is!?
>
> thanx Christian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: [Teneo] Problem using Proxy Annotation [message #605229 is a reply to message #81504] Fri, 04 May 2007 09:24 Go to previous message
Matthieu Helleboid is currently offline Matthieu HelleboidFriend
Messages: 18
Registered: July 2009
Junior Member
Hello,

I've made it work, after reading
http://www.eclipsezone.com/articles/eclipse-vms/

Suppose you have 3 plugins : org.mycompany.client, org.mycompany.hibernate
(hibernate libs), org.mycompany.model.

Use :
org.mycompany.model/META-INF/MANIFEST.MF:Eclipse-BuddyPolicy : registered
org.mycompany.client/META-INF/MANIFEST.MF:Eclipse-BuddyPolic y: registered
org.mycompanytalend.hibernate/META-INF/MANIFEST.MF:Eclipse-R egisterBuddy:
org.mycompany.client, org.mycompany.model

and in your code :
Properties properties = new Properties();
properties.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "true");
properties.setProperty(PersistenceOptions.SET_PROXY, "true");
dataStore.setPersistenceProperties(properties);

Matthieu

Le Mon, 30 Apr 2007 12:23:00 +0200, Christian Neudert a écrit:

> Hi Martin!
>
> I've tried to use the new @Proxy annotation in Teneo 0.8.0 but unfortunately I'll can't use it. Every time I try, I get this nice exception. It seems to be a CGLIB problem again, but I'm wondering why nobody else gets it.
> Has someone here already solved this problem?
> Thanx for any kind of help
>
> Christian
>
>
>
> org.hibernate.HibernateException: Could not build tuplizer [org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer]
> at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 110)
> at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:48)
> at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
> 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:1294)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
> at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
> ....
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping .buildEntityTuplizer(EntityEntityModeToTuplizerMapping.java: 107)
> ... 12 more
> Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:237)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
> at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxy Factory(CGLIBLazyInitializer.java:117)
> at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstant iate(CGLIBProxyFactory.java:43)
> at org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:218)
> at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
> at org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:75)
> ... 17 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java :384)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:219)
> ... 24 more
> Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> ... 30 more
Re: [Teneo] Problem using Proxy Annotation [message #606630 is a reply to message #81890] Tue, 08 May 2007 15:44 Go to previous message
Christian Neudert is currently offline Christian NeudertFriend
Messages: 13
Registered: July 2009
Junior Member
Thanks a lot Matthieu!

After reading your post and the article i managed to get it working!
By the way there is some more todo if the datamodel is split over many plugins and has references to each other:

- of course all plugins must be registered as buddys to your hibernate plugin
- also under some circumstances its required to add "dependent" to Eclipse-BuddyPolicy in your hibernate (in my case also in client) plugin!
(for example: "Eclipse-BuddyPolicy: registered, dependent")

cheers

cn
Re: [Teneo] Problem using Proxy Annotation [message #606646 is a reply to message #82608] Thu, 10 May 2007 09:57 Go to previous message
Matthieu Helleboid is currently offline Matthieu HelleboidFriend
Messages: 18
Registered: July 2009
Junior Member
You are totally right

I found the ciscumstances you're talking about, with this error
org.hibernate.MappingException: Could not determine type for:
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType

The documentation talks about this problem :
http://www.elver.org/hibernate/tutorialtwo/tutorial2_1.html and
http://www.elver.org/hibernate/installation.html#Hibernate+L ibraries

So, thanks Christian

Le Tue, 08 May 2007 17:44:52 +0200, Christian Neudert a écrit:

> Thanks a lot Matthieu!
>
> After reading your post and the article i managed to get it working!
> By the way there is some more todo if the datamodel is split over many plugins and has references to each other:
>
> - of course all plugins must be registered as buddys to your hibernate plugin
> - also under some circumstances its required to add "dependent" to Eclipse-BuddyPolicy in your hibernate (in my case also in client) plugin!
> (for example: "Eclipse-BuddyPolicy: registered, dependent")
>
> cheers
>
> cn
Previous Topic:[Teneo]lazy collection pagination
Next Topic:[Teneo]lazy collection pagination
Goto Forum:
  


Current Time: Fri Jan 22 13:42:56 GMT 2021

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

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

Back to the top