Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » new strange problem with hibernate 3
new strange problem with hibernate 3 [message #287403] Wed, 29 June 2005 15:53
Eclipse UserFriend
Originally posted by: michael.illgner.email.de

Hi folks,
I want to use hibernate3 in an eclipse 3.1 plugin.
It is a "new style " plugin without plugin.xml but the manifest contains
all needed jars

Bundle-ClassPath: lib/hibernate3.jar,
lib/asm.jar,
lib/cglib-2.1.jar,
lib/commons-collections-2.1.1.jar,
lib/commons-logging-1.0.4.jar,
lib/dom4j-1.6.jar,
lib/ehcache-1.1.jar,
lib/jta.jar,
lib/mysql-connector-java-3.1.10-bin.jar

In the plugins start method i want to instantiate the Session factory as
usual

public void start(BundleContext context) throws Exception {
super.start(context);

Thread current = Thread.currentThread();
ClassLoader oldLoader = current.getContextClassLoader();
try {
current.setContextClassLoader(getClass().getClassLoader());
SessionFactory factory = new
Configuration().configure().buildSessionFactory();
session = factory.openSession();
}
finally {
current.setContextClassLoader(oldLoader);
}
}

But that fails with

net.sf.cglib.core.CodeGenerationException:
java.lang.reflect.InvocationTargetException-->null
at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:236)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640)
at
org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGL IBLazyInitializer.java:94)
at
org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBP roxyFactory.java:42)
at
org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTupli zer.java:144)
at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)
at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.jav a:47)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218)
at
org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:104)
at
org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:55)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1005)
at test.Data.DataPlugin.start(DataPlugin.java:39)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:994)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:988)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:969)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:321)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:266)
at
org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLoca lClass(EclipseClassLoader.java:116)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:337)
at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage .loadClass(SingleSourcePackage.java:37)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:386)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:350)
at
org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader. loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
at test.App.Perspective.createInitialLayout(Perspective.java:11 )
at
org.eclipse.ui.internal.Perspective.loadPredefinedPersp(Pers pective.java:696)
at
org.eclipse.ui.internal.Perspective.createPresentation(Persp ective.java:230)
at org.eclipse.ui.internal.Perspective.<init>(Perspective.java:127)
at
org.eclipse.ui.internal.WorkbenchPage.createPerspective(Work benchPage.java:1375)
at org.eclipse.ui.internal.WorkbenchPage.init(WorkbenchPage.jav a:2071)
at org.eclipse.ui.internal.WorkbenchPage.<init>(WorkbenchPage.java:509)
at
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(Workben chWindow.java:678)
at
org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Wo rkbench.java:669)
at
org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Work bench.java:1282)
at
org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbe nch.java:1223)
at
org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWin dow(WorkbenchConfigurer.java:190)
at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:706)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1034)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1636)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at test.App.Application.run(Application.java:18)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java :373)
at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClas sGenerator.java:218)
... 59 more
Caused by: java.lang.NoClassDefFoundError:
org/hibernate/proxy/HibernateProxy
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
... 65 more

Why can't this proxy class loaded but the other org.hibernate.* classes
can ?

Any hints ?
Previous Topic:Please, elp with serializing Object in launch config string attribute (repost)
Next Topic:Deprecation Warnings in plugin.xml [Eclipse 3.1]
Goto Forum:
  


Current Time: Wed Apr 24 19:37:12 GMT 2024

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

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

Back to the top