title: javax.servlet in Springboot Application
body: <p>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. </p>
  
  <p>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:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.tomcat&lt;/groupId&gt;
      &lt;artifactId&gt;tomcat-jdbc&lt;/artifactId&gt;
      &lt;version&gt;LATEST&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>We don't have the following:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
      &lt;version&gt;3.1.0&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>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.</p>