Using idea, a spring boot project based on Maven is created. In the process of deploying the project with war package and Linux (providing JDK environment, Tomcat), when packaging, you will be prompted that javax. Servlet. ServletException
cannot be accessed
You need to remove tomcat from the web dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<plugin> No web required for packaging
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
Read More:
- Error 500: javax.servlet.ServletException : srve0207e: Solutions
- When WebSphere deploys a project, an error is reported: error 500: javax.servlet.ServletException : SRVE0207E: Uncaught initialization
- [spring] start error: nosuchmethoderror: javax.servlet.http . HttpServletResponse.getStatus () I
- [Solved] SpringMVC Run Error: SEVERE-Servlet.service() for servlet jsp threw exception
- maven_ Unable to create servlet file under Java Web project
- java.lang.NoSuchMethodError Quote: javax.servlet.com Yeah. HttpServletRequest.isAsyncStarted ()Z
- Spring boot project running error: Servlet.service () for servlet [dispatcherServlet] threw exception
- Maven project running servlet jump JSP error: HTTP status 500 – unable to compile class for JSP
- javax.persistence.EntityNotFoundException : unable to find error
- Error 404 reported by spring MVC access Servlet
- An error was reported when springboot connected to redis Servlet.service () for servlet [dispatcherServlet] in context with path [] threw e
- The solution to the problem that the method of interacting with database in the servlet class is invalid after the servlet submits 404, 500 refresh and becomes 404, and after connecting to the data pool
- Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request p
- The idea code pushes to GitHub and reports an error fatal: unable to access
- [Solved] Logon failed, use ctrl+c to cancel basic credential prompt. unable to access
- Git clone appears fatal: unable to access’ https://github.com/… The solution to the problem
- unable to access ‘https://github.com/facebook/react-devtools/‘:
- The solution of centos7 in VMware virtual machine unable to access after installing nginx
- Mac USB error 3: Unable to claim interface: Access denied (insufficient permissions)
- Unable to open the physical file “d:\***.mdf”. Operating system error 5: “5(Access is denied.)”.