[jboss-jira] [JBoss JIRA] (WFLY-5873) Can't set static-connectors on AMQ bridge, if discovery-group were set before

Tomas Hofman (JIRA) issues at jboss.org
Fri Dec 18 06:15:00 EST 2015


Tomas Hofman created WFLY-5873:
----------------------------------

             Summary: Can't set static-connectors on AMQ bridge, if discovery-group were set before
                 Key: WFLY-5873
                 URL: https://issues.jboss.org/browse/WFLY-5873
             Project: WildFly
          Issue Type: Bug
          Components: JMS
    Affects Versions: 10.0.0.CR4
            Reporter: Tomas Hofman
            Assignee: Tomas Hofman


When AMQ bridge is created with static-connectors field set, and then static-connectors are undefined and discovery-group is set (in a single batch), following error is thrown:

"WFLYMSGAMQ0069: Attribute (static-connectors) can not been undefined as the resource does not define any alternative to this attribute."

Problem seems to be missing {{STATIC_CONNECTORS.setAlternatives(CommonAttributes.DISCOVERY_GROUP)}} in resource definition, which is causing {{!attr.hasAlternative(resource.getModel())}} check to fail in following code:

{code:title=AlternativeAttributeCheckHandler.java}
    private void checkAlternativeAttribute(OperationContext context, String attributeName, boolean alternativeMustBeSet) throws OperationFailedException {
        if (attributeDefinitions.containsKey(attributeName)) {
            AttributeDefinition attr = attributeDefinitions.get(attributeName);
            final Resource resource = context.readResource(EMPTY_ADDRESS);
            if (alternativeMustBeSet) {
                if (!attr.hasAlternative(resource.getModel())) {
                    throw new OperationFailedException(MessagingLogger.ROOT_LOGGER.undefineAttributeWithoutAlternative(attributeName));
                }
            } else {
                if (attr.hasAlternative(resource.getModel())) {
                    throw new OperationFailedException(MessagingLogger.ROOT_LOGGER.altAttributeAlreadyDefined(attributeName));
                }
            }
        }
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list