0

I'm getting a LogConfigurationException when trying to load the configuration of my application. It's an EAR Java application, deployed in a Wildfly 17 application server locally.

I'm using commons-configuration, so I've deployed it as a dependency in my jboss-deployment-structure.xml file:

<dependencies>
    ...
    <module name="org.apache.commons.commons-configuration2" slot="2.5" export="true" />

The module.xml file for commons-configurations2 is as follows:

<module xmlns="urn:jboss:module:1.1" name="org.apache.commons.commons-configuration2" slot="2.5">
  <resources>
    <resource-root path="commons-configuration2-2.5.jar"/>
  </resources>
  <dependencies>
    <module name="org.apache.commons.commons-lang3" slot="3.9" />
    <module name="org.apache.commons.commons-text" slot="1.6" />
    <module name="commons-logging.commons-logging" slot="1.2" />
    <module name="javax.servlet.servlet-api" slot="2.4" />
  </dependencies> 
</module>

Each of those dependencies have their own modules, with the same dependencies as their pom file.

Server starts without errors, but when I try to read my configuration file, I get this error:

Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
    at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:804)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
    at org.apache.commons.beanutils.PropertyUtilsBean.<init>(PropertyUtilsBean.java:123)
    at org.apache.commons.configuration2.beanutils.BeanHelper.initBeanUtilsBean(BeanHelper.java:625)
    at org.apache.commons.configuration2.beanutils.BeanHelper.<clinit>(BeanHelper.java:88)

commons-configuration2's module has a dependence with commons-logging version 1.2, which contains the Log4JLoggerclass that seems to be missing.

I believe there is some kind of collision between this module and Wildfly's own logging configuration. However, I've tried adding/removing any commons-logging dependency in both my jboss-deployment-structure.xmland in commons-configuration2 module, but I always get the same error.

Any clue on the problem, or anything I could try to get some more information?

Thanks and best regards.

Faliorn
  • 1,351
  • 3
  • 12
  • 24
  • Can you provide your `module.xml` file? WIldFly uses a custom `org.apache.commons.logging` [implementation](https://github.com/jboss-logging/commons-logging-jboss-logging). – James R. Perkins Aug 13 '19 at 17:00
  • I'm adding the commons-configuration2 module.xml to the question. I made it based on the pom file. I tried to comment the commons-logging part from it, but that also didn't work. – Faliorn Aug 14 '19 at 07:05

1 Answers1

0

In the end, the problem was a logging.properties file inside a dependency jar file I had in my project.

I managed to find it by activating Commons Logging Diagnostics. There I found that internal file was being read and used to configure logging. After deleting the file from the JAR, everything worked fine.

Faliorn
  • 1,351
  • 3
  • 12
  • 24