Can not create jms-queue in wildfly using jboss-cli - jboss

I started wildfly 24 server with standalone-full.xml profile, when i run following command in jboss-cli to create jms-queue i get following error
[standalone#localhost:9990 /] jms-queue --profile=full add --queue-address=foo --entries=["java:/jms/queue/foo"]
WFLYCTL0175: Resource [
("subsystem" => "messaging-activemq"),
("server" => "default")
] does not exist; a resource at address [
("subsystem" => "messaging-activemq"),
("server" => "default"),
("jms-queue" => "foo")
] cannot be created until all ancestor resources have been added
What am i missing here? Any reference docs to create the jms server, queues?
Update:
I tried to create the server using web console first
And it filed with the required capabilities are not available, any documentation refernece that indicates what are the required capabilities i need to added prior configuring JMS

Yes don't use the profile parameter which is used in domain mode.
jms-queue add --queue-address=foo --entries=["java:/jms/queue/foo"]
works properly.

The issue is i was using wildfly "WildFly Preview EE 9.1 Distribution" the correct verirsion is "Jakarta EE 8 Full & Web Distribution"

Related

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.
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.
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 look into this in detail check here.

How to add custom filter of undertow by using jboss.cli

Server : WindFly 15, Undertow 8
I've created a custom filter "MyFilter" by following the article http://www.mastertheboss.com/jboss-web/jbosswebserver/configuring-undertow-filters-on-wildfly. But i didn't find the way to use jboss.cli to add it in the configuration.
I've tried /subsystem=undertow/configuration=filter/filter=myFilter/:add(module=com.xxx.myfilter,class-name=com.xxx.MyFilter), and got the following error:
ERROR [org.jboss.as.cli.CommandContext] Failed to get the list of the operationproperties: "WFLYCTL0030: No resource definition is registered for address [
("subsystem" => "undertow"),
("configuration" => "filter"),
("filter" => "myFilter")
So whether we can only add filter by manually editing the configuration file?
you can add using the cli with the following command:
/subsystem=undertow/configuration=filter/custom-filter
The original answer can be found here.
This is related to the custom filter creation explained on the Guide Configuring The Web Server ~ Undertow - Chapter 17.6
/subsystem=undertow/configuration=filter/response-header=new-response-header:add(header-name=new-response-header,header-value="My Value")
Tip
The main tip is to use the Tab so then the auto complete comes to you.

Unable to configure postgreSQL datasource for Keycloak

I'm trying to configure a PostgresSQL datasource by following the
tutorial presented in the documentation:
http://www.keycloak.org/docs/1.9/server_installation_guide/topics/database.html
.
I'm doing the configuration for a standalone server by running
standalone.bat and by configuring everything in
keycloak-3.0.0.Final/standalone/configuration/standalone.xml .
I'm following the documentation step-by-step, but I get the following
error running standalone.bat every-time, and thus I'm unable to connect to the database.
15:33:11,684 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) WFLYCTL0013: Operation ("add"
) failed - address: ([
("subsystem" => "datasources"),
("data-source" => "KeycloakDS")
]) - failure description: {"WFLYCTL0180: Services with
missing/unavailable dependencies" => [
"org.wildfly.data-source.KeycloakDS is missing
[jboss.jdbc-driver.postgres-driver]",
"jboss.driver-demander.java:jboss/datasources/KeycloakDS is missing
[jboss.jdbc-driver.postgres-driver]"
]}
15:33:11,687 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) WFLYCTL0013: Operation ("add"
) failed - address: ([
("subsystem" => "datasources"),
("data-source" => "KeycloakDS")
]) - failure description: {"WFLYCTL0180: Services with
missing/unavailable dependencies" => [
"org.wildfly.data-source.KeycloakDS is missing
[jboss.jdbc-driver.postgres-driver]",
"jboss.driver-demander.java:jboss/datasources/KeycloakDS is missing
[jboss.jdbc-driver.postgres-driver]",
"org.wildfly.data-source.KeycloakDS is missing
[jboss.jdbc-driver.postgres-driver]"
I have tried different versions of JDBC drivers provided by:
https://jdbc.postgresql.org/, but to no avail, even by
using the version mentioned in the documentation.
At this point I am stuck since my configuration files look exactly like
in the documentation. What exactly could I be missing? Is the
documentation up to date?
you cant find the same question- http://lists.jboss.org/pipermail/keycloak-user/2017-March/010120.html,
but couldnt find any solution there,so re posting the same here.
I use jboss-cli.sh (or .bat if you're on Windows) to manage this for me. With Keycloak stopped and your PATH including $KEYCLOAK_HOME/bin I put the script below into a file (example: config_db.cli):
embed-server --server-config=standalone.xml --std-out=echo
batch
#
# remove the default provided datasource
#
/subsystem=datasources/data-source=KeycloakDS/:remove
#
# add it back using PostgreSQL
#
module add --name=org.postgres --resources=/path/to/your/postgresql-42.1.4.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
/subsystem=datasources/data-source=KeycloakDS/:add(connection-url=jdbc:postgresql://localhost:5432/db_name,driver-name=postgres,jndi-name=java:jboss/datasources/KeycloakDS,password=db_password,user-name=db_user)
run-batch
And run with bin/jboss-cli.sh --file=config_db.cli
Note that this assumes you've already created a PostgreSQL database user (db_user above) with a password (db_password) and a database owned by the db_user (db_name).
In this way I can create my datasources the same way on my local machine as I do on my servers.
CORRECTIONS MADE: The format for running the jboss-cl.sh is:
bin/jboss-cli.sh --file=filename

JBoss EAP 7.0.5 can not add https-listener

I am adding a new security realm and https-listener with CLI:
/core-service=management/security-realm=HTTPSRealm/:add
/core-service=management/security-realm=HTTPSRealm/server-identity=ssl:add(alias=ssl,keystore-path="/path/to/configuration/testCA.jks", keystore-password="12345678")
reload
/subsystem=undertow/server=default-server/https-listener=https:add(socket-binding="proxy-https", security-realm="HTTPSRealm")
At the last step I only get this:
{
"outcome" => "failed",
"failure-description" => undefined,
"rolled-back" => true
}
I already tried every solution I could find here. (running as batch etc)
Edit:
The listener config is added like this:
/socket-binding-group=standard-sockets/socket-binding=proxy-http:add(port=9080)
/socket-binding-group=standard-sockets/socket-binding=proxy-https:add(port=9443)
Have you created socket bindings for proxy-https ? The default binding is https. Try with it
/subsystem=undertow/server=default-server/https-listener=https:add(socket-binding=https, security-realm=HTTPSRealm)

Setup MariaDB XA on WildFly through UI

Similar to How to setup MariaDB JNDI on Wildfly 10? but specifically done through the Web UI.
I can create the non-XA data source with no issues but I am having issues creating the XA version.
I did the deployment of the mariadb-client.jar using the WildFly deploy UI with no issues. I can verify that the non-XA datasource works well.
However, when I do the same approach with the XA driver, when testing the connection I get the following error on the logs (not visible on the error dialog
Caused by: javax.resource.ResourceException: IJ031101: XADataSourceClass is undefined
at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:621))
When I try to configure the driver configuration manually I just get Unknown Error and the datasource does not even get created
"failure-description" => {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.MariaDBXA"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.PacXA is missing [jboss.jdbc-driver.MariaDBXA]",
"jboss.driver-demander.java:/PacXA is missing [jboss.jdbc-driver.MariaDBXA]"
]
The driver classes I am using are as noted in https://issues.jboss.org/browse/JBEAP-2405 where I put it in the screen that accepts them.
driver-class: org.mariadb.jdbc.Driver
xa-datasource-class: org.mariadb.jdbc.MariaDbDataSource (NOT org.mariadb.jdbc.MySQLDataSource)
Also when looking at the XML when selecting from JAR vs entering the configuration on screen, nothing gets populated on xa-datasource-class. I know I can edit the XML but like I said I wanted to do it through the administration console.
Refer https://issues.jboss.org/browse/JBEAP-2405 for sample configuration. Make sure you are providing correct driver name.