I believe this was intended as a personal email. let me translate for our
american colleagues :)

>Hallo Christian,
Hello Christian.

>ich habe deine Mail gelesen. Wie lange arbeitest DU schon mit JBoss
I have read your mail, how long have you worked with JBoss
>und darf ich Dir ein paar Fragen stellen. Ich arbeite in Frankfurt für eine
Bank
and can I ask you a couple of questions, I work for a bank in Frankfurt
>und will JBoss hier einführen.
and would like to introduce JBoss here

>Vielen Dank für deine Antwort !
thank you so much for your answer

>Grüße
Blessing

>Mohammed
John :)

Filip



Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net
----- Original Message -----
From: "Mellouk, Mohammed" <[EMAIL PROTECTED]>
To: "'JBoss-Dev'" <[EMAIL PROTECTED]>
Sent: Tuesday, February 27, 2001 12:30 PM
Subject: AW: [jBoss-Dev] Passivation of Stateful Session Beans


Hallo Christian,

ich habe deine Mail gelesen. Wie lange arbeitest DU schon mit JBoss
und darf ich Dir ein paar Fragen stellen. Ich arbeite in Frankfurt für eine
Bank
und will JBoss hier einführen.

Vielen Dank für deine Antwort !

Grüße
Mohammed

-----Ursprüngliche Nachricht-----
Von: Christian Riege [mailto:[EMAIL PROTECTED]]
Gesendet am: Dienstag, 27. Februar 2001 20:10
An: jBoss Developer
Betreff: [jBoss-Dev] Passivation of Stateful Session Beans

Hi everybody,

I've stumbled across some odd behaviour by JBoss (CVS as of end
January 2001, but the affected pieces of code have been untouched
since then so this should be reproducible with a current CVS build):

Upon passivation of a stateful session bean I get the following
exception:

[Container factory] java.rmi.ServerException: Could not passivate; nested
exception is:
[Container factory]     java.io.NotSerializableException:
javax.naming.InitialContext
[ Remaining output deleted as its not relevant ]

The "problem" is that my stateful session bean has a variable like
this:

    public javax.naming.Context jndiContext;

which is initialized in setSessionContext() method as

    jndiContext = (javax.naming.Context) new InitialContext();

Apparently, InitialContext is not serializable (which is fine with me
:), but according to the specs, Section 6.4.1 (p. 51) this is not even
necessary:

"..., the references to the java:comp/env JNDI context and its
subcontexts, ..."

as the container (i.e. JBoss) should take care of this (page 52, in
the lower half of the page):

"If the session bean instance stores in its conversational state an
object reference to the java:comp/env JNDI context or its subcontext,
the container must be able to save and restore the object references
across the instance's passivation. The container can replace the
original object with a different and functionally equivalent object
during activation."

The same facts are stated in the O'Reilly book "Enterprise Java Beans
2nd Edition" by Richard Monson-Haefel, pages 251-252 and page 269.

So, what now? My current solution to this problem is that I have
disabled stateful session bean passivation in standardjboss.xml but
this cannot be a "real" solution :). Another solution (for me as an
application developer) would be to adapt my ejbPassivate() and
ejbActivate() methods accordingly, setting jndiContext to 'null' upon
passivation and re-instating it upon activation but according to the
specs I should not be responsible to do this.

The class that would have to be "fixed" is

    org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager

I would do it myself but as I don't have CVS write access and there
surely /have/ to be people who know how to implement the necessary
changes far better and quicker than me, I would appreciate it if
someone could do this :)

Best regards,
    Christian

--
Riege Software International GmbH         Phone: +49 (2159) 91 48 - 0
Mollsfeld 10                              Fax  : +49 (2159) 91 48 - 11
40670 Meerbusch, Germany                  http://www.riege.com/
----------< the apprentice master of the 'sendmail' daemon >----------




Reply via email to