Closed
Description
Holger Stenzhorn opened SPR-11447 and commented
My web application uses a combination of Spring with Hibernate (currently at 4.2.8). In the application context, I define the following:
<context:load-time-weaver/>
<context:spring-configured/>
<context:annotation-config/>
<context:component-scan base-package="org.obtima"
scoped-proxy="targetClass"/>
<tx:annotation-driven mode="aspectj"/>
This is working as expected until Tomcat 7.0.50. But when I deploy on 8.0.3 the first attempt to access the database, i.e. when I am trying to login to the application, fails:
19-Feb-2014 16:27:24.083 SEVERE [http-nio-8084-exec-12] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [default] in context with path [/test] threw exception
org.hibernate.HibernateException: No Session found for current thread
at org.springframework.orm.hibernate4.SpringSessionContext.currentSession(SpringSessionContext.java:97)
at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:992)
After removing mode="aspectj"
from <tx:annotation-driven/>
the above mentioned login works and so the session was obviously found then (but code marked with @Transactional
fails now).
Affects: 3.2.8
Issue Links:
- Load Time Weaving not working after upgrading Tomcat from 7.0.50 to 7.0.52 [SPR-11446] #16072 Load Time Weaving not working after upgrading Tomcat from 7.0.50 to 7.0.52
- Use Tomcat 8's new instrumentable WebappClassLoader [SPR-10788] #15414 Use Tomcat 8's new instrumentable WebappClassLoader
2 votes, 2 watchers