2 Replies Latest reply on Jul 15, 2011 4:48 AM by bcn

    Apache ajp + migration to JBoss 7 problem: http session not maintained

    bcn

      I migrate an web app to JBoss 7 and come upon a bizarre problem:

      the http session is lost when accessing through Apache via ajp connector.

      Direct access via localhost:8080 works fine. But when accessed through localhost:81 via Apache,

      in a session phase listener like:

       

      FacesContext context = event.getFacesContext();

      ExternalContext ext = context.getExternalContext();

      HttpSession session = (HttpSession) ext.getSession(false);

      boolean newSession = (session == null) || (session.isNew());

       

      session is always null!

       

      In standalone.xml I added ajp like documented:

       

      <socket-binding-group name="standard-sockets" default-interface="public">
          <socket-binding name="http" port="8080"/>
          <socket-binding name="https" port="8443"/>
          <socket-binding name="ajp" port="8009"/>

       

          <subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host">
              <connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>
              <connector name="ajp" protocol="AJP/1.3" socket-binding="ajp" scheme="ajp"/>
              <virtual-server name="default-host" enable-welcome-root="true">
                  <alias name="localhost"/>
              </virtual-server>
          </subsystem>

       

      Do I need to set any other parameters?

       

      In JBoss AS 6 it worked perfectly.

       

      Thanks