Re: [enhydra] null pointer exception in requestPostProcessor

"Slobodan Vujasinovic" <[email protected]> Thu, 17 Mar 2005 11:33:47 +0100
Newsgroups gmane.comp.java.enhydra.general
Message-ID <003001c52adc$dd3050b0$2300a8c0@ns1>
Hi,

This (new) code of 'StandardApplication.requestPostProcessor()' method:
--------------------------------------------------------------------
public void requestPostProcessor(HttpPresentationComms comms)
        throws ApplicationException {
        try {
            if (comms.session != null) {
                comms.application.getSessionManager().
                    passivateSession(Thread.currentThread(),
                                     comms.session.getSessionKey());
            }
        } catch (SessionException e) {
            throw new ApplicationException(e);
        }
    }
--------------------------------------------------------------------
is present since Enhydra-5.1-1 (oldest release I've checked)!
So, I'm not sure about CVS version - 2005-01-27 12:32:31 (maybe 'Update
Special' CVS function was used long time ago - check your 'CVS/Entries'
file)!

I sopouse that 'application' attribute of your 'HttpPresentationComms'
object is 'null' and that this is the reason why you are gething this
'NullPointerException' (application must have 'SessionManager' so this can't
be it).

But, I have problem with thinking of scenario in which this could happen!
--------------------------------------------------------------------
Application object is initialized during
'HttpPresentationServlet.initApplication()' method execution. Same method
initializes 'HttpPresentationManager' for that application. Application
object is kept as attribute of HttpPresentationManager (received as
constructor parameter).
In 'HttpPresentationManager.Run()' method 'HttpPresentationComms' (comms)
object gets initialized with 'application' object as its constructor
parameter. Later, from same  'HttpPresentationManager.Run()' method (and
only from here), 'StandardApplication.requestPostProcessor()' method is
referenced.
--------------------------------------------------------------------

I will analyze this problem furtherly and you can (as fastest solution)
overwrite this method from your 'StandardApplication' extension class
(AppClass)!

Regards,
     Slobodan Vujasinovic
Enhydra Development Team


----- Original Message -----
From: "Petr Stehlik" <[email protected]>
To: <[email protected]>
Sent: Wednesday, March 16, 2005 11:57 PM
Subject: Re: [enhydra] null pointer exception in requestPostProcessor


Petr Stehlik píše v St 16. 03. 2005 v 23:00 +0100:
> FYI, I am getting tons of the following errors (not sure when and why),

>
com.lutris.appserver.server.StandardApplication.requestPostProcessor(Unknown
Source)

OK, let's try this:

---
EnhydraAppManager/src/com/lutris/appserver/server/StandardApplication.java.o
rig 2005-01-27 12:32:31.000000000 +0100
+++
EnhydraAppManager/src/com/lutris/appserver/server/StandardApplication.java
2005-03-16 23:44:27.000000000 +0100
@@ -558,10 +558,15 @@
     public void requestPostProcessor(HttpPresentationComms comms)
         throws ApplicationException {
         try {
-            if (comms.session != null) {
-                comms.application.getSessionManager().
-                    passivateSession(Thread.currentThread(),
-                                     comms.session.getSessionKey());
+            if (comms != null) {
+                if (comms.application != null) {
+                    if (comms.application.getSessionManager() != null
+                        && comms.session != null) {
+                            comms.application.getSessionManager().
+
passivateSession(Thread.currentThread(),
+
comms.session.getSessionKey());
+                    }
+                }
             }
         } catch (SessionException e) {
             throw new ApplicationException(e);




----------------------------------------------------------------------------
----


>
> --
> You receive this message as a subscriber of the [email protected]
mailing list.
> To unsubscribe: mailto:[email protected]
> For general help: mailto:[email protected]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
message.footer (text/plain, 275 B)
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws