Projects tigase _server server-core Issues #750
Lots of exceptions and errors while starting the server (#750)
Closed
Artur Hefczyc opened 8 years ago
Due Date
2017-03-30

I am following the installation guide: http://docs.tigase.org/tigase-server/snapshot/User_Guide/html/#webinstall

When started the server using command:

scripts/tigase.sh start

I am getting lots of NPE and other exceptions in attached log file which look like this:

 Caused by: java.lang.NoSuchMethodException: tigase.db.UserRepository.<init>()
         at java.lang.Class.getConstructor0(Class.java:3082)
         at java.lang.Class.newInstance(Class.java:412)
         at tigase.kernel.core.Kernel.createNewInstance(Kernel.java:178)
         at tigase.kernel.core.Kernel.initBean(Kernel.java:105)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:551)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:725)
         at tigase.kernel.core.Kernel$DelayedDependenciesInjection.inject(Kernel.java:1286)
         at tigase.kernel.core.Kernel.finishDependecyDelayedInjection(Kernel.java:963)
         at tigase.db.beans.MDPoolConfigBean.beanConfigurationChanged(MDPoolConfigBean.java:115)
         at tigase.db.beans.AuthUserRepositoryConfigBean.beanConfigurationChanged(AuthUserRepositoryConfigBean.java:84)
         at tigase.db.beans.MDPoolConfigBean.initialize(MDPoolConfigBean.java:140)
         at tigase.db.beans.AuthUserRepositoryConfigBean.initialize(AuthUserRepositoryConfigBean.java:106)
         at tigase.kernel.core.Kernel.initBean(Kernel.java:148)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:551)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:725)
         at tigase.kernel.core.Kernel$DelayedDependenciesInjection.inject(Kernel.java:1286)
         at tigase.kernel.core.Kernel.finishDependecyDelayedInjection(Kernel.java:963)
         at tigase.kernel.core.Kernel.initBean(Kernel.java:139)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:551)
         at tigase.kernel.core.Kernel.initBean(Kernel.java:143)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:551)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:725)
         at tigase.kernel.core.Kernel$DelayedDependenciesInjection.inject(Kernel.java:1286)
         at tigase.kernel.core.Kernel.finishDependecyDelayedInjection(Kernel.java:963)
         at tigase.kernel.core.Kernel.initBean(Kernel.java:139)
         at tigase.kernel.core.Kernel.injectDependencies(Kernel.java:551)
         at tigase.kernel.core.Kernel.initBean(Kernel.java:143)
         at tigase.kernel.core.Kernel.getInstance(Kernel.java:371)
         at tigase.server.Bootstrap.start(Bootstrap.java:108)
         at tigase.server.XMPPServer.start(XMPPServer.java:136)
         at tigase.server.XMPPServer.main(XMPPServer.java:117)

It looks to me like there is some kind of binary generation problem which causes to combine incompatible source code into distribution package.

tigase-console.log tigase.log.0

wojciech.kapcia@tigase.net commented 8 years ago

Artur Hefczyc wrote:

I am following the installation guide: http://docs.tigase.org/tigase-server/snapshot/User_Guide/html/#webinstall

When started the server using command:

[...]

I am getting lots of NPE and other exceptions in attached log file which look like this:

[...]

It looks to me like there is some kind of binary generation problem which causes to combine incompatible source code into distribution package.

%kobit

Not exactly. I've verified and all dependencies use correct versions, in addition we are always doing a clean build from the HEAD to avoid possible problems with caching and some such.

As web installer works more-or-less without proper configuration it generates a lot of exceptions and errors (there probably should be an additional config-type=setup which would skip initialization of majority of components/database) and it was happening in 7.1.0 as well:

2017-02-01 12:38:17.080 [main]             ConfiguratorAbstract.setProperties()  SEVERE: Can't initialize user default repository:
tigase.db.DBInitException: Problem initializing jdbc connection: jdbc:derby:tigase-derbydb;create=true
        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: java.sql.SQLSyntaxErrorException: 'TIGGETDBPROPERTY' is not recognized as a function or procedure.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
        at tigase.db.jdbc.JDBCRepository.checkDBSchema(JDBCRepository.java:1060)
…

Now:

  • default, empty config in 7.2.0 haven't been updated to DSL format:
wojtek@atlantiscity.local ~/dev/tmps/tigase-server-dists/tigase-issue #7.2.0-SNAPSHOT-b4638 $ cat etc/init.properties
config-type=--gen-config-def
--admins=admin@$HOST_NAME
--virt-hosts = $HOST_NAME
--debug=server

--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver

http/setup/admin-credentials=admin:tigase
  • with the upgraded config there are still exceptions regarding repository which is to be expected (vide above comment);

  • ignoring the exception and taking tigase to semi-working state we run into:

2017-02-01 14:02:44.677 [main]             AbstractBeanConfigurator.configure()  WARNING: Can't prepare value of property 'admin-credentials' of bean 'setup': 'admin:tigase'
tigase.kernel.KernelException: Unknown bean 'setup#KERNEL'.

I'm continuing working in the issue.

wojciech.kapcia@tigase.net commented 8 years ago

I've made a couple of fixes but it's still far from working:

  • updated the default config;

  • fixed classloader in utils (it was ignoring tigase.db.xml.XMLRepository because it checks for blacklisted packages and it have ".xml." as ignored package - I've whitelisted all "tigase." classes)

  • make initial adjustments of tigase.db.xml.XMLRepository for new dataRepository

I'll continue tomorrow.

Artur Hefczyc commented 8 years ago

A few comments.

  1. My conclusion about binary/version problem was based on the: java.lang.NoSuchMethodException which is usually related to incompatible APIs usage. Other exceptions: NPE and repository initialization related are expected and I understand them.

  2. config-type=setup sounds like a good idea

  3. I am not sure if using XMLRepository is a good idea. It has not been updated and used for quite some time. I even thought it has been removed from our code already. It seems to me that using DummyRepository instead is a better idea. But if you have already made XMLRepository working, than that's OK.

wojciech.kapcia@tigase.net commented 8 years ago

Artur Hefczyc wrote:

A few comments.

My conclusion about binary/version problem was based on the: java.lang.NoSuchMethodException which is usually related to incompatible APIs usage. Other exceptions: NPE and repository initialization related are expected and I understand them.

This was a result of lack of configuration update and the defaults handling logic not being updated as well.

config-type=setup sounds like a good idea

Added #4880

I am not sure if using XMLRepository is a good idea. It has not been updated and used for quite some time. I even thought it has been removed from our code already. It seems to me that using DummyRepository instead is a better idea. But if you have already made XMLRepository working, than that's OK.

I've updated XMLRepository about a year ago for the purpose of using in in the unit tests and it's quite handy for that purpose and used in many tests. What is lacking it's adjusting it to the new DataSource introduced in 7.2.0.

Andrzej was very opposed to using DummyRepository (which isn't adjusted to 7.2.0 as well)

wojciech.kapcia@tigase.net commented 8 years ago

I've managed to get the server to the runnable state with the default configuration; there is still work remaining to adjust components to Kernel but those will be carried out in separate tasks. Setup module will be fixed in #4896.

Artur Hefczyc commented 8 years ago

I will look at it ASAP. Actually, when the web installer is working.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
4876
Version
tigase-server-8.0.0
Spent time
60h
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#750
Please wait...
Page is in error, reload to recover