Using versioned third party libraries on Wildfly 10

Wildfly comes with the the best module management for managing classloading of your deployed application.

1. Create new folder structure for the new driver, $WILDFLY_HOME/modules/org/postresql/9.4

2. Create the corresponding module.xml as below.

3. Add a driver based on the new module

Note the module is specified as org.postgresql:9.4 to specify the specific slot/version we want to use. If not specified Wildfly will user the default slot/version, main.

4. Use the driver in your datasource by specifying the driver as postgresql94


Setting application/system properties for WildFly 10

You can set application/system properties on Wildfly 10 (it should be the same with previous version of Wildfly). In this particular case we will set the property for the folder that will be used by logback to save logs.

Below is the logback configuration.

We need to set the application variable application.logs.dir so that logback can use the correct folder. To achieve this we add the system-properties in the configuration file, in our case standalone.xml. This should be immediately after the extension tag.

Don’t forget to restart the application server for the changes to take effect.

Tagged with:  
© 2011 - Pass me the Mic