Problem migrating JIRA 6 custom servlet filter to JIRA 7

Hi,

We are migrating our JIRA server 6.4.5 to JIRA Software (Server) 7.3.8 right now and we are encountering a problem with one of our custom plugin.
It’s a servlet filter that we have developped to interface with our CAS SSO (not for login/logout, that’s another one wich extends JIRASecurityFilter and works fine) and in the logs, we have an exception that says that our class cannot be cast to javax.servlet.Filter (java.lang.ClassCastException).

I have modified the pom.xml (see below) to use the latest version of JIRA and the sal plugin and also modified it to use Java 1.8 for compiling. And yet it seems to not be enough.

When I look at the dependancies recovered, I see that we use servlet-api.2.3 so I assume the problem is from there, as we moved from tomcat 7 to 8 but I can’t figure out how to solve it.
Does anyone have any idea ?

Thanks !

PS : Here is our pom :

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.xxx.jira.plugins</groupId>
    <artifactId>jira-xxx-services-users</artifactId>
    <version>3.0.0</version>

    <organization>
        <name>xxx</name>
        <url>http://www.xxx.com/</url>
    </organization>

    <name>xxx Synchro Groupes/Utilisateurs</name>
    <description>Ce plugin est utilisé pour la gestion des groupes et des utilisateurs. Il est relié à la plateforme de groupe.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <!-- 
            Si cette librairie n'est pas présente sous nexus, il faut l'installer dans son repo local pour compiler le projet.
                1) récupérer le jar libthrift sur http://ivy.intra.xxx.com:8080/repo/xxx/libthrift/0.10.0/ :
                2) En ligne de commande, se déplacer à l'endroit ou le jar a été téléchargé puis taper la commande suivante :
                    atlas-mvn install:install-file -Dfile=libthrift-0.10.0-jar.jar -DgroupId=com.xxx -DartifactId=libthrift -Dversion=0.10.0 -Dpackaging=jar
        -->
        <dependency>
            <groupId>com.xxx</groupId>
            <artifactId>libthrift</artifactId>
            <version>0.10.0</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <version>3.0.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>embedded-crowd-core</artifactId>
            <version>2.10.2-rc04</version>
            <scope>provided</scope>
        </dependency>
         <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
            <version>${plugin.testrunner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring</artifactId>
          <version>2.5.6.SEC01</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>cas</groupId>
            <artifactId>casclient</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
           <groupId>javax.servlet</groupId>
           <artifactId>javax.servlet-api</artifactId>
           <version>3.0.1</version>
           <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals><goal>add-source</goal></goals>
                        <configuration>
                            <sources>
                                <source>thrift.generated</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.data.version}</productDataVersion>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <jira.version>7.3.8</jira.version>
        <amps.version>6.2.9</amps.version>
        <plugin.testrunner.version>1.1.1</plugin.testrunner.version>
        <!-- TestKit version 5.x for JIRA 5.x, 6.x for JIRA 6.x -->
        <testkit.version>5.2.26</testkit.version>
    </properties>

</project>


Can you provide the entire stack trace in a code block?

Here it is :

2017-06-27 17:32:34,377 http-nio-8080-exec-7 ERROR anonymous 1052x18x1 hc0zjx 10.55.58.34,10.154.30.104 /secure/errors.jsp [atlassian.plugin.servlet.DefaultServletModuleManager] Unable to create new reference LazyLoadedFilterReference{descriptor=com.xxx.jira.plugins.jira-xxx-services-users:reactivateServlet (null), filterConfig=ApplicationFilterConfig[name=filter-plugin-dispatcher-before-login-request, filterClass=com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter]}
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.ClassCastException: com.xxx.jira.plugins.users.servlet.filter.UserReactivationFilter cannot be cast to javax.servlet.Filter
        at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
        at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:447)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:440)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:300)
        at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:68)
        at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:99)
        at com.atlassian.jira.web.filters.JIRAProfilingFilter.doFilter(JIRAProfilingFilter.java:16)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.web.filters.johnson.JiraJohnsonFilter.doFilter(JiraJohnsonFilter.java:53)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:39)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58)
        at com.valiantys.jira.plugins.sql.service.servicedesk.ContextListenerServletFilter.doFilter(ContextListenerServletFilter.java:24)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64)
        at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58)
        at com.atlassian.analytics.client.filter.JiraAnalyticsFilter.doFilter(JiraAnalyticsFilter.java:42)
        at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:39)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64)
        at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58)
        at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64)
        at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58)
        at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64)
        at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58)
        at com.atlassian.prettyurls.filter.PrettyUrlsCombinedMatchDispatcherFilter.doFilter(PrettyUrlsCombinedMatchDispatcherFilter.java:56)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64)
        at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37)
        at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:70)
        at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:74)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.core.filters.cache.AbstractCachingFilter.doFilter(AbstractCachingFilter.java:31)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.core.filters.encoding.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:39)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at com.atlassian.jira.web.filters.PathMatchingEncodingFilter.doFilter(PathMatchingEncodingFilter.java:41)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.startup.JiraStartupChecklistFilter.doFilter(JiraStartupChecklistFilter.java:72)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.web.filters.MultipartBoundaryCheckFilter.doFilter(MultipartBoundaryCheckFilter.java:36)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:74)
        at com.atlassian.jira.web.filters.JiraFirstFilter.doFilter(JiraFirstFilter.java:59)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.gzipfilter.GzipFilter.doFilterInternal(GzipFilter.java:121)
        at com.atlassian.gzipfilter.GzipFilter.doFilter(GzipFilter.java:92)
        at com.atlassian.jira.web.filters.gzip.JiraGzipFilter.doFilter(JiraGzipFilter.java:44)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.atlassian.jira.web.filters.InstantUpgradeHoldingFilter.doFilter(InstantUpgradeHoldingFilter.java:99)
        at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at net.gicm.methode.monitoring.MonitoringFilter.doFilter(MonitoringFilter.java:157)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.xxx.commons.cas.GicmCASFilter.contextInSession(Unknown Source)
        at com.xxx.commons.cas.GicmCASFilter.doFilter(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:169)
        at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:232)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: com.xxx.jira.plugins.users.servlet.filter.UserReactivationFilter cannot be cast to javax.servlet.Filter
        at com.atlassian.plugin.servlet.descriptors.ServletFilterModuleDescriptor.getModule(ServletFilterModuleDescriptor.java:122)
        at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.<init>(DelegatingPluginFilter.java:32)
        at com.atlassian.plugin.servlet.FilterFactory.newFilter(FilterFactory.java:15)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:514)
        at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:503)
        at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:325)
        at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
        ... 115 more

Are you extending ServletFilter?

I implement javax.servlet.Filter
As I said, it worked just fine on JIRA 6.4.5.

Here is our code (not the most beautiful code but nobody wants to rewrite it as it’s working fine) (and also redacted here unfortunately) :

package com.xxx.jira.plugins.users.servlet.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.xxx.jira.plugins.users.commun.Constants;
import com.xxx.jira.plugins.users.services.xxxConfigurationManager;
import com.xxx.jira.plugins.users.services.xxxUsersGroupsManager;
import com.atlassian.crowd.embedded.api.CrowdService;
import com.atlassian.crowd.embedded.api.User;
import com.atlassian.crowd.embedded.api.UserWithAttributes;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.user.ApplicationUser;
import com.atlassian.jira.user.ApplicationUsers;
import com.atlassian.sal.api.pluginsettings.PluginSettingsFactory;

import edu.yale.its.tp.cas.client.filter.CASFilter;

public class UserReactivationFilter implements Filter {

    private static final Log LOG = LogFactory.getLog(UserReactivationFilter.class);

    private final xxxConfigurationManager xxxConfigurationManager;
    
    private final PluginSettingsFactory pluginSettingsFactory;
    
    private final xxxUsersGroupsManager xxxUsersGroupsManager;
    
    public UserReactivationFilter(final xxxConfigurationManager xxxConfigurationManager, final PluginSettingsFactory pluginSettingsFactory, final xxxUsersGroupsManager xxxUsersGroupsManager) {
        this.xxxConfigurationManager = xxxConfigurationManager;
        this.pluginSettingsFactory = pluginSettingsFactory;
        this.xxxUsersGroupsManager = xxxUsersGroupsManager;
    }

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("UserReactivationFilter - init");
        }
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("doFilter - IN");
        }
        
        HttpServletRequest req = (HttpServletRequest) request;
        
        String userCas = (String) req.getAttribute(CASFilter.CAS_FILTER_USER);
        if (StringUtils.isBlank(userCas)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("User not found in request, looking into session ");
            }
            userCas = (String) req.getSession().getAttribute(CASFilter.CAS_FILTER_USER);
        }
        
        if (LOG.isDebugEnabled()) {
            LOG.debug("Settings verifying : ");
            LOG.debug("User admin utilise : " + xxxConfigurationManager.getString(pluginSettingsFactory, Constants.DEACTIVATION_USERS_ADMIN));
            if (StringUtils.isNotBlank(userCas)) {
                LOG.debug("User to verify  : " + userCas);
            } else {
                LOG.debug("User to verify not found");
            }
        }
        
        if (StringUtils.isNotBlank(userCas) && StringUtils.isNotBlank(xxxConfigurationManager.getString(pluginSettingsFactory, Constants.DESACTIVATION_USERS_ADMIN))) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("User validated");
            }
            // On reactive le user s'il est desactive
            CrowdService crowdService = ComponentAccessor.getCrowdService();

            UserWithAttributes userToVerify = crowdService.getUserWithAttributes(userCas);
            if (userToVerify != null && !userToVerify.isActive()) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("User " + userCas + " inactive. Reactivation...");
                }
                
                // Connexion avec un utilisateur avec privileges admin
                User adminFromCrowd = crowdService.getUser(xxxConfigurationManager.getString(pluginSettingsFactory, Constants.DESACTIVATION_USERS_ADMIN));
                ApplicationUser adminFromJIra = ApplicationUsers.from(adminFromCrowd);
                ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(adminFromJIra);
                
                xxxUsersGroupsManager.activateDeactivateUser(userToVerify, true);
                
                // On se deconnecte du mode admin
                ComponentAccessor.getJiraAuthenticationContext().clearLoggedInUser();
                
                if (LOG.isDebugEnabled()) {
                    LOG.debug("User " + userCas + " inactive. Reactivated !!!");
                }
            } else {
                if (LOG.isDebugEnabled()) {
                    if (userToVerify != null ) {
                        LOG.debug("User " + userCas + " already active.");
                    } else {
                        LOG.debug("User " + userCas + " not found");
                    }
                }
            }
        } else if (LOG.isDebugEnabled()) {
            LOG.debug("Reactivation impossible (user not found or settings problem)");
        }
        
        if (LOG.isDebugEnabled()) {
            LOG.debug("doFilter - OUT");
        }
        
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        if (LOG.isDebugEnabled()) {
            LOG.debug("destroy");
        }    
    }

}

Have you decide something?
I got the same legacy thing.

Cheers,
Gonchik Tsymzhitov

This really seems to be a maven issue. It seems like you’re importing a conflicting ServletFilter dependency that does not match the implementation in Jira 7.