emresahin
emresahin

Reputation: 53

WFLYCTL0362: Capabilities required by resource '/subsystem=microprofile-metrics-smallrye' are not available:

I am trying to migrate WildFly 21 to 24 . I have these errors in the console. Server can not running it is stopped.

14:11:19,550 ERROR [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0362: Capabilities required by resource '/subsystem=microprofile-health-smallrye' are not available:
org.wildfly.extension.health.http-context; There are no known registration points which can provide this capability.
org.wildfly.extension.health.server-probes; There are no known registration points which can provide this capability. 14:11:19,550 ERROR [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0362: Capabilities required by resource '/subsystem=microprofile-metrics-smallrye' are not available:
org.wildfly.extension.metrics.http-context; There are no known registration points which can provide this capability.

I have added metrics and health extensions to standalone xmls

 <extension module="org.wildfly.extension.microprofile.health-smallrye"/>
 <extension module="org.wildfly.extension.microprofile.metrics-smallrye"/>
 <subsystem xmlns="urn:wildfly:microprofile-health-smallrye:2.0" security-enabled="false" empty-liveness-checks-status="${env.MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS:UP}" empty-readiness-checks-status="${env.MP_HEALTH_EMPTY_READINESS_CHECKS_STATUS:UP}"/>   
 <subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:wildfly}"/>
 

but for main configuration file I am using a different xml. I saw in another questions using jboss.cli to add these extensions but jboss cli is not connecting because server can not running currently. Do you have any suggestions or advices ?

Thanks.

Upvotes: 1

Views: 2292

Answers (3)

CaioRSilva
CaioRSilva

Reputation: 11

Just giving a little more explanation to those who do not understand the standalone.xml file very well, just like me.

Since i am using the Standalone version, changes to the CLI would not make any differences to my case, but thanks to @emresahin answer i found out that i was missing two extensions to my standalone file.

If you have a look a the default new "standalone-microprofile.xml" in JBOSS 7.4 you shall see that those declarations are kinda schatered around the file, but they are required. So i added them to my standalone.xml

<extension module="org.wildfly.extension.health"/>
<extension module="org.wildfly.extension.metrics"/>

Also, the subsystems must be declared

<subsystem xmlns="urn:wildfly:health:1.0" security-enabled="false"/>
<subsystem xmlns="urn:wildfly:metrics:1.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:jboss}"/>

If you need to create an example of a file with MicroProfile subsystems, you can read the content 3.8.2 in the following link

3.8.2. Updating standalone configurations with MicroProfile subsystems and extensions

Upvotes: 1

emresahin
emresahin

Reputation: 53

I found out microprofile.health-smallrye and microprofile.metrics-smallrye are not supported in WildFly 24. You should use subsystem=metrics,subsystem=health. If you want to look into this in detail, check here.

Upvotes: 2

James R. Perkins
James R. Perkins

Reputation: 17790

You can still use CLI in "offline" mode to add the extension. First simply enter a CLI session with:

$JBOSS_HOME/bin/jboss-cli.sh

Then you can start the embedded server to make your changes.

embed-server

You should end up seeing something like this:

[disconnected /] embed-server 
[standalone@embedded /]

From here you can enter CLI commands like:

/extension=org.wildfly.extension.microprofile.health-smallrye:add
/extension=org.wildfly.extension.microprofile.metrics-smallrye:add
/subsystem=microprofile-health-smallrye:add(security-enabled=false, empty-liveness-checks-status="${env.MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS:UP}", empty-readiness-checks-status="${env.MP_HEALTH_EMPTY_READINESS_CHECKS_STATUS:UP}")

The output should look something like:

[standalone@embedded /] /extension=org.wildfly.extension.microprofile.health-smallrye:add
{"outcome" => "success"}

[standalone@embedded /] /extension=org.wildfly.extension.microprofile.metrics-smallrye:add
{"outcome" => "success"}

[standalone@embedded /] /subsystem=microprofile-health-smallrye:add(security-enabled=false, empty-liveness-checks-status="${env.MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS:UP}", empty-readiness-checks-status="${env.MP_HEALTH_EMPTY_READINESS_CHECKS_STATUS:UP}")
{"outcome" => "success"}

Then you can just exit CLI.

Upvotes: 1

Related Questions