Ticket #451 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Error creating minimal study

Reported by: s.h.sikkema@… Owned by: s.h.sikkema@…
Priority: major Milestone: 0.8.2
Component: Unknown Version: 0.8.1
Keywords: Cc:
Product: Operating system:
URL: Hardware:

Description

Create -> Create a new Study

Template: Academic study
Title: aaa
Description: asd
Start Date: 04/05/2011
Contacts: Scientist, John : Principal Investigator, add

quick save

Error: exception → org.springframework.dao.InvalidDataAccessApiUsageException?: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study; nested exception is org.hibernate.TransientObjectException?: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study, see log for stacktrace

Maybe the contact needs to be saved explicitly?

Change History

Changed 3 years ago by s.h.sikkema@…

I am able to save the study after the message:

We encountered some problems storing the study you just created. This may just be a mere glitch, click 'next' to try to save the study again, or click 'prev' to change your study.

appears

Changed 3 years ago by janneke@…

Same errors for me, thought I can also save the study after this message
(encountered this last few days I think)

Changed 3 years ago by work@…

cannot reproduce on development / hsqldb

Changed 3 years ago by s.h.sikkema@…

Here's a stacktrace. It seems the problem occurs when you're trying to set the study owner. The authenticationService.getLoggedInUser() does a findByUserName and a save action somehow follows ...

2011-05-23 11:37:56,432 [http-8080-1] ERROR builder.ClosureInvokingAction? - Exception occured invoking flow action: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study; nested exception is org.hibernate.TransientObjectException?: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study
org.springframework.dao.InvalidDataAccessApiUsageException?: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study; nested exception is org.hibernate.TransientObjectException?: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study

at org.springframework.orm.hibernate3.SessionFactoryUtils?.convertHibernateAccessException(SessionFactoryUtils?.java:654)
at org.springframework.orm.hibernate3.HibernateAccessor?.convertHibernateAccessException(HibernateAccessor?.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate?.doExecute(HibernateTemplate?.java:411)
at org.springframework.orm.hibernate3.HibernateTemplate?.execute(HibernateTemplate?.java:339)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByPersistentMethod?.doInvokeInternalWithExpressions(FindByPersistentMethod?.java:67)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod?.doInvokeInternal(AbstractClausedStaticPersistentMethod?.java:562)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod?.invoke(AbstractStaticPersistentMethod?.java:64)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod?.invoke(AbstractStaticPersistentMethod?.java:57)
at org.codehaus.groovy.grails.commons.metaclass.StaticMethodInvocation?$invoke.call(Unknown Source)
at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport?$_addDynamicFinderSupport_closure17.doCall(HibernatePluginSupport?.groovy:466)
at sun.reflect.GeneratedMethodAccessor?390.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl?.invoke(DelegatingMethodAccessorImpl?.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod?.invoke(CachedMethod?.java:90)
at groovy.lang.MetaMethod?.doMethodInvoke(MetaMethod?.java:233)
at groovy.lang.MetaClassImpl?.invokeMethod(MetaClassImpl?.java:1058)
at groovy.lang.ExpandoMetaClass?.invokeMethod(ExpandoMetaClass?.java:1070)
at groovy.lang.MetaClassImpl?.invokeMethod(MetaClassImpl?.java:886)
at groovy.lang.Closure.call(Closure.java:282)
at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod?.invoke(ClosureStaticMetaMethod?.java:59)
at groovy.lang.MetaClassImpl?.invokeStaticMissingMethod(MetaClassImpl?.java:1355)
at groovy.lang.MetaClassImpl?.invokeStaticMethod(MetaClassImpl?.java:1343)
at groovy.lang.ExpandoMetaClass?.invokeStaticMethod(ExpandoMetaClass?.java:1082)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite?.call(StaticMetaClassSite?.java:50)
at org.codehaus.groovy.runtime.callsite.CallSiteArray?.defaultCall(CallSiteArray?.java:40)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite?.call(StaticMetaClassSite?.java:55)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite?.call(AbstractCallSite?.java:124)
at dbnp.authentication.AuthenticationService?.getLoggedInUser(AuthenticationService?.groovy:36)
at dbnp.authentication.AuthenticationService?$$FastClassByCGLIB$$9fb81c75.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy?.invoke(MethodProxy?.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation?.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation?.proceed(ReflectiveMethodInvocation?.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor?.invoke(TransactionInterceptor?.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation?.proceed(ReflectiveMethodInvocation?.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor?.intercept(Cglib2AopProxy.java:621)
at dbnp.authentication.AuthenticationService?$$EnhancerByCGLIB$$3f24000a.getLoggedInUser(<generated>)
at dbnp.authentication.AuthenticationService?$getLoggedInUser.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray?.defaultCall(CallSiteArray?.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite?.call(AbstractCallSite?.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite?.call(AbstractCallSite?.java:120)
at dbnp.studycapturing.StudyWizardController?$_closure2_closure58_closure190.doCall(StudyWizardController?.groovy:1084)
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:597)
at org.codehaus.groovy.reflection.CachedMethod?.invoke(CachedMethod?.java:90)
at groovy.lang.MetaMethod?.doMethodInvoke(MetaMethod?.java:233)
at groovy.lang.MetaClassImpl?.invokeMethod(MetaClassImpl?.java:1058)
at groovy.lang.ExpandoMetaClass?.invokeMethod(ExpandoMetaClass?.java:1070)
at groovy.lang.MetaClassImpl?.invokeMethod(MetaClassImpl?.java:886)
at groovy.lang.Closure.call(Closure.java:282)
at groovy.lang.Closure.call(Closure.java:295)
at groovy.lang.Closure$call$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray?.defaultCall(CallSiteArray?.java:40)
at groovy.lang.Closure$call$0.call(Unknown Source)
at org.codehaus.groovy.grails.webflow.engine.builder.ClosureInvokingAction?.doExecute(ClosureInvokingAction?.groovy:120)
at org.springframework.webflow.action.AbstractAction?.execute(AbstractAction?.java:188)
at org.springframework.webflow.execution.ActionExecutor?.execute(ActionExecutor?.java:51)
at org.springframework.webflow.engine.ActionState?.doEnter(ActionState?.java:101)
at org.springframework.webflow.engine.State.enter(State.java:194)
at org.springframework.webflow.engine.Transition.execute(Transition.java:227)
at org.springframework.webflow.engine.impl.FlowExecutionImpl?.execute(FlowExecutionImpl?.java:391)
at org.springframework.webflow.engine.impl.RequestControlContextImpl?.execute(RequestControlContextImpl?.java:214)
at org.springframework.webflow.engine.TransitionableState?.handleEvent(TransitionableState?.java:119)
at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
at org.springframework.webflow.engine.impl.FlowExecutionImpl?.handleEvent(FlowExecutionImpl?.java:386)
at org.springframework.webflow.engine.impl.RequestControlContextImpl?.handleEvent(RequestControlContextImpl?.java:210)
at org.springframework.webflow.engine.ViewState?.handleEvent(ViewState?.java:230)
at org.springframework.webflow.engine.ViewState?.resume(ViewState?.java:196)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
at org.springframework.webflow.engine.impl.FlowExecutionImpl?.resume(FlowExecutionImpl?.java:259)
at org.springframework.webflow.executor.FlowExecutorImpl?.resumeExecution(FlowExecutorImpl?.java:163)
at org.codehaus.groovy.grails.webflow.execution.GrailsFlowExecutorImpl?.resumeExecution(GrailsFlowExecutorImpl?.java:80)
at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter?.handle(FlowHandlerAdapter?.java:183)
at org.codehaus.groovy.grails.webflow.mvc.servlet.GrailsFlowHandlerAdapter?.handle(GrailsFlowHandlerAdapter?.java:54)
at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet?.doDispatch(GrailsDispatcherServlet?.java:292)
at org.springframework.web.servlet.DispatcherServlet?.doService(DispatcherServlet?.java:719)
at org.springframework.web.servlet.FrameworkServlet?.processRequest(FrameworkServlet?.java:644)
at org.springframework.web.servlet.FrameworkServlet?.doPost(FrameworkServlet?.java:560)
at javax.servlet.http.HttpServlet?.service(HttpServlet?.java:727)
at javax.servlet.http.HttpServlet?.service(HttpServlet?.java:820)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:290)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:70)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:70)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:70)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:70)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.apache.catalina.core.ApplicationDispatcher?.invoke(ApplicationDispatcher?.java:646)
at org.apache.catalina.core.ApplicationDispatcher?.processRequest(ApplicationDispatcher?.java:436)
at org.apache.catalina.core.ApplicationDispatcher?.doForward(ApplicationDispatcher?.java:374)
at org.apache.catalina.core.ApplicationDispatcher?.forward(ApplicationDispatcher?.java:302)
at org.codehaus.groovy.grails.web.util.WebUtils?.forwardRequestForUrlMappingInfo(WebUtils?.java:298)
at org.codehaus.groovy.grails.web.util.WebUtils?.forwardRequestForUrlMappingInfo(WebUtils?.java:264)
at org.codehaus.groovy.grails.web.util.WebUtils?.forwardRequestForUrlMappingInfo(WebUtils?.java:255)
at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter?.doFilterInternal(UrlMappingsFilter?.java:183)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:76)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter?.obtainContent(GrailsPageFilter?.java:245)
at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter?.doFilter(GrailsPageFilter?.java:134)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:366)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor?.invoke(FilterSecurityInterceptor?.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor?.doFilter(FilterSecurityInterceptor?.java:83)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.access.ExceptionTranslationFilter?.doFilter(ExceptionTranslationFilter?.java:97)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter?.doFilter(AnonymousAuthenticationFilter?.java:78)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter?.doFilter(RememberMeAuthenticationFilter?.java:119)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter?.doFilter(SecurityContextHolderAwareRequestFilter?.java:54)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter?.doFilter(AbstractAuthenticationProcessingFilter?.java:187)
at org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter?.doFilter(RequestHolderAuthenticationFilter?.java:40)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter?.doFilter(MutableLogoutFilter?.java:79)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.context.SecurityContextPersistenceFilter?.doFilter(SecurityContextPersistenceFilter?.java:79)
at org.springframework.security.web.FilterChainProxy?$VirtualFilterChain?.doFilter(FilterChainProxy?.java:378)
at org.springframework.security.web.FilterChainProxy?.doFilter(FilterChainProxy?.java:167)
at org.springframework.web.filter.DelegatingFilterProxy?.invokeDelegate(DelegatingFilterProxy?.java:237)
at org.springframework.web.filter.DelegatingFilterProxy?.doFilter(DelegatingFilterProxy?.java:167)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter?.doFilterInternal(GrailsReloadServletFilter?.java:104)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:76)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter?.doFilterInternal(GrailsWebRequestFilter?.java:69)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:76)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter?.doFilterInternal(HiddenHttpMethodFilter?.java:65)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:76)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.springframework.web.filter.CharacterEncodingFilter?.doFilterInternal(CharacterEncodingFilter?.java:88)
at org.springframework.web.filter.OncePerRequestFilter?.doFilter(OncePerRequestFilter?.java:76)
at org.springframework.web.filter.DelegatingFilterProxy?.invokeDelegate(DelegatingFilterProxy?.java:237)
at org.springframework.web.filter.DelegatingFilterProxy?.doFilter(DelegatingFilterProxy?.java:167)
at org.apache.catalina.core.ApplicationFilterChain?.internalDoFilter(ApplicationFilterChain?.java:235)
at org.apache.catalina.core.ApplicationFilterChain?.doFilter(ApplicationFilterChain?.java:206)
at org.apache.catalina.core.StandardWrapperValve?.invoke(StandardWrapperValve?.java:233)
at org.apache.catalina.core.StandardContextValve?.invoke(StandardContextValve?.java:191)
at org.apache.catalina.core.StandardHostValve?.invoke(StandardHostValve?.java:128)
at org.apache.catalina.valves.ErrorReportValve?.invoke(ErrorReportValve?.java:102)
at org.apache.catalina.core.StandardEngineValve?.invoke(StandardEngineValve?.java:109)
at org.apache.catalina.connector.CoyoteAdapter?.service(CoyoteAdapter?.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:680)

Caused by: org.hibernate.TransientObjectException?: object references an unsaved transient instance - save the transient instance before flushing: dbnp.studycapturing.Study

at org.hibernate.engine.ForeignKeys?.getEntityIdentifierIfNotUnsaved(ForeignKeys?.java:242)
at org.hibernate.type.EntityType?.getIdentifier(EntityType?.java:430)
at org.hibernate.type.ManyToOneType?.isDirty(ManyToOneType?.java:265)
at org.hibernate.type.TypeFactory?.findDirty(TypeFactory?.java:619)
at org.hibernate.persister.entity.AbstractEntityPersister?.findDirty(AbstractEntityPersister?.java:3151)
at org.hibernate.event.def.DefaultFlushEntityEventListener?.dirtyCheck(DefaultFlushEntityEventListener?.java:501)
at org.hibernate.event.def.DefaultFlushEntityEventListener?.isUpdateNecessary(DefaultFlushEntityEventListener?.java:227)
at org.hibernate.event.def.DefaultFlushEntityEventListener?.onFlushEntity(DefaultFlushEntityEventListener?.java:150)
at org.hibernate.event.def.AbstractFlushingEventListener?.flushEntities(AbstractFlushingEventListener?.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener?.flushEverythingToExecutions(AbstractFlushingEventListener?.java:99)
at org.hibernate.event.def.DefaultAutoFlushEventListener?.onAutoFlush(DefaultAutoFlushEventListener?.java:58)
at org.hibernate.impl.SessionImpl?.autoFlushIfRequired(SessionImpl?.java:996)
at org.hibernate.impl.SessionImpl?.list(SessionImpl?.java:1589)
at org.hibernate.impl.CriteriaImpl?.list(CriteriaImpl?.java:306)
at org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByPersistentMethod?$1.doInHibernate(FindByPersistentMethod?.java:100)
at org.springframework.orm.hibernate3.HibernateTemplate?.doExecute(HibernateTemplate?.java:406)
... 159 more

Changed 3 years ago by work@…

  • owner changed from work@… to s.h.sikkema@…
  • status changed from new to assigned

- resolved in r1863, please retest

Changed 3 years ago by s.h.sikkema@…

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.