Today, a Javaweb project was established using Eclipse+Maven, and the web container Jboss eap 6.2 was configured in eclipse. Create a new jsp page, add a simple
Java classes. However, a “red” error message appears at the top of the JSP page: The superclass “javax.servlet.http.HttpServlet” was not
found on the Java Build Path. It turns out that there is no Web container Runtime related class added to the Javaweb project class.
Error message:
The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
The solution is very simple, just add the following configuration in pom.xml:
1 < dependency > 2 < groupId > javax.servlet </ groupId > 3 < artifactId > servlet-api </ artifactId > 4 < version > 2.5 </ version > 5 < scope > provided </ scope > 6 </ dependency >
Supplement: If you still get an error, you can also try the following ways:
1. Right-click on the web project-“Properties or Build Path-“Java Build Path->Libraries-> Add Libray…->Server Runtime -“JBoss 7.1 Runtime
2. Switch to Orader and Export in the Java Build Path interface, select
Read More:
- Eclipse Error: javax.servlet.annotation.WebFilter [Solved]
- [Solved] Maven executes servlet error: HTTP Status 500
- [Exception] javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
- Error: Unable to build IHost No DbContext named ‘PersistedGrantDbContext‘ was found.
- [Solved] Failed to bind properties under ‘spring.datasource.type‘ to java.lang.Class<javax.sql.DataSource>
- Servlet.service() for servlet [dispatcherServlet] in context && Whitelabel Error Page
- [Solved] IDEA Start Project Error: Abnormal build process termination:Could not create the Java Virtual Machine.
- [Solved] FileUploadException: the request was rejected because no multipart boundary was found
- Cordova – CordovaError: Promise rejected with non-error: ‘ios-deploy was not found
- [ERROR FileExisting-conntrack]: conntrack not found in system path
- [Solved] IDEA JSP File out.println Error: Cannot resolve method ‘println(java.lang.String)’
- Git push error: error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
- [Solved] java.lang.reflect.InaccessibleObjectException: Unable to make protected java.net.http.HttpRequest()…
- [Solved] Error: condahtterror: http 404 not found for URL
- k8s kubernetes ingress error: endpoints “default-http-backend“ not found
- [Solved] Vscode Error: “export ‘default‘ (imported as ‘VueRouter‘) was not found in ‘vue-router‘
- POI Export Excel Error: HTTP Status 500 – Request processing failed; nested exception is java.lang.NullPointerException
- [Go] Solve the problem of exec: “gcc” executable file not found in %PATH% error when using cgo
- jitpack.io ERROR: No build artifacts found [How to Solve]
- The imported project “c:\Microsoft.Cpp.Default.props” was not found