tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kasturi <kne...@cisco.com>
Subject Issue with Tomcat Version 7.0.64
Date Tue, 13 Oct 2015 13:59:28 GMT
Hi,

 

We have recently upgraded Tomcat to 7.0.64 from 7.0.59. Our application
extends SingleSignOn.java of catalina.jar to create a wrapper around it.
Some methods in the SingleSignOn.java class has been deprecated because of
which the compilation is failing. Details shared below.

 

 


Catalina 7.0.59

Catalina 7.0.64


 

//SingleSingOn Class

 

 

protected Map<Session, String> reverse = new HashMap();

 

 

public void sessionEvent(SessionEvent event)

  {

    if (!getState().isAvailable()) {

      return;

    }

    if ((!"destroySession".equals(event.getType())) &&
(!"passivateSession".equals(event.getType()))) {

      return;

    }

    Session session = event.getSession();

    if (this.containerLog.isDebugEnabled()) {

      this.containerLog.debug("Process session destroyed on " + session);

    }

    String ssoId = null;

    synchronized (this.reverse)

    {

      ssoId = (String)this.reverse.get(session);

    }

    if (ssoId == null) {

      return;

    }

    if (((session.getMaxInactiveInterval() > 0) &&
(System.currentTimeMillis() - session.getThisAccessedTimeInternal() >=
session.getMaxInactiveInterval() * 1000)) ||
("passivateSession".equals(event.getType())) ||
(!session.getManager().getContainer().getState().isAvailable())) {

      removeSession(ssoId, session);

    } else {

      deregister(ssoId);

    }

  }

 

 

 

 

//SingleSingOn Class

 

Reverse Map does not exist

 

sessionEvent() Method does not exist

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This new class has been introduced, but we cannot extend this class as we
are already extending "SingleSignOn" class. 

 

Also, to instantiate this class "SSOID" is required, as its constructor
expects it. We are not sure what to pass here to instantiate it.

 

 

//SingleSignOnListener

 

public void sessionEvent(SessionEvent event)

  {

    if (!"destroySession".equals(event.getType())) {

      return;

    }

    Session session = event.getSession();

    Manager manager = session.getManager();

    if (manager == null) {

      return;

    }

    Context context = (Context)manager.getContainer();

    if (context == null) {

      return;

    }

    Authenticator authenticator = context.getAuthenticator();

    if (!(authenticator instanceof AuthenticatorBase)) {

      return;

    }

    SingleSignOn sso = ((AuthenticatorBase)authenticator).sso;

    if (sso == null) {

      return;

    }

    sso.sessionDestroyed(this.ssoId, session);

  }

}

 

 

 

 

 

//Our Code

 

public class CiscoSSOValve extends SingleSignOn       >> Extending Catalina
Class

{

 

public void sessionEvent(SessionEvent event) {

 

        if(sNumTokens == 0) {

            super.sessionEvent(event);                                >>
Overloading sessionEvent which does not exists in new Jar.

            return;

        }

 

        // We only care about session destroyed events

        if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())

                &&
(!Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))){

            super.sessionEvent(event);

            return;

        }

 

 

Compilation Error

 

@

"ucxn_build_stash.pl.log" [noeol] 20853L, 2963854C
1,1           Top

    [javac]   symbol:   variable reverse

    [javac]   location: class CiscoSSOValve

    [javac]
/auto/ipcbu-ucxn-cache/CORES/BLD-cc_mainline_16-cct-ccm-d/unityconnection/CL
NX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/t
omcat/valve/CiscoSSOValve.java:98: error: cannot find symbol

    [javac]         super.sessionEvent(event); 

    [javac]              ^

    [javac]   symbol: method sessionEvent(SessionEvent)

    [javac]
/auto/ipcbu-ucxn-cache/CORES/BLD-cc_mainline_16-cct-ccm-d/unityconnection/CL
NX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/t
omcat/valve/CiscoSSOValve.java:100: error: cannot find symbol

    [javac]         if(null != lookup(ssoId)) { 

    [javac]                    ^

    [javac]   symbol:   method lookup(String)

    [javac]   location: class CiscoSSOValve

    [javac]
/auto/ipcbu-ucxn-cache/CORES/BLD-cc_mainline_16-cct-ccm-d/unityconnection/CL
NX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/t
omcat/valve/CiscoSSOValve.java:149: error: associate(String,Session) in
CiscoSSOValve cannot override associate(String,Session) in SingleSignOn

    [javac]     protected void associate(String ssoId, Session session) {

    [javac]                    ^

    [javac]   return type void is not compatible with boolean

    [javac] 7 errors

 

 

 

We need assistance on below points:

1.       How to fetch the SSOId corresponding to a session as 'reverse' map
does not exists any more.

2.       How does the call flow happen of SingleSignOn methods? 

 

 

Thanks and regards,

Kasturi.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message