-->
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.  [ 5 posts ] 
Author Message
 Post subject: java.lang.NullPointerException one-to-many exception pls hel
PostPosted: Tue Nov 08, 2005 3:29 am 
Beginner
Beginner

Joined: Sun Oct 16, 2005 12:37 pm
Posts: 47
Location: Romania, Galati
I have the following exception when I try to get a Set from one-to-many relation. I have other collection that works well but this set throws this kind of exception when I try to retrieve.


Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249)
at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2813)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:260)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:205)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:602)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:255)
at org.hibernate.type.EntityType.resolve(EntityType.java:280)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:506)
at org.hibernate.loader.Loader.doQuery(Loader.java:415)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1396)
at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:107)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:483)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1354)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:171)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:48)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:134)
at clinica.gestiune.FisaInvEpidRapFrm.before(FisaInvEpidRapFrm.java:445)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 7:10 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Catch the cause of this exception, since this too litle info.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 7:15 am 
Beginner
Beginner

Joined: Sun Oct 16, 2005 12:37 pm
Posts: 47
Location: Romania, Galati
This is whole stacktrace.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249)
at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2813)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:260)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:205)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:602)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:255)
at org.hibernate.type.EntityType.resolve(EntityType.java:280)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:506)
at org.hibernate.loader.Loader.doQuery(Loader.java:415)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1396)
at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:107)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:483)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1354)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:171)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:48)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:134)
at clinica.gestiune.FisaInvEpidRapFrm.before(FisaInvEpidRapFrm.java:762)
at clinica.gestiune.FisaInvEpidRapFrm.<init>(FisaInvEpidRapFrm.java:102)
at clinica.MainFrame.actionPerformed(MainFrame.java:1137)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 7:19 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Did you try updating H3 to 3.1?

Code:
   public Object createProxy(Serializable id, SessionImplementor session)
   throws HibernateException {
      return getProxyFactory().getProxy( id, session );
   }


This is the code snippet that throws the NPE. But I seriously doubt that there is no proxyFactory.

Try debuging.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 8:38 am 
Beginner
Beginner

Joined: Sun Oct 16, 2005 12:37 pm
Posts: 47
Location: Romania, Galati
I use hibernate 3.0.2.
I had a legancy db schema and I used hibernate tool to create configuration file, mapping files and beans. In my schema n-n relation are materialized with tables that has not primary keys composed by the 2 foreign keys. Hibernate tools didn't generate many-to-many relationships... I suppose that this is the source for exception.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.