I have a SpringBoot application. One class needs to import javax.servlet.filter and implements the filter for customization. It builds successfully locally, but failed to start up on the cloud server and throws llegalStateExceptions. It's the filter class caused the issue. Once I remove the filter, the app runs successfully locally and on the cloud.
I think it might be possible that app could not find javax.servlet api in maven, or it's a servlet/embedded tomcat incompatibility issue. We have most of the dependencies from org.springframework.boot. The only tomcat related part we have is:
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>LATEST</version>
</dependency>
We don't have the following:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
I tried to add them (individually and both) and changed scope to compile, or remove scope. All sorts of dependencies minor changes, but nothing works so far. Please let me know if you have any good suggestions.