Project

General

Profile

Confusing problem debugging server in Eclipse

Jay Cothran
Added almost 2 years ago

I am building the stable branch (7.1.1-SNAPSHOT) of the server with Eclipse neon.3. The build goes fine except for 2 (apparently bogus) java problems in ConnectionManagerTest. I notice however that the JDBCRepositoryTest is skipped. All other jars except the server are from the tigase-server-7.1.0-b4379-dist-max.zip distribution. JDK is jdk1.8.0_121.

I can run the resulting jar from the command line with no problems. I can create new accounts, login and chat. When I attempt to start the server in the debugger, it is unable to find the (any) repository. ModulesManagerImpl.getInstance().getImplementations(cls) in DataRepository.getRepoClass(...) returns an empty set. It appears that RepositoryFactory.initialize(...) is not being called.

In the Debug Configuration...

    Program arguments:
        --property-file etc/init.properties

    VM arguments:
        -Djdbc.drivers=com.mysql.jdbc.Driver

init.properties:

--comp-class-1 = tigase.muc.MUCComponent
--virt-hosts = localhost,192.168.0.114
--user-db-uri = jdbc:derby:D:\\Tigase\\tigasedb
--user-db = derby
--admins = admin@localhost
--comp-name-4 = message-archive
--comp-name-3 = proxy
config-type = --gen-config-def
--comp-name-2 = pubsub
--comp-name-1 = muc
--cluster-mode = true
--sm-plugins = +message-archive-xep-0136
--debug = server
--comp-class-4 = tigase.archive.MessageArchiveComponent
--comp-class-3 = tigase.socks5.Socks5ProxyComponent
--comp-class-2 = tigase.pubsub.PubSubComponent

Console output:

componentInfo{Title=Tigase XML Tools, Version=3.5.0-b252/d7b28574, Class=tigase.xml.XMLUtils}
componentInfo{Title=Tigase Utils, Version=3.5.0-b326/97aff18b, Class=tigase.util.ClassUtil}
componentInfo{Class=tigase.server.XMPPServer}
2017-03-31 10:24:29.610 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Setting defaults: --property-file = etc/init.properties
2017-03-31 10:24:29.632 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Loading initial properties from property file: etc/init.properties
2017-03-31 10:24:29.632 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--cluster-mode=true)
2017-03-31 10:24:29.633 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (config-type=--gen-config-def)
2017-03-31 10:24:29.633 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--debug=server)
2017-03-31 10:24:29.633 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--user-db=derby)
2017-03-31 10:24:29.633 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--admins=admin@localhost)
2017-03-31 10:24:29.633 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--user-db-uri=jdbc:derby:D:\Tigase\tigasedb)
2017-03-31 10:24:29.634 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--virt-hosts=localhost,192.168.0.114)
2017-03-31 10:24:29.634 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-name-4=message-archive)
2017-03-31 10:24:29.634 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-class-4=tigase.archive.MessageArchiveComponent)
2017-03-31 10:24:29.634 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-name-3=proxy)
2017-03-31 10:24:29.634 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-class-3=tigase.socks5.Socks5ProxyComponent)
2017-03-31 10:24:29.635 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-name-2=pubsub)
2017-03-31 10:24:29.635 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-class-2=tigase.pubsub.PubSubComponent)
2017-03-31 10:24:29.635 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-class-1=tigase.muc.MUCComponent)
2017-03-31 10:24:29.635 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--comp-name-1=muc)
2017-03-31 10:24:29.635 [main]             ConfiguratorAbstract.parseArgs()   CONFIG:   Added default config parameter: (--sm-plugins=+message-archive-xep-0136)
2017-03-31 10:24:29.639 [main]             SimpleCache.<init>()               WARNING:  Tigase cache turned off.
2017-03-31 10:24:29.640 [main]             SimpleCache.<init>()               WARNING:  Tigase cache turned off.
2017-03-31 10:24:30.635 [main]             DNSResolverDefault.<init>()        WARNING:  Resolving default host name: xps8500 took: 995
2017-03-31 10:24:30.650 [main]             AbstractMessageReceiver.setMaxQueueSize()  FINEST: message-router maxQueueSize: 9,526, maxInQueueSize: 594, maxOutQueueSize: 19,052
2017-03-31 10:24:30.653 [main]             MessageRouter.addRegistrator()     INFO:     Adding registrator: Configurator
2017-03-31 10:24:30.653 [main]             MessageRouter.addComponent()       INFO:     Adding component: 
2017-03-31 10:24:30.654 [main]             ConfiguratorAbstract.componentAdded()  CONFIG:  component: basic-conf
2017-03-31 10:24:30.654 [main]             ConfiguratorAbstract.setup()       CONFIG:   Setting up component: basic-conf
2017-03-31 10:24:31.392 [main]             ConfiguratorAbstract.setup()       CONFIG:   Component basic-conf defaults: {component-id=basic-conf@xps8500, def-hostname=xps8500, admins=[Ljava.lang.String;@206a70ef, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=32, data-repo-pool-size=32, user-repo-class=derby, user-repo-url=jdbc:derby:D:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:D:\Tigase\tigasedb, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties}
2017-03-31 10:24:31.392 [main]             ConfiguratorAbstract.setup()       CONFIG:   Component basic-conf configuration: {component-id=basic-conf@xps8500, def-hostname=xps8500, admins=[Ljava.lang.String;@206a70ef, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=32, data-repo-pool-size=32, user-repo-class=derby, user-repo-url=jdbc:derby:D:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:D:\Tigase\tigasedb, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties}
2017-03-31 10:24:31.393 [main]             ConfiguratorAbstract.setProperties()  INFO:  Propeties size is 33, and here are all propeties: {component-id=basic-conf@xps8500, def-hostname=xps8500, admins=[Ljava.lang.String;@206a70ef, scripts-dir=scripts/admin, command/ALL=ADMIN, logging/.level=CONFIG, logging/handlers=java.util.logging.ConsoleHandler java.util.logging.FileHandler, logging/java.util.logging.ConsoleHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.ConsoleHandler.level=WARNING, logging/java.util.logging.FileHandler.append=true, logging/java.util.logging.FileHandler.count=5, logging/java.util.logging.FileHandler.formatter=tigase.util.LogFormatter, logging/java.util.logging.FileHandler.limit=10000000, logging/java.util.logging.FileHandler.pattern=logs/tigase.log, logging/tigase.useParentHandlers=true, logging/java.util.logging.FileHandler.level=ALL, logging/tigase.server.level=ALL, user-domain-repo-pool=tigase.db.UserRepositoryMDImpl, auth-domain-repo-pool=tigase.db.AuthRepositoryMDImpl, user-repo-pool-size=32, data-repo-pool-size=32, user-repo-class=derby, user-repo-url=jdbc:derby:D:\Tigase\tigasedb, auth-repo-class=tigase.db.jdbc.TigaseCustomAuth, auth-repo-url=jdbc:derby:D:\Tigase\tigasedb, ssl-container-class=tigase.io.jdk18.SNISSLContextContainer, ssl-certs-location=certs/, ssl-def-cert-domain=default, config-dump-file=etc/config-dump.properties, shared-user-repo=null, shared-user-repo-params=null, shared-auth-repo=null, shared-auth-repo-params=null}
2017-03-31 10:24:41.381 [main]             ConfiguratorAbstract.setProperties()  SEVERE: Can't initialize user default repository: 
tigase.db.DBInitException: Problem initializing jdbc connection: jdbc:derby:D:\Tigase\tigasedb
    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: Not found class supporting uri = jdbc:derby:D:\Tigase\tigasedb
    at tigase.db.RepositoryFactory.getRepoClass(RepositoryFactory.java:508)
    at tigase.db.RepositoryFactory.getRepoClassName(RepositoryFactory.java:535)
    at tigase.db.RepositoryFactory.getDataRepository(RepositoryFactory.java:420)
    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)

Since there is no repository nothing works after this and the server shutsdown. Any suggestions would be greatly appreciated.


Replies (4)

Added by Wojciech Kapcia TigaseTeam almost 2 years ago

Do you have all dependencies (including jdbc drivers) as your dependencies?

Added by Jay Cothran almost 2 years ago

Thanks for your reply. I am using the Derby DB. I have all the jars in the classpath and on the Java Build Path. What else do I need to do?

Added by Wojciech Kapcia TigaseTeam almost 2 years ago

Jay Cothran wrote:

I have all the jars in the classpath and on the Java Build Path. What else do I need to do?

What jars? Have you included Derby driver in your class-path? Following line:

Caused by: tigase.db.DBInitException: Not found class supporting uri

suggests that it's missing.

Added by Jay Cothran almost 2 years ago

There seems to be some problem with the paths. I was finally able to get the server to run in the debugger using some brute force on the location of the jars. At least I can move forward now and figure out the problem later. Thank you for your help on this!

    (1-4/4)