The same project servlet application does not work, but "hello world" method, in the same project, yes. Here the picture ofproject.
Versions:
Intellij IDEA - 2018.2
mySQL driver version: 8.0.11 , driver com.mysql.cj.jdbc.Driver
servlet 9.0.81
In Code:
Class.forName(dbDriver).newInstance();
dbConnection = DriverManager.getConnection(connectionUrl, userName, password);
Exception:
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver ...
BTW:
The same exception I receive also without mysql dependency in PON.xml
So, this is issue or I missing something. Thanks
SOLVED: We need to add library in Artifact .
请确保在应用程序服务器上部署的Artifact配置中还包含所有必需的jar。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.