Project

General

Profile

Starting the server with eclipse.

Mohamad Nachabe
Added almost 2 years ago

Hi,

I have been getting the following exception when I try to run the server from eclipse.

Any help on this issue would be appreciated.

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:264)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:463)
    at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:590)
    at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:672)
    at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:888)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:817)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
2017-01-26 09:56:33.677 [main]             ConfiguratorAbstract.setProperties()  SEVERE: Can't initialize user default repository: 
tigase.db.DBInitException: Problem initializing jdbc connection: jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12
    at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:627)
    at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:672)
    at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:888)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:817)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
Caused by: tigase.db.DBInitException: Database initialization failed
    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:300)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:463)
    at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:590)
    at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:672)
    at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:888)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:817)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12
    at java.sql.DriverManager.getConnection(DriverManager.java:689)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    at tigase.db.jdbc.DataRepositoryImpl.initRepo(DataRepositoryImpl.java:440)
    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:294)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:463)
    at tigase.db.jdbc.JDBCRepository.initRepository(JDBCRepository.java:590)
    at tigase.db.RepositoryFactory.getUserRepository(RepositoryFactory.java:672)
    at tigase.conf.ConfiguratorAbstract.addUserRepo(ConfiguratorAbstract.java:888)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:817)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
2017-01-26 09:56:33.681 [main]             DataRepositoryImpl.initRepository()  SEVERE: null
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:264)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:463)
    at tigase.db.jdbc.TigaseCustomAuth.initRepository(TigaseCustomAuth.java:495)
    at tigase.db.RepositoryFactory.getAuthRepository(RepositoryFactory.java:387)
    at tigase.conf.ConfiguratorAbstract.addAuthRepo(ConfiguratorAbstract.java:857)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:834)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
2017-01-26 09:56:33.683 [main]             ConfiguratorAbstract.setProperties()  SEVERE: Can't initialize auth default repository: 
tigase.db.DBInitException: Problem initializing jdbc connection: jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12
    at tigase.db.jdbc.TigaseCustomAuth.initRepository(TigaseCustomAuth.java:583)
    at tigase.db.RepositoryFactory.getAuthRepository(RepositoryFactory.java:387)
    at tigase.conf.ConfiguratorAbstract.addAuthRepo(ConfiguratorAbstract.java:857)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:834)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
Caused by: tigase.db.DBInitException: Database initialization failed
    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:300)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:463)
    at tigase.db.jdbc.TigaseCustomAuth.initRepository(TigaseCustomAuth.java:495)
    at tigase.db.RepositoryFactory.getAuthRepository(RepositoryFactory.java:387)
    at tigase.conf.ConfiguratorAbstract.addAuthRepo(ConfiguratorAbstract.java:857)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:834)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12
    at java.sql.DriverManager.getConnection(DriverManager.java:689)
    at java.sql.DriverManager.getConnection(DriverManager.java:270)
    at tigase.db.jdbc.DataRepositoryImpl.initRepo(DataRepositoryImpl.java:440)
    at tigase.db.jdbc.DataRepositoryImpl.initRepository(DataRepositoryImpl.java:294)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:463)
    at tigase.db.jdbc.TigaseCustomAuth.initRepository(TigaseCustomAuth.java:495)
    at tigase.db.RepositoryFactory.getAuthRepository(RepositoryFactory.java:387)
    at tigase.conf.ConfiguratorAbstract.addAuthRepo(ConfiguratorAbstract.java:857)
    at tigase.conf.ConfiguratorAbstract.setProperties(ConfiguratorAbstract.java:834)
    at tigase.conf.ConfiguratorAbstract.setup(ConfiguratorAbstract.java:519)
    at tigase.conf.ConfiguratorAbstract.componentAdded(ConfiguratorAbstract.java:152)
    at tigase.conf.Configurator.componentAdded(Configurator.java:50)
    at tigase.conf.Configurator.componentAdded(Configurator.java:33)
    at tigase.server.AbstractComponentRegistrator.addComponent(AbstractComponentRegistrator.java:116)
    at tigase.server.MessageRouter.addRegistrator(MessageRouter.java:138)
    at tigase.server.MessageRouter.setConfig(MessageRouter.java:644)
    at tigase.server.XMPPServer.start(XMPPServer.java:142)
    at tigase.server.XMPPServer.main(XMPPServer.java:112)

Replies (2)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam almost 2 years ago

Hi,

This error usually means that there is no JDBC driver in your classpath. In this case class com.mysql.jdbc.Driver is not found and it is part of MySQL JDBC driver. Please verify that MySQL driver is in your classpath.

Added by Mohamad Nachabe almost 2 years ago

Thank you for your fast reply.

I'm now able to start the server with no exceptions or errors, thanks.

    (1-2/2)