I have a problem configuring JDBC drivers in WildFly (18.0.1).
Whenever I open (Configuration/Subsystems/DataSources & Drivers/JDBC Drivers),
I get:
Internal error (Details: newValue is null).
Error Image 1:
Error Image 2:
Any help would be very much appreciated!
This is not a wildfly/jboss problem. The bug is in Hal Management console (version 3.2.1). I fix this error, changing HAL console version to 3.2.4.
wget https://repository.jboss.org/nexus/content/repositories/ea/org/jboss/hal/hal-console/3.2.4.Final/hal-console-3.2.4.Final-resources.jar
sudo cp hal-console-3.2.4.Final-resources.jar /opt/wildfly/modules/system/layers/base/org/jboss/as/console/main/
sudo vim /opt/wildfly/modules/system/layers/base/org/jboss/as/console/main/module.xml
<resources>
<resource-root path="hal-console-3.2.4.Final-resources.jar"/>
</resources>
sudo systemctl restart wildfly or sudo service wildfly restart
I can reproduce your problem completely. I've not used the Wildfly console in quite some time but this looks like a bug to me. However, there is another way that has the advantage of being easily repeatable and scriptable.
If you run jboss-cli
from the Wildfly bin directory you can add a JDBC driver and JEE datasource with a script. My script looks like:
embed-server --server-config=standalone.xml --std-out=echo
batch
module add --name=org.postgres --resources=${user.home}/Downloads/postgresql-42.2.8.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=myDS/:add(connection-url=jdbc:postgresql://localhost:5432/dbname,driver-name=postgres,jndi-name=java:/jdbc/myDS,background-validation=true,background-validation-millis=60000,blocking-timeout-wait-millis=2000,flush-strategy=Gracefully,idle-timeout-minutes=5,initial-pool-size=4,max-pool-size=64,min-pool-size=4,password=the-password,query-timeout=10,track-statements=true,tracking=true,user-name=the-user,validate-on-match=false)
run-batch
This script should be run without the server running. If you'd like to run it while the server is running then remove the embed-server
, batch
, and run-batch
lines. Basically this starts by creating a module which in this case is a PostgreSQL driver. It then adds a JDBC driver and lastly a DataSource. It can be run with:
jboss-cli.sh --file=the-file-name.cli
assuming that you saved the above to a file named the-file-name.cli
. Again, the bin
directory for Wildfly needs to be on your path to run this on the command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With