Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WildFly 18.0.1 JDBC Drivers : Internal error (newValue is null)

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!

like image 352
ayou392 Avatar asked Nov 27 '19 18:11

ayou392


2 Answers

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.

  1. 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
  1. 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/
  1. Edit the file module.xml
sudo vim /opt/wildfly/modules/system/layers/base/org/jboss/as/console/main/module.xml
  1. Change version in file module.xml
   <resources>
        <resource-root path="hal-console-3.2.4.Final-resources.jar"/>
    </resources>
  1. Restart jboss/wildfly
sudo systemctl restart wildfly or sudo service wildfly restart
like image 67
Daniel Xavier Oliveira Avatar answered Sep 19 '22 16:09

Daniel Xavier Oliveira


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.

like image 33
stdunbar Avatar answered Sep 19 '22 16:09

stdunbar