Tối đẹp trời này tớ đã bị mắc lỗi này và mất cả tiếng đồng hồ ngồi gãi đầu, mãi mới nhớ ra.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
Đây là dòng báo lỗi của em nó.
Và nguyên nhân là do trong lớp connectDB thiếu 1 dòng.
Trước là như vầy:
Connection connection = null;
try {
connection = DriverManager.getConnection(“jdbc:postgresql://localhost:5432/caxxx”,”postgres”,”xxxxxx”);
} catch (Exception e) {}
return connection;
Và sửa lại như thế này để chạy bình thường:
Connection connection = null;
try {
Class.forName(“org.postgresql.Driver”);
connection = DriverManager.getConnection(“jdbc:postgresql://localhost:5432/caxxxx”,”postgres”,”xxxxxx”);
} catch (Exception e) {}
return connection;











thì ra là thiếu có mỗi dòng đó làm anh suy nghĩ ,kakakka