Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Error when using proxy in teneo/hibernate
Error when using proxy in teneo/hibernate [message #422626] Thu, 11 September 2008 12:32 Go to next message
Mikhail Kadan is currently offline Mikhail KadanFriend
Messages: 61
Registered: July 2009
Member
Hi.

I've added persistence option to my hibernate data store:

props.setProperty(PersistenceOptions.SET_PROXY, "true");

Now application throws exceptions like:

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:162)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:82)
at
org.eclipse.emf.teneo.hibernate.HbBaseSessionDataStore.getSe ssionFactory(HbBaseSessionDataStore.java:57)
at
com.go.cms.osgi.service.impl.HibernateContentManagerImpl.get Session(HibernateContentManagerImpl.java:243)
at
com.go.cms.osgi.service.impl.HibernateContentManagerImpl.exe cuteReadQuery(HibernateContentManagerImpl.java:814)
at
com.go.cms.classification.osgi.service.impl.ClassificationSe rviceImpl.getClassificationTypes(ClassificationServiceImpl.j ava:26)
at
com.go.cms.classification.resource.element.PClassificationRo ot.getChildren(PClassificationRoot.java:39)
at
com.go.cms.resource.element.impl.PContainerElement.hasChildr en(PContainerElement.java:17)
at
com.go.cms.resource.CmsBasicTreeContentProvider.hasChildren( CmsBasicTreeContentProvider.java:25)
at
org.eclipse.ui.internal.navigator.extensions.SafeDelegateTre eContentProvider.hasChildren(SafeDelegateTreeContentProvider .java:107)
at
org.eclipse.ui.internal.navigator.extensions.SafeDelegateTre eContentProvider.hasChildren(SafeDelegateTreeContentProvider .java:292)
at
org.eclipse.ui.internal.navigator.NavigatorContentServiceCon tentProvider.hasChildren(NavigatorContentServiceContentProvi der.java:662)
at
org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(Ab stractTreeViewer.java:2072)
at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer .java:582)
at
org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(Ab stractTreeViewer.java:2102)
at
org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(Abst ractTreeViewer.java:2752)
at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.j ava:842)
at
org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem( AbstractTreeViewer.java:828)
at
org.eclipse.ui.navigator.CommonViewer.createTreeItem(CommonV iewer.java:150)
at
org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractT reeViewer.java:802)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.viewers.AbstractTreeViewer.createChildren( AbstractTreeViewer.java:776)
at
org.eclipse.jface.viewers.TreeViewer.createChildren(TreeView er.java:634)
at
org.eclipse.jface.viewers.AbstractTreeViewer.internalInitial izeTree(AbstractTreeViewer.java:1490)
at
org.eclipse.jface.viewers.TreeViewer.internalInitializeTree( TreeViewer.java:823)
at
org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractT reeViewer.java:1474)
at
org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1365)
at
org.eclipse.jface.viewers.TreeViewer.preservingSelection(Tre eViewer.java:397)
at
org.eclipse.jface.viewers.StructuredViewer.preservingSelecti on(StructuredViewer.java:1328)
at
org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(Ab stractTreeViewer.java:1467)
at
org.eclipse.jface.viewers.ContentViewer.setInput(ContentView er.java:251)
at
org.eclipse.jface.viewers.StructuredViewer.setInput(Structur edViewer.java:1603)
at
org.eclipse.ui.navigator.CommonNavigator.createPartControl(C ommonNavigator.java:176)
at
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewR eference.java:371)
at
org.eclipse.ui.internal.ViewReference.createPart(ViewReferen ce.java:230)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:53 1)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:649)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.ja va:576)
at
org.eclipse.ui.internal.PartSashContainer.createControl(Part SashContainer.java:568)
at
org.eclipse.ui.internal.PerspectiveHelper.activate(Perspecti veHelper.java:271)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.j ava:964)
at
org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPa ge.java:2593)
at
org.eclipse.ui.internal.WorkbenchWindow$25.run(WorkbenchWind ow.java:2869)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchWindow.setActivePage(Workbe nchWindow.java:2850)
at
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:759)
at
org.eclipse.ui.internal.Workbench$21.runWithException(Workbe nch.java:1027)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3425)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:803)
at
org.eclipse.ui.internal.Workbench$27.runWithException(Workbe nch.java:1361)
at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3425)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2293)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
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)
... 95 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:127)
at
org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstant iate(CGLIBProxyFactory.java:43)
at
org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:214)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135)
at
org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:76)
... 100 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)
... 107 more
Caused by: java.lang.NoClassDefFoundError:
org/hibernate/proxy/HibernateProxy
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
... 113 more

Thanks.
Re: Error when using proxy in teneo/hibernate [message #422627 is a reply to message #422626] Thu, 11 September 2008 12:36 Go to previous messageGo to next message
Mikhail Kadan is currently offline Mikhail KadanFriend
Messages: 61
Registered: July 2009
Member
I want to add that I have HibernateProxy on classpath. Maybe this is some
OSGi classloader issue?
Re: Error when using proxy in teneo/hibernate [message #422633 is a reply to message #422627] Thu, 11 September 2008 14:46 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mikhail,
My guess would also be that this is a class-loading issue. Did you put the hibernate jars in a
separate plugin with buddy policy set to dependent?
Do you also have the cglib jar files in this plugin?

gr. Martin

Mikhail Kadan wrote:
> I want to add that I have HibernateProxy on classpath. Maybe this is
> some OSGi classloader issue?
>


--

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: Error when using proxy in teneo/hibernate [message #422638 is a reply to message #422633] Thu, 11 September 2008 15:31 Go to previous messageGo to next message
Mikhail Kadan is currently offline Mikhail KadanFriend
Messages: 61
Registered: July 2009
Member
Hi.

Yes, I've put all hibernate and cglib (cglib-2.1.3.jar) jars to separate
plugin, and set it's buddy policy to dependent.

I've tried to make sample plugin to localize this issue, but everything
seems fine with it. This problem only occurs in out large application,
which sources I am not allowed to provide.

Maybe you have some ideas why can this problem appear in large application
and not in small sample plugin?

Thanks.
Re: Error when using proxy in teneo/hibernate [message #422658 is a reply to message #422638] Fri, 12 September 2008 05:19 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mikhail,
Something I encountered with someone else is that there was also a hibernate.jar somewhere else in
their software and therefore they ended up with the same exception as you.

Other than that I don't know why it works in a small application and does not work in a larger
application.

gr. Martin

Mikhail Kadan wrote:
> Hi.
>
> Yes, I've put all hibernate and cglib (cglib-2.1.3.jar) jars to separate
> plugin, and set it's buddy policy to dependent.
>
> I've tried to make sample plugin to localize this issue, but everything
> seems fine with it. This problem only occurs in out large application,
> which sources I am not allowed to provide.
>
> Maybe you have some ideas why can this problem appear in large
> application and not in small sample plugin?
>
> Thanks.
>


--

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
Previous Topic:Bug: SetCommand changes order of elements in collection
Next Topic:[CDO] using generated .edit with CDO repo
Goto Forum:
  


Current Time: Tue Jan 21 02:09:07 GMT 2020

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

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

Back to the top