Closed silbo closed 6 years ago
ClassNotFoundException: com.mysql.jdbc.Driver
Looks like you do not have a MySQL JDBC driver on the class-path. Please note that the MySQL JDBC driver is not part of the distribution because of its license.
You can fix this for instance by downloading the mysql-connector-java-5.1.36.jar and placing it to the same folder as the timetable.jar.
Thanks for the quick response I managed to solve the problem, would be nice to mention this in the solver documentation, which version of mysql is needed or I was missing the something, may be there was a link already there ?
Thank you for the feedback, the Timetabling Installation help page has been updated to include instructions how to get the JDBC driver and what to do when a different version of the driver is used.
$ java -jar timetable.jar [05/12/18 15:22:30] INFO org.unitime.timetable.ApplicationProperties.load -> Reading file:/Users/admin/Desktop/unitime-4.3_bld103/solver/timetable.jar!/application.properties ... [05/12/18 15:22:30] INFO root -> ----------------------------------------------------------------------- [05/12/18 15:22:30] INFO root -> UniTime Log File [05/12/18 15:22:30] INFO root -> [05/12/18 15:22:30] INFO root -> Created: Sat May 12 15:22:30 EEST 2018 [05/12/18 15:22:30] INFO root -> [05/12/18 15:22:30] INFO root -> System info: [05/12/18 15:22:30] INFO root -> System: Mac OS X 10.13.4 x86_64 [05/12/18 15:22:30] INFO root -> CPU: endian:little encoding:UnicodeBig [05/12/18 15:22:30] INFO root -> Java: Oracle Corporation, Java(TM) SE Runtime Environment 10+46 [05/12/18 15:22:30] INFO root -> User: admin [05/12/18 15:22:30] INFO root -> Timezone: Europe/Tallinn [05/12/18 15:22:30] INFO root -> Working dir: /Users/admin/Desktop/unitime-4.3_bld103/solver [05/12/18 15:22:30] INFO root -> Classpath: timetable.jar [05/12/18 15:22:30] INFO root -> Memory: 1024 MB [05/12/18 15:22:30] INFO root -> Cores: 8 [05/12/18 15:22:30] INFO root -> [05/12/18 15:22:30] INFO HibernateUtil -> Connecting to null [05/12/18 15:22:30] INFO Version -> HCANN000001: Hibernate Commons Annotations {4.0.5.Final} [05/12/18 15:22:30] INFO Version -> HHH000412: Hibernate Core {4.3.11.Final} WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.dom4j.io.SAXContentHandler (file:/Users/admin/Desktop/unitime-4.3_bld103/solver/dom4j-1.6.1.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding() WARNING: Please consider reporting this to the maintainers of org.dom4j.io.SAXContentHandler WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [05/12/18 15:22:31] INFO ConnectionProviderInitiator -> HHH000130: Instantiating explicit connection provider: org.unitime.commons.hibernate.connection.LoggingDBCPConnectionProvider [05/12/18 15:22:31] FATAL DBCPConnectionProvider -> Could not create a DBCP pool org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.unitime.commons.hibernate.connection.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:159) at org.unitime.commons.hibernate.connection.LoggingDBCPConnectionProvider.configure(LoggingDBCPConnectionProvider.java:69) at org.unitime.commons.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:210) at org.unitime.commons.hibernate.connection.LoggingDBCPConnectionProvider.getConnection(LoggingDBCPConnectionProvider.java:48) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:279) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:124) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930) at org.unitime.commons.hibernate.util.HibernateUtil.configureHibernate(HibernateUtil.java:260) at org.unitime.timetable.solver.jgroups.SolverServerImplementation.main(SolverServerImplementation.java:563) Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420) ... 16 more [05/12/18 15:22:31] ERROR SolverServerImplementation -> Failed to start the server: Could not create a DBCP pool org.hibernate.HibernateException: Could not create a DBCP pool at org.unitime.commons.hibernate.connection.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:177) at org.unitime.commons.hibernate.connection.LoggingDBCPConnectionProvider.configure(LoggingDBCPConnectionProvider.java:69) at org.unitime.commons.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:210) at org.unitime.commons.hibernate.connection.LoggingDBCPConnectionProvider.getConnection(LoggingDBCPConnectionProvider.java:48) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:279) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:124) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1930) at org.unitime.commons.hibernate.util.HibernateUtil.configureHibernate(HibernateUtil.java:260) at org.unitime.timetable.solver.jgroups.SolverServerImplementation.main(SolverServerImplementation.java:563) Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.unitime.commons.hibernate.connection.DBCPConnectionProvider.configure(DBCPConnectionProvider.java:159) ... 13 more Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1420) ... 16 more