net.sf.cglib.core.CodeGenerationException

tip

Look if your classpath is correct, and check if the versions of your libraries match the version you described in your pom.xml

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • I am wondering why I always get a exception during creating the session factory with the Eclipse plugin. After some tests I changed the mapping from: <class name="MFSTransportUnitTypeImpl" proxy="MFSTransportUnitType" table="transportunittype" dynamic-update="true" lazy="true"> to <class name="MFSTransportUnitTypeImpl" table="transportunittype" dynamic-update="true" lazy="true"> Without proxy mapping the plug in works fine, however I need the proxy. The implementation and interface class are in the same package and directory and within my application it works fine. So I suppose the plugin can not handle proxy mappings. The Exception: !ENTRY org.hibernate.eclipse.console 4 4 2006-11-28 13:22:13.610 !MESSAGE Problems while creating sessionfactory !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null !STACK 0 net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 23 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null !STACK 0 net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 23 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE java.lang.reflect.InvocationTargetException: <no message> !STACK 0 java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more Root exception: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType !STACK 0 java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) !ENTRY org.eclipse.ui 4 4 2006-11-28 13:22:43.699 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2006-11-28 13:22:43.699 !MESSAGE java.lang.reflect.InvocationTargetException-->null !STACK 0 net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:68) at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:56) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 47 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 52 more
    via by Kai Prünte,
  • I am wondering why I always get a exception during creating the session factory with the Eclipse plugin. After some tests I changed the mapping from: <class name="MFSTransportUnitTypeImpl" proxy="MFSTransportUnitType" table="transportunittype" dynamic-update="true" lazy="true"> to <class name="MFSTransportUnitTypeImpl" table="transportunittype" dynamic-update="true" lazy="true"> Without proxy mapping the plug in works fine, however I need the proxy. The implementation and interface class are in the same package and directory and within my application it works fine. So I suppose the plugin can not handle proxy mappings. The Exception: !ENTRY org.hibernate.eclipse.console 4 4 2006-11-28 13:22:13.610 !MESSAGE Problems while creating sessionfactory !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null !STACK 0 net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 23 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null !STACK 0 net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 23 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE java.lang.reflect.InvocationTargetException: <no message> !STACK 0 java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more Root exception: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-28 13:22:13.610 !MESSAGE java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType !STACK 0 java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) 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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) !ENTRY org.eclipse.ui 4 4 2006-11-28 13:22:43.699 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2006-11-28 13:22:43.699 !MESSAGE java.lang.reflect.InvocationTargetException-->null !STACK 0 net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:68) at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:56) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 47 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 52 more
    via by Kai Prünte,
  • NoClassDefFoundError ... HibernateProxy - Spring Forum
    via by Unknown author,
  • NCDFE in HQL Console
    via by Unknown author,
  • Classloading issues Hibernate/Spring DM/CGLib
    via by thrill...@gmail.com,
  • Hibernate error on tomcat
    via by Pablo M�ller,
  • In my application I am loading plug-ins mapping documents and persistent classes from jars using some UrlClassLoaders (one per plugin). I then set the threadContextClassLoader to be the CompositeClassLoader that holds all those UrlClassLoaders. Everything works fine until I add a proxy to one of the mapping document (I simplified the names a little): <hibernate-mapping> <subclass name="myplugin.MyExtension" discriminator-value="3" proxy="myplugin.IMyExtension" extends="core.MyBasicClass" > <join table="MY_EXTENSION"> <key column="ENTITY_ID"/> <property name="extraNumData" column="EXTRA_NUM_DATA" type="long"/> <property name="extraStrData" column="EXTRA_STR_DATA" type="string"/> </join> </subclass > </hibernate-mapping> See below the exception I get. Hibernate uses net.sf.cglib.proxy.Enhancer as the class generator in CGLIBLazyInitializer.getProxyFactory(). Now, it seeme like CGLIB allows customizing the ClassLoader used by its class generators using the method net.sf.cglib.core.AbstractClassGenerator.setClassLoader() (Enhancer extends AbstractClassGenerator). But, it doesn't seem like it is possible to use it in Hibernate, because this is how the Enhancer is used in CGLIBLazyInitializer.getProxyFactory() : return (Factory) Enhancer.create( (interfaces.length==1) ? persistentClass : null, interfaces, NULL_METHOD_INTERCEPTOR ); If I replace it with the following code, it works: Enhancer e = new Enhancer(); e.setSuperclass((interfaces.length==1) ? persistentClass : null); e.setInterfaces(interfaces); e.setCallback(NULL_METHOD_INTERCEPTOR); e.setClassLoader(Thread.currentThread().getContextClassLoader()); // this is the addition! return (Factory)e.create(); Is there any other way I can do it (I know I can implement my own persister, but it seems like there's too much code that needs to be overridden...)? Is there any planned enhancement regarding this issue? Full stack trace of any exception that occurs: CGLIB Enhancement failed: com.octavian.fas.domain.business.BusinessTransaction net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.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.java: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.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:777) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:703) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318) at com.octavian.sma.analytical.batch.SpringHelper.init(SpringHelper.java:77) at com.octavian.sma.analytical.batch.SpringHelper.<init>(SpringHelper.java:38) at com.octavian.sma.analytical.batch.dailynongrouping.DailyNonGroupingAnalyticalBatch.initSpringHelper(DailyNonGroupingAnalyticalBatch.java:44) at com.octavian.sma.analytical.batch.AnalyticalBatch.run(AnalyticalBatch.java:58) at com.octavian.sma.analytical.batch.dailynongrouping.DailyNonGroupingAnalyticalBatch.main(DailyNonGroupingAnalyticalBatch.java:29) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(AbstractClassGenerator.java:218) ... 28 more Caused by: java.lang.NoClassDefFoundError: myplugin/IMyBusinessTransactionExtension at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 33 more
    via by Moshe Ben Shoham,
    • net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.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.getProxyFactory(CGLIBLazyInitializer.java:121) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:269) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218) at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85) at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277) at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 23 more Caused by: java.lang.NoClassDefFoundError: com/ssn/acx/extensions/logistics/mfs/logisticobject/MFSTransportUnitType at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) ... 28 more

    Users with the same issue

    junior_cEngineerjunior_cEngineer
    1 times, last one,
    GhostsGhosts
    12 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    139 more bugmates