tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kasturi <kne...@cisco.com>
Subject FW: Issue with Tomcat Version 7.0.64
Date Wed, 14 Oct 2015 04:25:01 GMT
Hi Christopher,

Apologies for the formatting issue. Hope the below shared details helps clarify the issue.

Our application has a customized valve called CiscoSSOValve.java which extends SingleSignOn.java
of catalina.jar. 
SingleSignOn.java of catalina.jar has gone in some changes in 7.0.64. PFB the list of changes
for which we are facing issues.

1. sessionEvent() method which existed in earlier releases is not present any more. We are
overriding this method in our customized valve, hence facing compilation error where it tries
to do a super.sessionEvent(event) call.
2. A new class SingleSignOnListener.java has been introduced in 7.0.64 having the same sessionEvent()
method mentioned in issue 1. We tried using this method but unable to do so as its constructor
requires a valid 'SSOId' to be passed.
3. 'SSOId' was earlier retrievable from 'reverse' map of SingleSignOn.java class. This map
is not present in the 7.0.64 release, so we are unable to fetch the 'SSOId' here and pass
it in the call to constructor of SingleSignOnListener.java as a workaround for issue1.

Compilation errors we are facing are:

[javac] /data/shared_ws/jasper/kneogy_stashNew/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/tomcat/valve/CiscoSSOValve.java:91:
error: cannot find symbol
    [javac]         synchronized (reverse) {
    [javac]                       ^
    [javac]   symbol:   variable reverse
    [javac]   location: class CiscoSSOValve
    [javac] /data/shared_ws/jasper/kneogy_stashNew/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/tomcat/valve/CiscoSSOValve.java:92:
error: cannot find symbol
    [javac]             ssoId = reverse.get(session);
    [javac]                     ^
    [javac]   symbol:   variable reverse
    [javac]   location: class CiscoSSOValve
    [javac] /auto/ipcbu-ucxn-cache/CORES/BLD-cc_mainline_16-cct-ccm-d/unityconnection/CLNX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/tomcat/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/CLNX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/tomcat/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/CLNX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/unity/tomcat/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


Thanks and regards,
Kasturi



-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Wednesday, October 14, 2015 1:50 AM
To: Tomcat Users List
Subject: Re: Issue with Tomcat Version 7.0.64

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Kasturi,

On 10/13/15 9:59 AM, kasturi wrote:
> 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

The list has ruined your formatting. Can you post with a text-only message?

> //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

That doesn't look like a compiler message.

> sessionEvent() Method does not exist

Nor does this. Can you post actual compiler output?

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

What new 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.

Which class requires SSOID to instantiate it? This class has a no-arg constructor in 7.0.64:

http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_64/java/org/
apache/catalina/authenticator/SingleSignOn.java?view=markup

> //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/unityconnect
ion/CL
>
> 
NX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/uni
ty/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/unityconnect
ion/CL
>
> 
NX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/uni
ty/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/unityconnect
ion/CL
>
> 
NX_11.5.0.98/source/un_CUSA/Projects/cisco-unity-valve/src/com/cisco/uni
ty/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

There are no deprecated methods in SingleSignOn.java. If you want to know what happened to
SingleSignOn.java, follow the revision history which you can see here:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_64/java/org/
apache/catalina/authenticator/SingleSignOn.java?view=log

> We need assistance on below points:
> 
> 1.       How to fetch the SSOId corresponding to a session as
> 'reverse' map does not exists any more.

See r1675282.

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

Sorry, I can't help there. :/

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJWHWdaAAoJEBzwKT+lPKRYUdEP+gPgQvYqZu33mb0sXSGHzB3d
BOkcSr6CQCSseLn0vmvB9/bXQqw60l9s9DSUyGDGD+d58r7D+st7XJ+GspwT8UaX
kqIEhPyeHQtiCi3i2HiBWFSHdDjtc6ZoWFudekc/kR/oA8mXYDjz9TKeaKyT1gyq
pLZQRxa9u9nGOKFKlmyKOvabMvi8ozmb5KE/IIb8NzT9ChMb6bbFXpVu52hghA5X
UsqZAtDEdddBQcZyoWfrqjqdNTvTfWcGFeMrlvwpk2p5LfT9HUvlhIrWM878xIwN
0vmz30pEuZ4kXZEZI+qzhJulR88MjYemlq5Gt1MGtOGIPo5/W8yNqeTVsdpiqmDb
Jx2pv4AMlGUDMGxYF18TB+BaWVehgkQmk2nEsPSi1aOdyeAriZSOXdHGaMOhcjgt
FnPfmbTFjUTcgcy1jBuOx2TVownVkgfi64aaQdkw9HlhYJ3kyqsY+S+7np7i8ENZ
EKLNxBIdt3Q1sXBCSKNoBr+nnJE1jYbHzOadcwiYJo6aix11taqJQMP7WZ0lMrsw
8i3QHooGKJJqXGqiPYqqzpj5owL33UkMyqlwGeyOrQ9q+gqFm7QzSy1hjwclHB0M
nVo+I0+fPiF5QBUyCP2wdUZmDrarCfLZdfKdInzF9Ye1xzjj8h+vyADGtVJBeZs5
+NVJ8ICF3TAs5a0coIDN
=YnQX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message