Java.lang.ClassCastException:org.springframework.web.filter.CharacterEncodingFilter cannot is cast to Javax.servlet.Filter at Org.apache.catalina.core.ApplicationFilterConfig.getFilter (Applicationfilterconfig.java : 275) Cause: May be a package conflict one of your dependencies is including a SERVLET-API into your war file which causes that behavior. Using mvn Dependency:tree, you can find out which of your dependency are that. Need to exclude the SERVLET-API as Follows:<dependency> workaround:
<Dependency><Groupid>[value]</Groupid><Artifactid>[value]</artifactid> < version>[value]</version> Span class= "Hljs-tag" ><exclusions> < exclusion> <groupId> Javax.servlet</groupid> <artifactid>servlet-api</artifactId > </exclusion> </exclusions></DEPENDENCY>
Example:
<!--Remove your own servlet dependencies to avoid conflicts--<Dependency><Groupid>javax.servlet</Groupid><Artifactid>javax.servlet-api</Artifactid><version>3.1.0</version> < scope>provided</scope> <exclusions> < exclusion> <groupId> Javax.servlet</groupid> <artifactid>servlet-api</artifactId > </exclusion> </exclusions> </DEPENDENCY>
Cannot is cast to Javax.servletfilter