apache tomcat catalina as maven dependency for CORS filter

后端 未结 2 1977
自闭症患者
自闭症患者 2021-02-20 07:45

I\'m using org.apache.catalina.filters.CorsFilter in my webapp. So I specify the maven dependency


    org.apache.tomcat

        
相关标签:
2条回答
  • 2021-02-20 08:00

    This worked for me:

            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-catalina</artifactId>
                <version>7.0.42</version>
                <scope>provided</scope>
            </dependency>
    

    Trying 7.0.50 also worked. Can you double-check that there are no competing jar file versions lying around? Perhaps there is an older version without the class actually getting used by the JVM. Under Linux, "ls -l /proc/$CATALINA_PID/fd", may show which jar file is being used.

    Also make sure to run this in a recent enough version of the Tomcat server.

    0 讨论(0)
  • 2021-02-20 08:08

    You can add the jar to your repository and modify the .openshift/config/catalina.properties to let tomcat see it:

    shared.loader=${catalina.home}/../app-root/runtime/repo/_your_jar_folder_
    

    You can also use the common.loader - look up tomcat's refs for difference.

    0 讨论(0)
提交回复
热议问题