-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Nullpointer exception when creating a sessionFactory in HQL
PostPosted: Thu Aug 04, 2005 1:06 pm 
Senior
Senior

Joined: Tue Jan 11, 2005 5:03 pm
Posts: 137
Location: Montreal, Quebec
Hi,

I am trying to initialise the Hibernate Configuration View in Eclipse 3.1 with the Hibernate Tools alpha4. I get a "Unhandled event loop exception" and a "CodeGenerationException" when trying to connect to the database (with the SessionFactory connection).

On 4 database tables (Pojo or node), it only show the first one without any parameters. It seems that there is a problem when creating the children of the node.

What could i do to start debugging the problem?

Thanks.


Code:
net.sf.cglib.core.CodeGenerationException: java.lang.NullPointerException-->null
   at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
   at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
   at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:564)
   at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:493)
   at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:220)
   at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:368)
   at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:299)
   at org.hibernate.console.node.NodeFactory.createIdentifierNode(NodeFactory.java:164)
   at org.hibernate.console.node.ClassNode.createChildren(ClassNode.java:61)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b.CGLIB$createChildren$0$1(<generated>)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b$$FastClassByCGLIB$$ee891afa.invoke(<generated>)
   at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
   at org.hibernate.console.node.NodeFactory$1.intercept(NodeFactory.java:47)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b.createChildren(<generated>)
   at org.hibernate.console.node.ClassNode.checkChildren(ClassNode.java:46)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b.CGLIB$checkChildren$0$2(<generated>)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b$$FastClassByCGLIB$$ee891afa.invoke(<generated>)
   at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
   at org.hibernate.console.node.NodeFactory$1.intercept(NodeFactory.java:47)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b.checkChildren(<generated>)
   at org.hibernate.console.node.BaseNode.isLeaf(BaseNode.java:71)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b.CGLIB$isLeaf$0$16(<generated>)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b$$FastClassByCGLIB$$ee891afa.invoke(<generated>)
   at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
   at org.hibernate.console.node.NodeFactory$1.intercept(NodeFactory.java:47)
   at org.hibernate.console.node.ClassNode$$EnhancerByCGLIB$$9b34d09b.isLeaf(<generated>)
   at org.hibernate.eclipse.console.views.TreeNodeContentProvider.hasChildren(TreeNodeContentProvider.java:34)
   at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:1369)
   at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:1831)
   at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:536)
   at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:514)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
   at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:494)
   at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(AbstractTreeViewer.java:948)
   at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(AbstractTreeViewer.java:959)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:851)
   at org.eclipse.swt.widgets.Tree.wmNotifyChild(Tree.java:3659)
   at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:3567)
   at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:1035)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3089)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:3513)
   at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
   at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1574)
   at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:219)
   at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Tree.java:2790)
   at org.eclipse.swt.widgets.Control.windowProc(Control.java:3071)
   at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:2366)
   at org.eclipse.swt.widgets.Display.windowProc(Display.java:3513)
   at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
   at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1650)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2552)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1601)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1565)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:315)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:230)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:371)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:160)
   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.core.launcher.Main.invokeFramework(Main.java:330)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:274)
   at org.eclipse.core.launcher.Main.run(Main.java:977)
   at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.NullPointerException
   at org.hibernate.console.node.NodeFactory.getMetaData(NodeFactory.java:129)
   at org.hibernate.console.node.IdentifierNode.<init>(IdentifierNode.java:24)
   at org.hibernate.console.node.IdentifierNode$$EnhancerByCGLIB$$aab279ba.<init>(<generated>)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Constructor.newInstance(Unknown Source)
   at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
   ... 70 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 1:17 pm 
Senior
Senior

Joined: Tue Jan 11, 2005 5:03 pm
Posts: 137
Location: Montreal, Quebec
Another problem I have is if I try to correct the problem mention above by putting a tag not-found="ignore" in the <many-to-one> tag, I get a org.xml.sax.SAXParseException: Attribute "not-found" is not declared for element "many-to-one" exception!


I am using Hibernate 3.0.5 with all required lib!

Code:
org.xml.sax.SAXParseException: Attribute "not-found" is not declared for element "many-to-one".
   at org.apache.crimson.parser.Parser2.error(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.content(Unknown Source)
   at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
   at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
   at org.apache.crimson.parser.Parser2.parse(Unknown Source)
   at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
   at org.dom4j.io.SAXReader.read(SAXReader.java:334)
   at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:393)
   at org.hibernate.cfg.Configuration.addResource(Configuration.java:444)
   at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1392)
   at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1364)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1346)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1313)
   at org.hibernate.cfg.Configuration.configure(Configuration.java:1275)
   at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:152)
   at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:129)
   at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:50)
   at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
   at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
   at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
   at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
   at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2921)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2554)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1601)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1565)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:315)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:230)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:371)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:160)
   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.core.launcher.Main.invokeFramework(Main.java:330)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:274)
   at org.eclipse.core.launcher.Main.run(Main.java:977)
   at org.eclipse.core.launcher.Main.main(Main.java:952)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 6:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
submit a runnable test case to jira on it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.