It breaks in the walk though the images collection
Code:
public Event setupReferenceData(RequestContext context) throws Exception
{
AcctItemForm form = (AcctItemForm) getFormObject(context);
HttpServletRequest request = ((ServletExternalContext) context
.getExternalContext()).getRequest();
this.setAcctItem(new AcctItemForm());
Long id = ServletRequestUtils.getLongParameter(request, "acctItemId",
new Long(0));
log.debug("id :" + id);
if (id.intValue() > 0)
{
try
{
form.setAcctItem(acctItemService.load(id));
log.debug("gets in here");
}
catch (Exception e)
{
// bad id
}
}
else
{
log.debug("new Item gets in here");
this.setNewItem(true);
}
String acctType = ServletRequestUtils.getStringParameter(request,
"acctType", "");
if (this.isNewItem())
{
String message = "";
if (acctType.length() < 1)
message = "No Account Type specified";
try
{
log.debug("gets in here new item reference");
AccountItemType acctItemType = acctItemTypeService
.get(acctType);
form.getAcctItem().setAcctItemType(acctItemType);
form.getAcctItem().setPkgType(AccountItemPkgType.NONE);
log.debug("new type gets in here");
}
catch (Exception e)
{
message = "Invalid Account Type";
}
context.getFlowScope().put("message", message);
}
log.debug("validator" + this.getValidator());
// avoiding lazy loading in files
Hibernate.initialize(form.getAcctItem().getImages());
if(form.getAcctItem().getImages() != null)
{
log.debug("gets in images setuphere");
log.debug(form.getAcctItem().getName());
for (AccountItemAttachement f : form.getAcctItem().getImages())
{
f.getId();
f.getFile();
f.getFile().getId();
f.getFile().getName();
f.getFile().getNormalUri();
}
}
else
{
form.getAcctItem().setImages(new TreeSet<AccountItemAttachement>());
}
//other collection walk-throughs
context.getFlowScope().put("acctItem", form);
return success();
}
Stack Trace
Code:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@106fc22 targetAction = com.netmemex.netmx.web.AcctItemFormAction@18bd6f9, attributes = map['method' -> 'setupReferenceData']] in state 'null' of flow 'accountItem-flow' -- action execution attributes were 'map['method' -> 'setupReferenceData']'; nested exception is org.hibernate.HibernateException: collection is not associated with any session
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:487)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:430)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
.....
root cause
org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@106fc22 targetAction = com.netmemex.netmx.web.AcctItemFormAction@18bd6f9, attributes = map['method' -> 'setupReferenceData']] in state 'null' of flow 'accountItem-flow' -- action execution attributes were 'map['method' -> 'setupReferenceData']'; nested exception is org.hibernate.HibernateException: collection is not associated with any session
org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:68)
org.springframework.webflow.engine.ActionList.execute(ActionList.java:160)
org.springframework.webflow.engine.Flow.start(Flow.java:556)
org.springframework.webflow.engine.impl.RequestControlContextImpl.start(RequestControlContextImpl.java:196)
org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:189)
org.springframework.webflow.executor.FlowExecutorImpl.launch(FlowExecutorImpl.java:206)
org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:131)
org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:172)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:430)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
........
root cause
org.hibernate.HibernateException: collection is not associated with any session
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:449)
org.hibernate.Hibernate.initialize(Hibernate.java:309)
com.netmemex.netmx.web.AcctItemFormAction.setupReferenceData(AcctItemFormAction.java:1380)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.webflow.util.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:103)
org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:136)
org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:203)
org.springframework.webflow.engine.AnnotatedAction.execute(AnnotatedAction.java:154)
org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:61)
org.springframework.webflow.engine.ActionList.execute(ActionList.java:160)
org.springframework.webflow.engine.Flow.start(Flow.java:556)
org.springframework.webflow.engine.impl.RequestControlContextImpl.start(RequestControlContextImpl.java:196)
org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:189)
org.springframework.webflow.executor.FlowExecutorImpl.launch(FlowExecutorImpl.java:206)
org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:131)
org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:172)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:430)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
.....