java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Dear Scott, In atlassian-seraph-2.5.0 (included in JIRA 4.3.4, in previous version was atlassian-seraph-2.5.0-m3) the implementation of "DefaultAuthenticator" has changed. Namely, the following code was changed in the "login" method in: {code:title=DefaultAuthenticator.java (atlassian-seraph-2.5.0)|borderStyle=solid} ... final String METHOD = "login : "; final boolean dbg = log.isDebugEnabled(); final Principal principal = new Principal() { public String getName() { return userName; } }; final boolean authenticated = authenticate(principal, password); ... {code} And in the previous version was: {code:title=DefaultAuthenticator.java (atlassian-seraph-2.5.0-m3)|borderStyle=solid} ... final Principal user = getUser(userName); if (user == null) { log.info(METHOD + "'" + userName + "' does not exist and cannot be authenticated."); } else { final boolean authenticated = authenticate(user, password); ... {code} As a result current implementation of "JiraCasAuthenticator#authenticate" fails with ClassCastException: {code:title=JiraCasAuthenticator.java|borderStyle=solid} ... @Override protected boolean authenticate(final Principal principal, final String password) throws AuthenticatorException { return ((User) principal).authenticate(password); } ... {code} Stack trace: {noformat} java.lang.ClassCastException: com.atlassian.seraph.auth.DefaultAuthenticator$1 cannot be cast to com.opensymphony.user.User at org.jasig.cas.client.integration.atlassian.JiraCasAuthenticator.authenticate(JiraCasAuthenticator.java:55) at com.atlassian.seraph.auth.DefaultAuthenticator.login(DefaultAuthenticator.java:94) at com.atlassian.seraph.filter.PasswordBasedLoginFilter.runAuthentication(PasswordBasedLoginFilter.java:127) at com.atlassian.seraph.filter.PasswordBasedLoginFilter.login(PasswordBasedLoginFilter.java:72) at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:130) at com.atlassian.jira.web.filters.JiraLoginFilter.doFilter(JiraLoginFilter.java:70) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) {noformat} Best regards, Ivan Goonich eVelopers, Corp.
    via by Ivan Goonich,
  • Dear Scott, In atlassian-seraph-2.5.0 (included in JIRA 4.3.4, in previous version was atlassian-seraph-2.5.0-m3) the implementation of "DefaultAuthenticator" has changed. Namely, the following code was changed in the "login" method in: {code:title=DefaultAuthenticator.java (atlassian-seraph-2.5.0)|borderStyle=solid} ... final String METHOD = "login : "; final boolean dbg = log.isDebugEnabled(); final Principal principal = new Principal() { public String getName() { return userName; } }; final boolean authenticated = authenticate(principal, password); ... {code} And in the previous version was: {code:title=DefaultAuthenticator.java (atlassian-seraph-2.5.0-m3)|borderStyle=solid} ... final Principal user = getUser(userName); if (user == null) { log.info(METHOD + "'" + userName + "' does not exist and cannot be authenticated."); } else { final boolean authenticated = authenticate(user, password); ... {code} As a result current implementation of "JiraCasAuthenticator#authenticate" fails with ClassCastException: {code:title=JiraCasAuthenticator.java|borderStyle=solid} ... @Override protected boolean authenticate(final Principal principal, final String password) throws AuthenticatorException { return ((User) principal).authenticate(password); } ... {code} Stack trace: {noformat} java.lang.ClassCastException: com.atlassian.seraph.auth.DefaultAuthenticator$1 cannot be cast to com.opensymphony.user.User at org.jasig.cas.client.integration.atlassian.JiraCasAuthenticator.authenticate(JiraCasAuthenticator.java:55) at com.atlassian.seraph.auth.DefaultAuthenticator.login(DefaultAuthenticator.java:94) at com.atlassian.seraph.filter.PasswordBasedLoginFilter.runAuthentication(PasswordBasedLoginFilter.java:127) at com.atlassian.seraph.filter.PasswordBasedLoginFilter.login(PasswordBasedLoginFilter.java:72) at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:130) at com.atlassian.jira.web.filters.JiraLoginFilter.doFilter(JiraLoginFilter.java:70) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) {noformat} Best regards, Ivan Goonich eVelopers, Corp.
    via by Ivan Goonich,
    • java.lang.ClassCastException: com.atlassian.seraph.auth.DefaultAuthenticator$1 cannot be cast to com.opensymphony.user.User at org.jasig.cas.client.integration.atlassian.JiraCasAuthenticator.authenticate(JiraCasAuthenticator.java:55) at com.atlassian.seraph.auth.DefaultAuthenticator.login(DefaultAuthenticator.java:94) at com.atlassian.seraph.filter.PasswordBasedLoginFilter.runAuthentication(PasswordBasedLoginFilter.java:127) at com.atlassian.seraph.filter.PasswordBasedLoginFilter.login(PasswordBasedLoginFilter.java:72) at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:130) at com.atlassian.jira.web.filters.JiraLoginFilter.doFilter(JiraLoginFilter.java:70) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    No Bugmate found.