[Hibernate-JIRA] Created: (HHH-2204) transient field make Configuration deserializing error
by ronald feng (JIRA)
transient field make Configuration deserializing error
-------------------------------------------------------
Key: HHH-2204
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2204
Project: Hibernate3
Type: Bug
Components: build
Versions: 3.1.3
Environment: hibernate 3.1.3
database: HSQLDB
Reporter: ronald feng
[code]
Configuration configuration=null;
try {
Configuration configurationSerializable = new Configuration();
FileOutputStream fos = new FileOutputStream("serial");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(configurationSerializable);
oos.flush();
oos.close();
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
try {
FileInputStream fis = new FileInputStream("serial");
ObjectInputStream ois = new ObjectInputStream(fis);
configuration = (Configuration) ois.readObject();
ois.close();
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
catch (ClassNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
if(configuration!=null)
{
SessionFactory sessionFactory = configuration.configure().buildSessionFactory();
}
}
[/code]
protected transient Map typeDefs;
the typeDefs will be null after deserializing.
[code]Exception in thread "main" java.lang.NullPointerException
at org.hibernate.cfg.Mappings.getTypeDef(Mappings.java:376)
at org.hibernate.cfg.HbmBinder.bindSimpleValueType(HbmBinder.java:1161)
at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1129)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:400)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:343)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:282)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:153)
at org.hibernate.cfg.Configuration.add(Configuration.java:386)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1296)
at org.rzeus.hibernate.test.TestSerializeAndTransient.main(TestSerializeAndTransient.java:50)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)[/code]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 6 months
[Hibernate-JIRA] Created: (HBX-832) proxy mapping throws a java.lang.NoClassDefFoundError
by Kai Prünte (JIRA)
proxy mapping throws a java.lang.NoClassDefFoundError
-----------------------------------------------------
Key: HBX-832
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-832
Project: Hibernate Tools
Type: Bug
Components: eclipse
Versions: 3.2beta9, 3.2beta8
Environment: Windows XP, Java 1.5.0_08-b03, Hibernate 3.2.1 GA
Reporter: 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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 6 months
[Hibernate-JIRA] Created: (HHH-2119) reloading a detached object with a collection fails
by Gregory Kotsaftis (JIRA)
reloading a detached object with a collection fails
---------------------------------------------------
Key: HHH-2119
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2119
Project: Hibernate3
Type: Bug
Versions: 3.1.3
Environment: Hibernate 3.1.3
firebird 1.5.3.4870 with Jaybird-2.1.0
java 1.5.0_07
Reporter: Gregory Kotsaftis
Hi,
1) I have a simple object <O> with a collection loaded and use <version> for both (no second level cache)
2) The object <O> is associated with session A, via <O> = load(CLASS, <ID>)
3) The session <A> is later closed because e.g. an exception occurs
4) Another session is opened later on, session B
5) If load(<O>, <ID>) is called an NonUniqueObjectException is thrown
(a different object with the same identifier value was already associated with the session)
6) If instead I use the session.refresh(<O>) no exception is thrown, the object is reloaded ok.
It seems this issue might be related with:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-511
but i cannot be sure.
Part of the stacktrace:
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [gr.metadata.orthomed.db.Patient#23]
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:132)
at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:202)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:169)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:770)
at gr.metadata.lib.hibernate.HibernateHelper.reloadObject(HibernateHelper.java:230)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 7 months
[Hibernate-JIRA] Created: (HHH-2183) org.hibernate.LazyInitializationException: failed to lazily initialize a collection while using lazy set with key as property-ref in the mapping
by Artur Jonak (JIRA)
org.hibernate.LazyInitializationException: failed to lazily initialize a collection while using lazy set with key as property-ref in the mapping
------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2183
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2183
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: Oracle 9i
Reporter: Artur Jonak
Priority: Blocker
Attachments: hibernate-testcase.zip
I have an entity which can have multiple titles located in a separate table. I mapped this as a set where key attribute references other property of the entity:
<set name="titles" table="TTitle" cascade="none" lazy="true" inverse="true" mutable="false">
<key column="ID" property-ref="parentId"/>
<!--key column="ID"/-->
<element type="string" column="title"/>
</set>
when I try to display this set I get an exception:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: test.lazysetinit.Record.titles, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
...
The entire mapping is as follows:
<class name="Record" table="TRecord" mutable="false">
<id name="id" type="long">
<column name="ID" sql-type="number" length="12" not-null="true" unique="true"/>
</id>
<set name="titles" table="TTitle" cascade="none" lazy="true" inverse="true" mutable="false">
<key column="ID" property-ref="parentId"/>
<!--key column="ID"/-->
<element type="string" column="title"/>
</set>
<join table="TRecordInfo" inverse="true" fetch="join" optional="false">
<key column="ID"/>
<property name="parentId" not-null="false" />
<property name="status" />
</join>
</class>
Attached the test case: test.lazysetinit.LazySetInitTest. DB schema is located in test/conf/lazysetinit/schema.sql
Regards,
Artur
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 8 months
[Hibernate-JIRA] Created: (HHH-2155) mysql dialect should not generate automatically index for foreign key
by Anthony Patricio (JIRA)
mysql dialect should not generate automatically index for foreign key
---------------------------------------------------------------------
Key: HHH-2155
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2155
Project: Hibernate3
Type: Improvement
Components: core
Environment: MySQL
Reporter: Anthony Patricio
Priority: Minor
Attachments: patch-mysqlDialect.txt
MySQLDialect.getAddForeignKeyConstraintString(String, String[], String, String[], boolean) method is generating also index which is not wanted.
Here is the modified method:
public String getAddForeignKeyConstraintString(
String constraintName,
String[] foreignKey,
String referencedTable,
String[] primaryKey, boolean referencesPrimaryKey
) {
String cols = StringHelper.join(", ", foreignKey);
return new StringBuffer(30)
//.append(" add index ")
//.append(constraintName)
//.append(" (")
//.append(cols)
//.append("), add constraint ")
.append(" add constraint ")
.append(constraintName)
.append(" foreign key (")
.append(cols)
.append(") references ")
.append(referencedTable)
.append(" (")
.append( StringHelper.join(", ", primaryKey) )
.append(')')
.toString();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 9 months