marc fleury wrote:
> 
> I don't think the context is supposed to be stored with the passivate... can
> someone double check that?

Just read the spec and the code, setSessionContext is called only once
(during the bean creation).  After that, there is no
"unsetSessionContext" as for entities, so the context must remain valid
across passivation/activation.  So we have to store it.

So I guess StatefulSessionContextImpl (and EJBContextImpl) have to be
real classes, unless anybody sees a way out...

Sebastien

> 
> (is it ok to keep that ref, afair I think it is reset, but I could be wrong)
> 
> But if it is ok then just rewire the ContextImpl outside the SessionContext,
> some work, not impossible
> 
> marc
> 
> if that is the case, what
> |-----Original Message-----
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of Sebastien Alborini
> |Sent: Wednesday, November 08, 2000 4:16 PM
> |To: jBoss Developer
> |Subject: Re: [jBoss-Dev] CVS update:
> |jboss/src/main/org/jboss/utilWorkerQueue.java
> |
> |
> |"Bordet, Simone" wrote:
> |>
> |> Hey Oleg,
> |>
> |> > BTW, I'm getting an Exception on shutdown in that place, but haven't
> |> > finished its investigation yet.
> |> > But maybe you or somebody else would understand what happens faster
> |> > than I, so please take a look:
> |> >
> |> > BEAN EXCEPTION:null
> |> > java.lang.IllegalAccessException
> |> >     at java.lang.reflect.Field.get(Native Method)
> |>
> |> Maybe I'll say something you already know, but this can happen if the
> |> constructor of the data member is not accessible (ie package private or
> |> protected or private). Is it your case ? Otherwise can you post
> |more details
> |> ?
> |
> |Hi,
> |
> |I get the same exception with the stateful bean in testbeans
> |(BMTStatefulBean).  The declared field is: private SessionContext
> |sessionContext;
> |
> |javax.ejb.SessionContext is an interface, the actual field is
> |org.jboss.ejb.StatefulSessionContext.StatefulSessionContextImpl, which
> |is an inner protected class, and apparently the constructor can't be
> |accessed from
> |org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager... (I tried
> |to switch to a public inner class, without any luck)
> |
> |Any ideas?
> |
> |Sebastien
> |
> |
> |[Container factory] BEAN EXCEPTION:null
> |[Container factory] java.lang.IllegalAccessException:
> |org/jboss/test/testbean/bean/StatefulSessionBean
> |[Container factory]     at java.lang.reflect.Field.get(Native Method)
> |[Container factory]     at
> |org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passiva
> |teSession(StatefulSessionFilePersistenceManager.java:269)
> |[Container factory]     at
> |org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(Statef
> |ulSessionInstanceCache.java:49)
> |[Container factory]     at
> |org.jboss.ejb.plugins.EnterpriseInstanceCache$1.execute(EnterpriseI
> |nstanceCache.java:339)
> |[Container factory]     at
> |org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:201)
> |[Container factory]     at java.lang.Thread.run(Thread.java:484)
> |
> |>
> |> > It looks like SecurityManager doesn't allow the access to private
> |> > fields, but I haven't installed a SecurityManager (more precisely,
> |> > the correspondent line in jboss.properties is commented)
> |> > and my server.policy "Allows everything".
> |> > And, BTW, why the passivation is performed on shutdown?
> |> > Does jBoss restores the passivated instances after restart???
> |>
> |> Yes, it should (ie on restart it does not activate them; it should do it
> |> when the bean is called again). Well I never tested this, maybe I'll try
> |> now...
> |>
> |> HTH,
> |>
> |> Simon
> |
> |

Reply via email to