Tag Archives: The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

JSP Web Error:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

problem description

for a new web project, the index.jsp page reports an error: the superclass “javax. Servlet. Http. Httpservlet” was not found on the Java build path
as shown in the figure:

processing method
right click build path configure build path, under libraries, click add variable

select server runtime, click Next

select tomcat, click Finish

and finally click OK

processing results

JSP Page The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

When you encounter this problem, it may be a new project, and the path of Tomcat is not configured

Firstly add Tomcat

Choose the version of Tomcat to add. I use 7.0 here

After that

Right click the project — > Build Path –> Configure build path –> Libraries –> Add Library –> Server Runtime–> tomact

The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

A new maven web project was created with the default index.jsp page, and it appeared.

The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

 

Solution.

Introduce the dependency in the pom.xml file.

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>

The project appears The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

1. The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

① Right-click the project –>build path –>Add libraries–>server runtime–>ok

 

②The picture below

 

 

2. JDBC connection to Oracle: ORA-28009: connection as SYS should be as SYSDBA OR SYSOPER

Solution: The user name is set to user = “sys as sysdba”, the others remain unchanged

3. The table and view do not exist!

My reason is: For example, sys users, if they log in as sysdba from time to time, this will happen. If they log in as dba, it’s the right thing to do.

4. Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.3:run (cargo-run) on project yycg: Execution cargo-run of goal org.codehaus.cargo:cargo-maven2-plugin: 1.2.3:run failed: [e:/apache-tomcat-7.0.52] is not a directory. It must point to the container home directory. -> [Help 1]

 

As shown in the figure:

Key location: run failed: [e:/apache-tomcat-7.0.52] is not a directory,

Solution: tomcat configuration error, modify the path of tomcat in the plug-in configuration in pom.xml

 

 

5. Could not write file: D:\JAVA_TOOLS\work-space\mars\sysconfig\.classpath.

In the build path, jre system library (unbound) appears

Solution: modify the file D:\JAVA_TOOLS\work-space\mars\sysconfig\.classpath. to not hide it.

6.Exception in thread “main” java.lang.UnsupportedClassVersionError(Unsupported major. minor version 52.0(xxx))

There are two situations for this error: ①: The jdk version is too low. ②The number of bits is wrong, 32 or 64 bits. The reason for this error is that the number of bits is wrong. Mine is 64 bits. It is right to change to 32 bits.

 

7.java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.

Port 1433 is not open

 

8.java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer] The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (“”): The data type 0x38 is unknown.

Incorrect driver version

 

9.No suitable driver found for jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_JXC;SelectMethod=Cursor

Here change jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_JXC;SelectMethod=Cursor to jdbc:sqlserver://localhost:1433;DatabaseName=db_JXC;SelectMethod=Cursor

That is to remove “microsoft”