Opened 14 years ago

Closed 14 years ago

#947 closed defect (fixed)

"not-null property references a null or transient value" error on logout

Reported by: base Owned by: Nicklas Nordborg
Priority: trivial Milestone: BASE 2.6.1
Component: web Version:
Keywords: Cc:

Description

I'm not sure how to replicate this but thought I'd post the stack trace anyway.

First I was logged in as an administrator, then I impersonated a user (which has login disabled), then I annotated some samples with the annotation importer (because this does not work as administrator), then I can't logout. I have done other things in between (like refresh permissions, leave an active project).

Version  	BASE 2.6.1pre (build #4167; schema #52)
Web server 	Apache Tomcat/5.5.26
Database Server 	MySQL 5.0.51a
Database Dialect 	org.hibernate.dialect.MySQLInnoDBDialect
JDBC Driver 	com.mysql.jdbc.Driver (version 5.0)
Java runtime 	Java(TM) SE Runtime Environment (1.6.0_04-b12), Sun Microsystems Inc.
Operating system 	Linux amd64 2.6.18-53.1.4.el5
Memory 	Total: 829.2 MB
Free: 64.10 MB
Max: 910.3 MB
Browser 	Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Error message 	not-null property references a null or transient value: net.sf.basedb.core.data.UserClientSettingData.value
Stack trace 	

BaseException
...at HibernateUtil.saveData(HibernateUtil.java:1039)
...at SessionControl.saveSettings(SessionControl.java:1808)
...at SessionControl.logout(SessionControl.java:694)
...at org.apache.jsp.logout_jsp._jspService(logout_jsp.java:97)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)

...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:72)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
...at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
...at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
...at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
...at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
...at java.lang.Thread.run(Thread.java:619)

Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: net.sf.basedb.core.data.UserClientSettingData.value
...at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
...at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
...at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
...at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
...at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
...at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
...at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
...at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
...at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
...at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
...at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
...at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
...at HibernateUtil.saveData(HibernateUtil.java:1030)
...at SessionControl.saveSettings(SessionControl.java:1808)
...at SessionControl.logout(SessionControl.java:694)
...at org.apache.jsp.logout_jsp._jspService(logout_jsp.java:97)
...at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
...at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
...at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
...at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
...at net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:72)
...at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
...at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
...at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
...at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
...at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
...at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
...at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
...at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
...at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
...at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
...at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
...at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
...at java.lang.Thread.run(Thread.java:619)

Change History (3)

comment:1 in reply to:  description Changed 14 years ago by base

Update...

Impersonating a user (who has login disabled) and then logging out works fine. I just tested it a few times. The problem above must have been caused by something else.

comment:2 Changed 14 years ago by Nicklas Nordborg

Milestone: BASE 2.6.1
Owner: changed from everyone to Nicklas Nordborg
Priority: majortrivial
Status: newassigned
Summary: Unexpected error on logout"not-null property references a null or transient value" error on logout

The exception happens when saving user settings to the database. It seems like the error can happen if the following conditions are true:

  • before logging in the setting didn't exist
  • some actions caused a new setting to be created
  • some other action caused the same setting to be deleted

After searching the code I found at least one place were this can happen. Activating a project stores the project ID in a setting and deactivating all projects set the value to null. This can happen to anyone and has nothing to do with impersonating another user. There may be other actions that cause the same problem, but the problem is with the code that is saving the settings, so I will not look for other actions.

comment:3 Changed 14 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

(In [4174]) Fixes #947: "not-null property references a null or transient value" error on logout

Note: See TracTickets for help on using tickets.