I've seen similar issues to mine, but they seem to have been caused by
configuration problems that I don't have -- not to say the issue is
ultimately mine, just different.

I have a wicket (1.4.6) application that is using google guice (2.0)
and warp-persist (1.0.1).  I'm using the Servlet filter and CRUD
functions properly throughout the application inside the scope of a
request, which is my specified using of work in my module.

                install(PersistenceService.usingHibernate()
                                .across(UnitOfWork.REQUEST)
                                .transactedWith(TransactionStrategy.LOCAL)
                                .buildModule());

My use case is that I'm trying to remove user owned pessimistic locks
from the database when sessions expire in a class that implements
HttpSessionBindingListener.

Roughly:

     public void valueUnbound(HttpSessionBindingEvent event)

          workManager.beginWork();
          deleteLocks(userID);
          workManager.endWork();


     @Transactional
     public void deleteLocks(String userID)

          dao.findByLockedBy(userID);  // dies here.
          .....


The Exception I'm getting is:

org.hibernate.SessionException: Session is closed!
        at
org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:
72)
        at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:
1342)
        at
com.wideplay.warp.hibernate.HibernateLocalTxnInterceptor.invoke(HibernateLocalTxnInterceptor.java:
51)
        at com.google.inject.InterceptorStackCallback
$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:64)
        at
com.google.inject.InterceptorStackCallback.intercept(InterceptorStackCallback.java:
44)
        at org.example.photo.data.dao.PhotoDataDAO$$EnhancerByGuice$
$56f5464c.findByLockedBy(<generated>)
        at
org.example.photo.common.security.PhotoSession.deleteLocks(PhotoSession.java:
116)
        at
org.example.photo.common.security.PhotoSession.valueUnbound(PhotoSession.java:
101)
        at
weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:
647)
        at
weblogic.servlet.internal.session.SessionData.removeAttribute(SessionData.java:
629)
        at
weblogic.servlet.internal.session.SessionData.remove(SessionData.java:
878)
        at
weblogic.servlet.internal.session.MemorySessionContext.invalidateSession(MemorySessionContext.java:
69)
        at weblogic.servlet.internal.session.SessionContext
$InvalidationAction.run(SessionContext.java:944)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:
321)
        at weblogic.security.service.SecurityManager.runAs(Unknown Source)
        at weblogic.servlet.internal.session.SessionContext
$SessionInvalidator.cleanupExpiredSessions(SessionContext.java:862)
        at weblogic.servlet.internal.session.SessionContext$SessionInvalidator
$1.run(SessionContext.java:794)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:
321)
        at weblogic.security.service.SecurityManager.runAs(Unknown Source)
        at weblogic.servlet.internal.session.SessionContext
$SessionInvalidator.timerExpired(SessionContext.java:788)
        at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
        at weblogic.work.SelfTuningWorkManagerImpl
$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

The session is injected into the DAO by Guice.  The DAO is injected
into my HttpSessionBindingListener implementor by Guice as well.

Any hints on what to try would be appreciated.





-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to