1. Error in adding Maven project in idea: Java: package javax Servlet does not exist. As shown in the figure:
2. Solution
1. In file — > Project Structure –> Make changes in modules
2. Select dependencies in modules and click + — > Jars or directories to add
3. Select the local Tomcat installation path, go to the lib folder and select: jsp-api.jar and servlet-ap.jar, then click OK, we can see two more packages, click Apply OK, the following figure.
4. Redeploy the project to run successfully.
Read More:
- [Solved] Maven Project Error: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- [Solved] IDEA2020 Error: Cannot resolve symbol ‘Servlet‘
- IDEA Import Servlet Package Error [How to Solve]
- Continuous Error 404 in servlet operation [How to Solve]
- [Solved] Error running ‘TomEE 10.0.121‘: The selected directory is not a TomEE hom
- [Solved] IntelliJ IDEA Start tomcat Error: Disconnected from server
- [Solved] java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
- [Solved] Tomcat7 Start Error: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardCon
- [Solved] Tomcat Do not Start Error: Error: Application Server not specified
- Tomcat Run Error: Can‘t find catalina.jar [How to Solve]
- Tomcat cross server upload error 403forbidden [How to Solve]
- [Solved] Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘:
- [Solved] Upload Files Error: Request processing failed;nested exception is org.springframework.web.multipart.MultipartExcepti
- [Solved] IDEA springboot Startup Error: java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path
- [Solved] JAVA Project Import jstl Error: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
- [Solved] Springboot upload failed to find the temporary directory error
- [Solved] Error running ‘tomcat:run‘: Cannot run program “tomcat:run“
- [Solved] jvm 1 Error occurred during initialization of VM Could not reserve enough space for object heap
- IDEA Create Web Project with maven Error: The desired archetype does not exista…
- [Solved] eureka Startup Error: Unable to start web … nested exception is org.springframework.boot.web.server.WebS