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
UPDATE
SOLVED: We need to add library in Artifact.
解决方案
Please make sure all the required jars are also included in the Artifact configuration that you are deploying on the application server.