WildFly 18.0.1 JDBC Drivers : Internal error (newValue is null)
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.
- Download release:
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
- Copy the jar file to wildfly directory
sudo cp hal-console-3.2.4.Final-resources.jar /opt/wildfly/modules/system/layers/base/org/jboss/as/console/main/
- Edit the file module.xml
sudo vim /opt/wildfly/modules/system/layers/base/org/jboss/as/console/main/module.xml
- Change version in file module.xml
<resources>
<resource-root path="hal-console-3.2.4.Final-resources.jar"/>
</resources>
- Restart jboss/wildfly
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.