Setup MariaDB XA on WildFly through UI - wildfly

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.

Related

How to solve Wildfly server console issue?

wildfly server start successfully. then I go to console and click on runtime and getting error.
Unable to load required resources for column 'standalone-server-column': "WFLYCTL0030: No resource definition is registered for address [
(\"subsystem\" => \"core-management\"),
(\"service\" => \"configuration-changes\")
]"
how to solve this????
Please help me out....advance thanks.

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

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"

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 shows error with datasource on startup

On starting jboss I am getting the following error :
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
State: NOTYETINSTALLED
Depends On Me:
jboss.ejb:service=EJBTimerService,persistencePolicy=database
jboss:service=KeyGeneratorFactory,type=HiLo
jboss.mq:service=StateManager
jboss.mq:service=PersistenceManager
And for all database connections in the servlet I get the following exception :
org.postgresql.util.PSQLException: FATAL: password a
uthentication failed for user "poll"
It was working fine and all of a sudden I started getting these errors. My password is correct. I even tried changing the password and then tried again it showed the same exception. What is happening here?
The DefaultDS data source is what the name suggests; the default datasource. It ships with JBoss and is configured to use the Hypersonic (ie in-memory) database. JBoss uses the DefaultDS datasource to read/write internal queues, timed events, etc
Check the file ../conf/standardjbosscmp-jdbc.xml to see what you've got configured for the DefaultDS datasource. It sounds like you've edited that file unintentionally. Unless you need to persist internal queues etc across boots, just leave it as shipped using Hypersonic.
See the JBoss doc for more.