Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda asked on

java.lang.NoClassDefFoundError: com/mysql/jdbc/Driver

I am getting this error

java.lang.NoClassDefFoundError: com/mysql/jdbc/Driver
at line
  DriverManager.registerDriver(new com.mysql.jdbc.Driver());

Help
JavaJava EE

Avatar of undefined
Last Comment
Anthony Matovu

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ryan Chong

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Anthony Matovu

Thank you

I have added MySQL-connector-java-8.0.20.jar to win_inf/lib and the message changed to

I understand the server is running version MySQL 5.7.30 but this is 8.0.20  could this also be a cause of the problem.

Again I hailed to get where I can download MySQL 5.7.30  jar file

Anthony



  ed

java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext    java.base/java.lang.Class.forName0(Native Method)    java.base/java.lang.Class.forName(Class.java:315)    java.base/java.security.Provider$Service.getImplClass(Provider.java:1848)    java.base/java.security.Provider$Service.newInstance(Provider.java:1824)    java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)    java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)    java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:168)    com.mysql.cj.protocol.ExportControlled.getSSLContext(ExportControlled.java:585)    com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:321)    com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:188)    com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99)    com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:325)    com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:164)    com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1342)    com.mysql.cj.NativeSession.connect(NativeSession.java:157)    com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956)    com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)    com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)    com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)    com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)    java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677)    java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)    com.dat_ran.logincls$global.connecttodb(logincls.java:81)    com.dat_ran.logincls.doPost(logincls.java:43)    javax.servlet.http.HttpServlet.service(HttpServlet.java:660)    javax.servlet.http.HttpServlet.service(HttpServlet.java:741)    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

Open in new window


Your help has saved me hundreds of hours of internet surfing.
fblack61