-->
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.  [ 4 posts ] 
Author Message
 Post subject: NullPointerException setting associations???
PostPosted: Mon Nov 17, 2003 4:18 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
I'm getting a NullPointerException when I try the following query:

select tso from com.gm.netprofiler.server.hibernate.TblTileSetOwner as tso where tso.id like '%xyz%'"


I've enabled debug for hibernate and the output when the problem occurs is as follows:

2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.loader.Loader] total objects hydrated: 70
2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.impl.SessionImpl] resolving associations for [com.gm.netprofiler.server.hibernate.TblTileSetOwner#STF00]
2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.transaction.JTATransaction] rollback
2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.impl.SessionImpl] transaction completion
2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.impl.SessionImpl] closing session
2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.impl.SessionImpl] disconnecting session
2003-11-17 15:10:51,331 DEBUG [net.sf.hibernate.impl.SessionImpl] transaction completion
2003-11-17 15:10:51,331 ERROR [com.gm.netprofiler.server.admin] Exception getting tilesets:
net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.gm.netprofiler.server.hibernate.TblTileSetOwner.?
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:202)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2213)
at net.sf.hibernate.loader.Loader.doResultSet(Loader.java:216)
at net.sf.hibernate.loader.Loader.doFind(Loader.java:111)
at net.sf.hibernate.loader.Loader.find(Loader.java:731)
at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:972)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1462)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1454)
at com.gm.netprofiler.server.admin.model.TilesetManager.getTilesetsLike(TilesetManager.java:77)
at com.gm.netprofiler.server.admin.controller.GetTilesetsAction.execute(GetTilesetsAction.java:75)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NullPointerException
at com.gm.netprofiler.server.hibernate.TblTileSetOwnerMetaClass1.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:197)
... 55 more


It appears to be resolving associations for my class when the error occurs. The only problem is that I don't have any associations defined for this class. It's a very simple one class/one table mapping.

I'm using 2.0.3B6 version of hibernate and sqlserver.

Anyone know why this is happening?

Thanks,
Rich


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2003 4:22 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Did you follow the suggestion in the exception?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2003 4:35 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
Yes - It appears that I have null values in a database field that is mapped as a primitive type. I vaguely remember reading that you should use the object version for primitive types if they can contain null values.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2003 4:57 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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