Stacktrace (after pressing submit):
Code:
16:50:06,025 DEBUG DispatcherPortlet:614 - DispatcherPortlet with name 'projekte' received action request
16:50:06,027 DEBUG DispatcherPortlet:988 - Testing handler map [org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping@270d41e4] in DispatcherPortlet with name 'projekte'
16:50:06,028 DEBUG DefaultAnnotationHandlerMapping:74 - Key [view] -> handler [{action=save=com.company.myproject.controller.ProjekteController@2debafce, action=edit=com.company.myproject.controller.ProjekteController@2debafce, =com.company.myproject.controller.ProjekteController@2debafce, action=viewSimple=com.company.myproject.controller.ProjekteController@2debafce}]
16:50:06,028 DEBUG DispatcherPortlet:1029 - Testing handler adapter [org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter@4229708b]
16:50:06,029 DEBUG DispatcherPortlet:1029 - Testing handler adapter [org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter@2e9bd79c]
16:50:06,030 DEBUG HandlerMethodInvoker:327 - Invoking init-binder method: public void com.company.myproject.controller.ProjekteController.initBinder(org.springframework.web.bind.WebDataBinder)
16:50:06,031 DEBUG HandlerMethodInvoker:146 - Invoking model attribute method: public com.company.myproject.bo.ProjekteProxy com.company.myproject.controller.ProjekteController.populateModel(java.lang.Integer)
16:50:06,032 DEBUG HandlerMethodInvoker:327 - Invoking init-binder method: public void com.company.myproject.controller.ProjekteController.initBinder(org.springframework.web.bind.WebDataBinder)
16:50:06,042 DEBUG HandlerMethodInvoker:165 - Invoking request handler method: public void com.company.myproject.controller.ProjekteController.save(com.company.myproject.bo.ProjekteProxy,org.springframework.validation.BindingResult,org.springframework.ui.ModelMap,javax.portlet.ActionResponse,org.springframework.web.bind.support.SessionStatus)
16:50:06,043 INFO ProjekteController:202 - Saving instance
16:50:06,049 DEBUG ProjekteHome:98 - merging Projekte instance
16:50:06,050 DEBUG SessionFactoryUtils:316 - Opening Hibernate Session
16:50:06,051 DEBUG SessionFactoryUtils:789 - Closing Hibernate Session
16:50:06,059 ERROR ProjekteHome:108 - merge failed
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:622)
at com.company.myproject.dbo.ProjekteHome.merge(ProjekteHome.java:101)
at com.company.myproject.service.ProjekteServiceImpl.mergeProjekt(ProjekteServiceImpl.java:72)
at com.company.myproject.controller.ProjekteController.save(ProjekteController.java:240)
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.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:710)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:167)
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:349)
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:337)
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleAction(AnnotationMethodHandlerAdapter.java:277)
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:646)
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:519)
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:460)
at ....
at java.lang.Thread.run(Thread.java:619)
16:50:06,069 DEBUG DispatcherPortlet:562 - Successfully completed request
16:50:06,080 DEBUG DispatcherPortlet:694 - DispatcherPortlet with name 'projekte' received render request
16:50:06,081 DEBUG DispatcherPortlet:709 - Render phase found exception caught during action phase - rethrowing it
16:50:06,082 DEBUG SimpleMappingExceptionResolver:109 - Resolving exception from handler [null]: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
16:50:06,085 DEBUG SimpleMappingExceptionResolver:140 - Resolving to default view 'defError' for exception of type [org.hibernate.HibernateException]
16:50:06,086 DEBUG SimpleMappingExceptionResolver:225 - Exposing Exception as model attribute 'exception'
16:50:06,088 DEBUG DispatcherPortlet:1162 - HandlerExceptionResolver returned ModelAndView [ModelAndView: reference to view with name 'defError'; model is {exception=org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here}] for exception
16:50:06,089 WARN DispatcherPortlet:1164 - Handler execution resulted in exception - forwarding to resolved error view
org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:622)
at com.company.myproject.dbo.ProjekteHome.merge(ProjekteHome.java:101)
at com.company.myproject.service.ProjekteServiceImpl.mergeProjekt(ProjekteServiceImpl.java:72)
at com.company.myproject.controller.ProjekteController.save(ProjekteController.java:240)
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.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:710)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:167)
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:349)
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:337)
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleAction(AnnotationMethodHandlerAdapter.java:277)
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:646)
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:519)
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:460)
at ...
at java.lang.Thread.run(Thread.java:619)
16:50:06,092 DEBUG DefaultListableBeanFactory:1444 - Invoking afterPropertiesSet() on bean with name 'defError'
16:50:06,093 DEBUG DispatcherPortlet:1086 - Setting portlet response content type to view-determined type [text/html;charset=ISO-8859-1]
16:50:06,094 DEBUG JstlView:328 - Added model object 'exception' of type [org.hibernate.HibernateException] to request in view with name 'defError'
16:50:06,095 DEBUG JstlView:227 - Including resource [/WEB-INF/jsp/defError.jsp] in InternalResourceView 'defError'
16:50:06,226 DEBUG DispatcherPortlet:562 - Successfully completed request
Shortened DAO, fixed exceptions:
Code:
public class ProjekteHome
{
private static final Log log = LogFactory.getLog(ProjekteHome.class);
private SessionFactory sessionFactory = null;
public SessionFactory getSessionFactory()
{
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory)
{
this.sessionFactory = sessionFactory;
}
public void persist(Projekte transientInstance)
{
log.debug("persisting Projekte instance");
sessionFactory.getCurrentSession().persist(transientInstance);
log.debug("persist successful");
}
public void delete(Projekte persistentInstance)
{
log.debug("deleting Projekte instance");
sessionFactory.getCurrentSession().delete(persistentInstance);
log.debug("delete successful");
}
public Projekte merge(Projekte detachedInstance)
{
log.debug("merging Projekte instance");
Projekte result = (Projekte) sessionFactory.getCurrentSession().merge(
detachedInstance);
log.debug("merge successful");
return result;
}
public Projekte findById(java.lang.Integer id)
{
log.debug("getting Projekte instance with id: " + id);
Projekte instance = (Projekte) sessionFactory.getCurrentSession().get(
"com.credis.creplan.dbo.Projekte", id);
if (instance == null)
{
log.debug("get successful, no instance found");
}
else
{
log.debug("get successful, instance found");
}
return instance;
}
@SuppressWarnings("unchecked")
public List<Projekte> list()
{
log.debug("listing Projekte");
List results = sessionFactory.getCurrentSession().createCriteria(
"com.credis.creplan.dbo.Projekte").list();
log.debug("list successful, result size: " + results.size());
return results;
}
public Integer save(Projekte pProjekt)
{
Integer lRw;
log.debug("saving Projekte instance");
lRw = (Integer) sessionFactory.getCurrentSession().save(pProjekt);
log.debug("attach successful");
return lRw;
}
}