10 Replies Latest reply on Apr 24, 2004 6:19 AM by umajava

    Why are the session objects lost?

    ggopal

      Hi jboss experts:

      I am fairly new to jboss and I have the following situation. I was wondering if someone can help me out.

      1) I have a login jsp which calls a servlet to process the login information.
      2) The login servlet after processing, stores the authentication java object and other objects that the app needs in the session object.
      3) After processing is completed by the login servlet, request is forwarded to another jsp which tries to retrieve the authentication object saved in the session.

      The situation is that the retrieval of the authentication object fails. I am getting a null pointer exception.

      I have examined the following in my application.
      1) made sure that the authentication and other objects that my app needs are stored in the session by trying to retrieve it immediately after saving it in the login servlet. That works.

      It was working a couple of days ago, but, now it doesn't. I am at a loss where the session object is stored etc. I am using the default configuration.

      Thanks for your time and help,
      -- Gopal

        • 1. Re: Why are the session objects lost?
          ggopal

          I also would like to know the following:

          1) Where are the default configurations for the session stored in jboss 3.2.2?
          2) Under Win2k, where are the session objects stored? c:\documents and settings\... perhaps. I am not sure.

          Thanks
          -- Gopal

          • 2. Re: Why are the session objects lost?
            ggopal

            Ok, this is really weird.

            My app works when use Mozilla Firebird.

            It seems to have intermittnet session related problems in
            1) IE 6 &
            2) Mozilla

            Not sure why this is happening. Any ideas will be highly appreciated.

            Thanks
            -- Gopal

            • 3. Re: Why are the session objects lost?
              jonlee

              Track your session ID through your process (maybe display it somewhere) - I'm assuming you don't traverse any static pages? No blocking of cookies?

              • 4. Re: Why are the session objects lost?
                ggopal

                Hi jonlee:

                Well, cookies are enabled (both IE & Mozilla/Netscape). This is weird. I wish I knew where it stores the cookies. I cannot see its location even with cookies manager option (managed stored cookies) and I am puzzled.

                The puzzling thing is that it used to work on these browsers and all of a sudden it stopped working. I have tried shutting down jboss and restarting it, but, no help there. Initially, my thought was that maybe the cookie was corrupted and if I can delete it, then, it may work. But, I don't know the location of the cookies. I have turned on "alert me when storing a cookie" option and it shows me the jsession id and path as "/". But, don't know where "/" is located ...


                It works very well under mozilla firebird.


                -- Gopal

                • 5. Re: Why are the session objects lost?
                  jonlee

                  Try tracking it on the application side by printing out the ID for each page in your process. At least you'll get an idea of where the ID gets dropped or at least where a new session ID appears. That could help narrow it down.

                  • 6. Re: Why are the session objects lost?
                    jsurf

                    I had a problem loosing session objects with jboss 3.2.3 under Linux, too. Switched from Blackdown Linux 1.4 jre+jikes compiler to original Sun Java SDK 1.4.2+jikes compiler and now it works.

                    • 7. Re: Why are the session objects lost?

                      May be too simple, but the 2nd JSP is in the same web context as the login.jsp? If not, the session won't be visible.

                      • 8. Re: Why are the session objects lost?
                        jayasudan

                        Hi ggopal,

                        I am also getting the same problem with Jboss 3.2.3 & Tomcat 4.1

                        Did you get answer to the issue? Can you pl let me know the solution if you have solved the issue? I have been behind this issue for the past 2 weeks and struggling to find out whats wrong with my code / config. :(

                        Any info or pointers related to this issue would be really helpful to me.
                        Thanx in advance.

                        FYI: I have posted the issue under 'HTTPD, Servlets & JSP' with subject 'Session attributes are lost after jsp forward'.

                        regards,
                        Jay.

                        • 9. Re: Why are the session objects lost?
                          mrgarageman

                          What is the scope of the bean on the 2nd jsp? page or session? or try using response.sendRedirect(url) instead of using <jsp:forward page="page" />.

                          • 10. Re: Why are the session objects lost?
                            umajava

                            I too am having the same problem with Tomcat 5.0.19. The application worked well for the past few days and it stopped working suddenly.

                            Now what happens is when the user logs in for the first time, the session is destroyed and the user is sent back to the Login page. If the user logs in with the same browser, then everything works fine.

                            I then shifted the entire application on to Tomcat 4.0.6 and it works great without any problems.

                            I have now tried to shift to JBoss thinking that this can solve my problem. But when you say that you have problems with this software too.. Then what software should I use?

                            Thanks
                            Uma