hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject Re: Acquiring session not in a tapestry page error
Date Mon, 18 Jun 2007 17:31:22 GMT
You're trying to do something outside the scope of a web request or Tapestry
would be setting that up for you.

On 6/18/07, ovidiu@artsoft-consult.ro <ovidiu@artsoft-consult.ro> wrote:
>
> Hi!
> I have a similar problem and I can't find the answer to my problem for
> now. I want to update an existing Tapestry/Hivemind/Hibernate application
> to use Honeycomb.
> In my case the problem appear when I need to access the database service
> inside a javax.servlet.Filter.
>
> I get the same error message:
>
> java.lang.NullPointerException: Property 'webRequest' of <OuterProxy for
> tapestry.globals.RequestGlobals(
> org.apache.tapestry.services.RequestGlobals)>
> is null.
>
>         $WebRequest_1133f89bdc4._targetServiceProperty($WebRequest_1133f89bdc4.java)
>         $WebRequest_1133f89bdc4.getSession($WebRequest_1133f89bdc4.java)
>         $WebRequest_1133f89bd5a.getSession($WebRequest_1133f89bd5a.java)
>         org.apache.tapestry.engine.state.SessionScopeManager.getSession(
> SessionScopeManager.java:48)
>         org.apache.tapestry.engine.state.SessionScopeManager.get(
> SessionScopeManager.java:64)
>
>         $StateObjectPersistenceManager_1133f89be90.get($StateObjectPersistenceManager_1133f89be90.java)
>         org.apache.tapestry.engine.state.StateObjectManagerImpl.get(
> StateObjectManagerImpl.java:50)
>         org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(
> ApplicationStateManagerImpl.java:60)
>
>         $ApplicationStateManager_1133f89bd76.get($ApplicationStateManager_1133f89bd76.java)
>
>         $ApplicationStateManager_1133f89bd77.get($ApplicationStateManager_1133f89bd77.java)
>
> com.javaforge.honeycomb.tapestry.ConversationManagerImpl.getCurrentConversation
> (ConversationManagerImpl.java:59)
>
>         $ConversationManager_1133f89be87.getCurrentConversation($ConversationManager_1133f89be87.java)
>
>         $ConversationManager_1133f89be32.getCurrentConversation($ConversationManager_1133f89be32.java)
>
> com.javaforge.honeycomb.tapestry.ConversationalClientStateStorage.retrieve
> (ConversationalClientStateStorage.java:26)
>
>         $ClientStateStorage_1133f89be82.retrieve($ClientStateStorage_1133f89be82.java)
>
> com.javaforge.honeycomb.hivemind.statefulservice.StatefulServiceModel.getServiceFromClientStateStorage
> (StatefulServiceModel.java:240)
>
> com.javaforge.honeycomb.hivemind.statefulservice.StatefulServiceModel.obtainPooledService
> (StatefulServiceModel.java:229)
>
> com.javaforge.honeycomb.hivemind.statefulservice.StatefulServiceModel.getServiceImplementationForCurrentThread
> (StatefulServiceModel.java:211)
>         $Session_1133f89be84._service($Session_1133f89be84.java)
>         $Session_1133f89be84.get($Session_1133f89be84.java)
>         $Session_1133f89be85.get($Session_1133f89be85.java)
>         $Session_1133f89be86.get($Session_1133f89be86.java)
>         com.imagenode.bl.dao.FileDao.getDownload(FileDao.java:23)
>         $IFileDao_1133f89bea6.getDownload($IFileDao_1133f89bea6.java)
>         $IFileDao_1133f89bea4.getDownload($IFileDao_1133f89bea4.java)
>         com.imagenode.bl.service.DownloadsService.loadDownload(
> DownloadsService.java:37)
>
>         $IDownloadsService_1133f89be30.loadDownload($IDownloadsService_1133f89be30.java)
>         com.imagenode.web.servlets.FileDownloadFilter.serveFileDownload(
> FileDownloadFilter.java:237)
>         com.imagenode.web.servlets.FileDownloadFilter.doFilter(
> FileDownloadFilter.java:87)
>
>
> The configuration file is looking like this:
>
>         <service-point id="FileDao" interface="IFileDao">
>                 <invoke-factory>
>                         <construct class="FileDao" />
>                 </invoke-factory>
>
>                 <interceptor service-id="hivemind.LoggingInterceptor" />
>         </service-point>
>
>         <contribution           configuration-id="
> honeycomb.hibernate.HibernateSessionFactory">
>                 <entity clazz="
> com.javaforge.honeycomb.hibernate.audit.AuditEvent" />
>                 <entity clazz="com.imagenode.bl.entity.Download" />
>
>                 <property name="dialect"
>                         value="org.hibernate.dialect.MySQLDialect" />
>                 <property name="connection.datasource"
>                         value="java:comp/env/jdbc/imagenode" />
>                 <property name="show_sql" value="true" />
>         </contribution>
>
>
> Any suggestions about this?
>
> Thanks so much!
>
> -- Ovidiu
>
>
>
> > Oh, sorry,
> > I think the Audit-Interceptor must be the culprit. I had the same
> > problem when adding a Message-Driven thingy into one of my projects.
> > You'll need to define a second instance of the SessionFactory, contrary
> > to what I told before, like this:
> >
> > <service-point id="HibernateSessionFactory" parameters-occurs="none"
> >
> > interface="org.apache.hivemind.ServiceImplementationFactory">
> >                 <invoke-factory model="singleton">
> >                         <construct autowire-services="false"
> >
> > class="com.javaforge.honeycomb.hivemind.hibernate.HibernateSessionFactor
> > y"
> >                                 initialize-method="init">
> >                                 <configuration>
> >                          honeycomb.hibernate.HibernateSessionFactory
> >                         </configuration>
> >
> > <service>hivemind.ShutdownCoordinator</service>
> >                                 <service-id/>
> >                                 <set property="updateSchema"
> > value="false"/>
> >                                 <set property="transactionManager"
> > value="false"/>
> >                         </construct>
> >                 </invoke-factory>
> >                 <interceptor service-id="hivemind.LoggingInterceptor"/>
> >         </service-point>
>
> > It's important to turn off autowiring otherwise HiveMind will
> > auto-inject the wrong AuditInterceptor Service. Of course, if you need
> > auditing, you can also configure a second instance of the interceptor
> > and wire it up explicitly.
> >
> > hth, Marcus
> >
> > > -----Original Message-----
> > > From: Henry Tong [EMAIL PROTECTED]
> > > Sent: Wednesday, December 06, 2006 11:18 AM
> > > To: user@hivemind.apache.org
> > > Subject: RE: Acquiring session not in a tapestry page error
> > >
> > >
> > > Dear Marcus,
> > >
> > > Thank you for your prompt reply. I am using Tapestry 4.0.2
> > > and Honeycomb 0.3.3. For testing purpose, I have changed the
> > > configuration file as follows.
> > >
> > > 1. Create another Hibernate Eager Load Session
> > >     <service-point id='HibernateEagerLoadSession'
> > > interface='org.hibernate.Session'>
> > >         <invoke-factory
> > > service-id='honeycomb.hibernate.HibernateSessionFactory'
> > > model='threaded'/>
> > >     </service-point>
> > >
> > > 2. Create Dao Service (which extends
> > > AbstractPersistenceService) that use Hibernate EagerLoad Session
> > >      <service-point id="GenericDbDao" interface="GenericDbDao">
> > >               <invoke-factory>
> > >                       <construct class="impl.GenericDbDaoImpl">
> > >
> > > <service>HibernateEagerLoadSession</service>
> > >                       </construct>
> > >               </invoke-factory>
> > >      </service-point>
> > >
> > > 3. The web project use default honeycomb hibernate session
> > > and default honeycomb hibernate session factory.
> > >
> > > The same errors prompt. Any suggestions?
> > >
> > > ERROR! [Timer-0]
> > > org.hibernate.impl.SessionImpl.beforeTransactionCompletion(Ses
> > > sionImpl.java:399)
> > >15> exception in interceptor beforeTransactionCompletion()
> > > java.lang.NullPointerException: Property 'webRequest' of
> > > <OuterProxy for
> > > tapestry.globals.RequestGlobals(org.apache.tapestry.services.R
> > > equestGlobals)>
> > > is null.
> > >       at
> > > $WebRequest_10f574018b1._targetServiceProperty($WebRequest_10f
> > > 574018b1.java)
> > >       at
> > > $WebRequest_10f574018b1.getSession($WebRequest_10f574018b1.java)
> > >       at
> > > $WebRequest_10f57401872.getSession($WebRequest_10f57401872.java)
> > >       at
> > > org.apache.tapestry.engine.state.SessionScopeManager.getSessio
> > > n(SessionScopeManager.java:48)
> > >       at
> > > org.apache.tapestry.engine.state.SessionScopeManager.get(Sessi
> > > onScopeManager.java:64)
> > >       at
> > > $StateObjectPersistenceManager_10f574018a9.get($StateObjectPer
> > > sistenceManager_10f574018a9.java)
> > >       at
> > > org.apache.tapestry.engine.state.StateObjectManagerImpl.get(St
> > > ateObjectManagerImpl.java:50)
> > >       at
> > > org.apache.tapestry.engine.state.ApplicationStateManagerImpl.g
> > > et(ApplicationStateManagerImpl.java:60)
> > >       at
> > > $ApplicationStateManager_10f5740184a.get($ApplicationStateMana
> > > ger_10f5740184a.java)
> > >       at
> > > $ApplicationStateManager_10f5740184b.get($ApplicationStateMana
> > > ger_10f5740184b.java)
> > >       at
> > > com.javaforge.honeycomb.tapestry.ConversationManagerImpl.getCu
> > > rrentConversation(ConversationManagerImpl.java:59)
> > >       at
> > > $ConversationManager_10f574018a0.getCurrentConversation($Conve
> > > rsationManager_10f574018a0.java)
> > >       at
> > > $ConversationManager_10f5740189e.getCurrentConversation($Conve
> > > rsationManager_10f5740189e.java)
> > >       at
> > > com.javaforge.honeycomb.tapestry.ConversationalClientStateStor
> > > age.retrieve(ConversationalClientStateStorage.java:26)
> > >       at
> > > $ClientStateStorage_10f5740188f.retrieve($ClientStateStorage_1
> > > 0f5740188f.java)
> > >       at
> > > com.javaforge.honeycomb.hivemind.statefulservice.StatefulServi
> > > ceModel.getServiceFromClientStateStorage(StatefulServiceModel.
> > > java:241)
> > >       at
> > > com.javaforge.honeycomb.hivemind.statefulservice.StatefulServi
> > > ceModel.obtainPooledService(StatefulServiceModel.java:229)
> > >       at
> > > com.javaforge.honeycomb.hivemind.statefulservice.StatefulServi
> > > ceModel.getServiceImplementationForCurrentThread(StatefulServi
> > > ceModel.java:211)
> > >       at $Session_10f57401891._service($Session_10f57401891.java)
> > >       at $Session_10f57401891.getSession($Session_10f57401891.java)
> > >       at $Session_10f57401892.getSession($Session_10f57401892.java)
> > >       at $Session_10f57401893.getSession($Session_10f57401893.java)
> > >       at
> > > com.javaforge.honeycomb.hibernate.audit.AuditInterceptor.getAu
> > > ditSession(AuditInterceptor.java:138)
> > >       at
> > > com.javaforge.honeycomb.hibernate.audit.AuditInterceptor.befor
> > > eTransactionCompletion(AuditInterceptor.java:145)
> > >       at
> > > $Interceptor_10f5740188c.beforeTransactionCompletion($Intercep
> > > tor_10f5740188c.java)
> > >       at
> > > $Interceptor_10f5740188d.beforeTransactionCompletion($Intercep
> > > tor_10f5740188d.java)
> > >       at
> > > org.hibernate.impl.SessionImpl.beforeTransactionCompletion(Ses
> > > sionImpl.java:396)
> > >       at
> > > org.hibernate.jdbc.JDBCContext.beforeTransactionCompletion(JDB
> > > CContext.java:202)
> > >       at
> > > org.hibernate.transaction.JDBCTransaction.commit(JDBCTransacti
> > > on.java:111)
> > >       at
> > > com.javaforge.honeycomb.service.AbstractPersistenceService.com
> > > mit(AbstractPersistenceService.java:61)
> > >       at $GenericDao_10f5740189c.commit($GenericDao_10f5740189c.java)
> > >       at
> > > pihk.pacconmini.server.service.jpop.impl.RecordUploadImpl.save
> > > OrUpdateRecord(RecordUploadImpl.java:78)
> > >       at
> > > pihk.pacconmini.server.service.jpop.impl.RecordUploadImpl.uplo
> > > ad(RecordUploadImpl.java:45)
> > >       at
> > > $RecordUpload_10f57401896.upload($RecordUpload_10f57401896.java)
> > >       at
> > > pihk.pacconmini.server.service.jpop.impl.DataUploadImpl.startT
> > > oRun(DataUploadImpl.java:132)
> > >       at
> > > pihk.pacconmini.server.service.jpop.impl.DataUploadImpl.run(Da
> > > taUploadImpl.java:73)
> > >       at $DataUpload_10f57401818.run($DataUpload_10f57401818.java)
> > >       at
> > > pihk.pacconmini.server.service.jpop.impl.DataReplicateImpl.pro
> > > cess(DataReplicateImpl.java:129)
> > >       at
> > > pihk.pacconmini.server.service.jpop.impl.DataReplicateImpl$1.r
> un(DataReplicateImpl.java:82)
> > >       at java.util.TimerThread.mainLoop(Unknown Source)
> > >       at java.util.TimerThread.run(Unknown Source)
> > >
> > > Henry
> > >
> > >
> > >
>

Mime
View raw message