Project

General

Profile

Bug #7433

Can't set SeeOtherHost phase

Added by Wojciech Kapcia TigaseTeam 10 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Database:
n/a
Applicable version:
git/master
Source Code Disclaimer:

Description

using:

    seeOtherHost (active: true, class: tigase.server.xmppclient.SeeOtherHostDualIP) {
        active = [
            OPEN
        ]
    }

Causes enigmatic:

  =============================================================================
  ERROR! Terminating the server process.
  Problem initializing the server: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Boolean
  Please fix the problem and start the server again.
  =============================================================================


Related issues

Related to Tigase MUC - Bug #7440: tigase-muc - Build # 2424 - Failure!Closed

Associated revisions

Revision 103d80a7 (diff)
Added by Wojciech Kapcia TigaseTeam 10 months ago

#7433 fix issue with configuring see-other-host active phases

Revision da06c1e6 (diff)
Added by Andrzej Wójcik IoT 1 CloudTigaseTeam 10 months ago

#7433: removed PropertiesBeanConfigurator and automatic bean definition creation based on map with active or class property

History

#1 Updated by Wojciech Kapcia TigaseTeam 10 months ago

  • Status changed from New to In QA

I added simplified stacktrace to the error message to make it easier to debug (this and other issues):

  =============================================================================
  ERROR! Terminating the server process.
  Problem initializing the server:
RootCause:
   -> java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Boolean
      [tigase.conf.ConfigReader.process(ConfigReader.java:304)]
  Please fix the problem and start the server again.
  =============================================================================

The issue itself boiled down to using 'active' configuration name and following code:

// special use case to convert maps with active or class into bean definition
if (val != null && (val.containsKey("active") || val.containsKey("class"))) {
    AbstractBeanConfigurator.BeanDefinition bean = new AbstractBeanConfigurator.BeanDefinition();
    bean.setBeanName(holder.key);
    Object v = val.remove("class");
    if (v != null) {
        bean.setClazzName((String) v);
    }
    v = val.remove("active");
    if (v != null) {
        bean.setActive((Boolean) v);
    }
    bean.putAll(val);
    holder.value = bean;

I would imagine (as per comment) to use it in something like:

{
  active: true,
  class: some.bean.class,
  config_key: config_value
}

however… %andrzej.wojcik - do we support or need such configuration? Maybe we could remove this block for the sake of simplicity?

As for the issue at hand, as kind of workaround - I added alias phases to the configuration property (and also clarified documentation how to configure it).

#2 Updated by Wojciech Kapcia TigaseTeam 10 months ago

  • Project changed from Servers to Tigase XMPP Server
  • Applicable version set to git/master
  • Source Code Disclaimer set to No
  • Database n/a added

#4 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam 10 months ago

We needed this features with active and class when we were using PropertiesBeanConfigurator which was able to load properties file and apply this configuration to beans.
However, later on, we decided to drop support for properties at all and to use only DSL, so now we still have PropertiesBeanConfigurator but it is not used anywhere if I'm correct.

In this case we could get rid of this feature but would need to remove PropertiesBeanConfigurator as well.

%bmalkow What do you think? Are you in favor of removal of PropertiesBeanConfigurator? or are you against?

#5 Avatar?id=6098&size=24x24 Updated by Bartosz Małkowski TigaseTeam 10 months ago

We can remove it. I cannot see ano pros to keep it.

#6 Updated by Wojciech Kapcia TigaseTeam 10 months ago

  • Assignee changed from Wojciech Kapcia to Andrzej Wójcik

Andrzej, could you remove relevant parts?

#7 Updated by Andrzej Wójcik IoT 1 CloudTigaseTeam 10 months ago

  • Assignee changed from Andrzej Wójcik to Wojciech Kapcia

Done.

#8 Updated by Wojciech Kapcia TigaseTeam 10 months ago

  • Status changed from In QA to Closed
  • % Done changed from 0 to 100

#10 Updated by Wojciech Kapcia TigaseTeam 10 months ago

  • Related to Bug #7440: tigase-muc - Build # 2424 - Failure! added

Also available in: Atom PDF