Reputation: 2830
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.
Upvotes: 0
Views: 337
Reputation: 401975
Please make sure all the required jars are also included in the Artifact configuration that you are deploying on the application server.
Upvotes: 1