duplicate resource when using YAML

31 views
Skip to first unread message

cowiie

unread,
Oct 23, 2024, 6:39:39 AM10/23/24
to WildFly
In Wildfly 33 i have this AMQ in Standalone.xml like this:
                <subsystem xmlns="urn:jboss:domain:messaging-activemq:16.0">
            <server name="default">
                <security elytron-domain="ApplicationDomain"/>
                <statistics enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
                <security-setting name="#">
                    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
                </security-setting>
                <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
                <in-vm-connector name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-connector>
                <in-vm-acceptor name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-acceptor>
                <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
                <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
                <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
            </server>

I wanted to extend this during boot with a configuration yaml like this:
  subsystem:
    messaging-activemq:
      server:
        default:
          path:
            journal-directory:
              path: "/myAbsolute/path/activemq/journal"
              relative-to: !undefine
            large-messages-directory:
              path: "/myAbsolute/path/activemq/largemessages"
            paging-directory:
              path: "/myAbsolute/path/activemq/paging"
            bindings-directory:
              path: "/myAbsolute/path/activemq/bindings" 

I tried like everything but only got errors. This one in particular:
12:19:35,654 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'default-entity-bean-optimistic-locking' in the resource at address '/' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
12:19:35,659 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "messaging-activemq"),
("server" => "default"),
("path" => "journal-directory")
]) - failure description: "WFLYCTL0212: Duplicate resource [
(\"subsystem\" => \"messaging-activemq\"),
(\"server\" => \"default\"),
(\"path\" => \"journal-directory\")
]"
12:19:35,682 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details. - Server configuration file in use: standalone.xml - Minimum feature stability level: community
12:19:35,753 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: WildFly 33.0.1.Final (WildFly Core 25.0.1.Final) stopped in 33ms
Drücken Sie eine beliebige Taste . . .

Untill i added the the directory elements to the standalone.xml.
        <subsystem xmlns="urn:jboss:domain:messaging-activemq:16.0">
            <server name="default">
                <security elytron-domain="ApplicationDomain"/>
                <statistics enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
<journal-directory path="/custom/path/activemq/journal" />
<large-messages-directory path="/custom/path/activemq/largemessages" />
<paging-directory path="/custom/path/activemq/paging" />
<bindings-directory path="/custom/path/activemq/bindings" />

After adding this to the standalone.xml i can now overwrite any of the paths at will through YAML without getting any errors.

I do not understand why defining it twice actually solves a "Duplicate resource " error...
Well i can guess that after the YAML was excuted a default rutine tries to add it again... but is that realy what happens? 

Emmanuel Hugonnet

unread,
Oct 23, 2024, 8:34:49 AM10/23/24
to wil...@googlegroups.com
It looks like those paths are handled in a very special way being created under the hood when not defined when a server is added thus the
YAML extension don't know about this and it tries to add the resources instead of updating them.
That's why it 'works' if those paths are defined because then they are added explicitly.

Emmanuel

Emmanuel Hugonnet

unread,
Oct 23, 2024, 8:35:23 AM10/23/24
to wil...@googlegroups.com
It looks like those paths are handled in a very special way being created under the hood when not defined when a server is added thus the
YAML extension don't know about this and it tries to add the resources instead of updating them.
That's why it 'works' if those paths are defined because then they are added explicitly.
I've created https://issues.redhat.com/browse/WFLY-19877 to track that.

Emmanuel



Le 23/10/2024 à 12:29, 'cowiie' via WildFly a écrit :
Reply all
Reply to author
Forward
0 new messages