Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1116055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:14:48+00:00 2026-05-17T03:14:48+00:00

I have a Web Application that I’m trying to move from Sun Application Server

  • 0

I have a Web Application that I’m trying to move from Sun Application Server V9 to Glassfish V2.1.1

I’m using Netbeans 6.0.1 to develop the App, and it’s using JSP, SessionBeans and JDBC to connect to MySQL.

I’ve made good progress and can compile and deploy the App. to Glassfish OK.
The App starts and I takes me to my login page, where I can login OK.

However, I can see that all of my SessionBeans repeatedly call init() and destroy() methods as each JSP page is rendered.

My Session Bean extends AbstractSessionBean


public class SessionBean1 extends AbstractSessionBean {

Using Netbeans Debug tool I have tracked down the LifecycleListener.attributeReplaced(HttpSessionBindingEvent event) method that calls the destroy() and init() methods on my AbstractSessionBeans


public void attributeReplaced(HttpSessionBindingEvent event) {

    // If the old value is an AbstractSessionBean, notify it
    Object value = event.getValue();
    if ((value != null) && (value instanceof AbstractSessionBean)) {
        ((AbstractSessionBean) value).destroy();
    }

    // If the new value is an AbstractSessionBean, notify it
    value = event.getSession().getAttribute(event.getName());
    if ((value != null) && (value instanceof AbstractSessionBean)) {
        ((AbstractSessionBean) value).init();
    }

}

In Netbeans 5.5 and Sun Application Server V9 the AbstractSessionBean Session Beans work fine and don’t have their init() and destroy() methods() called all the time.

I’ve checked that my Session Beans are in the faces-config.xml.

So, my feeling is that it’s my configuration of Glassfish 2.1.1…

Please can you help?

Thanks

P.S.

Just to add to this….

I can deploy exactly the same app from Netbeans 6.0.1 to:

  • Sun App Server V9 and it works fine
    with the session beans init() method
    only being called once when the
    session is created

  • Glassfish V2.1.1 and the Session Bean
    init() and destroy() method get
    called repeatedly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T03:14:49+00:00Added an answer on May 17, 2026 at 3:14 am

    So, a new session is started on each request. This can mean that the client or server doesn’t support cookies, or the webapplication didn’t have URL rewriting properly implemented for the case that the client has cookies disabled.

    Tracking the HTTP request/response headers using a tool like Firebug must give new insights. On the very first request on a new client-server session, the server should have set the Set-Cookie header in the response with the session ID:

    alt text


    In all subsequent requests during the same client-server session, the client should have set the Cookie header in the request with the same session ID:

    alt text


    If either of those is missing or different, then you should know the root cause of the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that is deployed to a server. I am trying
I have a web application that loads some 50 tables from SQL Server into
I have a web application that talks to R using plr when doing adaptive
I have a web application that developed using j2ee and Struts 2 MVC. Sometimes
I have this web application that i have created using Wicket, Guice and JPA.
I have web application in that i am using tabbed interface control in this
I have a web application that runs multiple websites from one codebase. I have
I have a web application that needs to fire off a long-running SQL Server
I have an ASP.NET Web Application that constantly monitors for new RSS Feed from
I have a web application that needs to take a file upload from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.