Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-4373

org.jboss.log4j.logmanager module requires java.sql module

    Details

    • Workaround Description:
      Hide

      Modify the logmanager module.xml and add a dependency on java.sql , this would have to be overridden any time you apply a patch and the modification reapplied.

      Show
      Modify the logmanager module.xml and add a dependency on java.sql , this would have to be overridden any time you apply a patch and the modification reapplied.

      Description

      org.jboss.logmanager module requires java.sql module

      Caused by: java.lang.ClassNotFoundException: java.sql.SQLException from [Module "org.jboss.log4j.logmanager" version 1.1.6.Final-redhat-00001 from local module loader @7d3a22a9 (finder: local module finder @1d082e88 (roots: /opt/jboss/modules,/opt/jboss/modules/system/layers/base))]
      

      It looks like in EAP 6.4 java.* was visible to everything. In EAP 7.2 with JBoss Modules changes likely due to JDK 11 modular changes, it looks like java.* is no longer just visible and JBoss Modules has some internal modules such as java.sql which would be needed to see these classes.

      Tattletale says that logmanager jar has this class org.apache.log4j.jdbc.JDBCAppender which uses java.sql.* , so we should add a dependency on java.sql (javax.sql.api exports java.sql , but javax.sql.api module is marked deprecated)

      EAP 6.4

      <module xmlns="urn:jboss:module:1.1" name="org.jboss.log4j.logmanager">
          <resources>
              <resource-root path="log4j-jboss-logmanager-1.1.4.Final-redhat-1.jar"/>
              <!-- Insert resources here -->
          </resources>
      
          <dependencies>
              <module name="javax.api"/>
              <module name="javax.mail.api" optional="true"/>
              <module name="javax.jms.api" optional="true"/>
              <module name="org.dom4j" optional="true"/>
              <module name="org.jboss.logmanager"/>
              <module name="org.jboss.modules"/>
          </dependencies>
      </module>
      
      grep -r java.sql `f module.xml`
      <nothing>
      

      EAP 7.2:

      <module name="org.jboss.log4j.logmanager" xmlns="urn:jboss:module:1.8">
          <properties>
              <property name="jboss.api" value="private"/>
          </properties>
      
          <resources>
              <resource-root path="log4j-jboss-logmanager-1.1.6.Final-redhat-00001.jar"/>
          </resources>
      
          <dependencies>
              <!-- for java.beans -->
              <module name="java.desktop"/>
              <module name="java.logging"/>
              <module name="java.xml"/>
              <module name="javax.mail.api" optional="true"/>
              <module name="javax.jms.api" optional="true"/>
              <module name="org.dom4j" optional="true"/>
              <module name="org.jboss.logmanager"/>
              <module name="org.jboss.modules"/>
          </dependencies>
      </module>
      
      grep -r java.sql `f module.xml`
      ./modules/system/layers/base/sun/jdk/main/module.xml:                <!-- Internal to java.sql.rowset -->
      ./modules/system/layers/base/org/wildfly/extension/elytron/main/module.xml:        <module name="java.sql"/>
      ./modules/system/layers/base/org/wildfly/security/elytron-private/main/module.xml:        <module name="java.sql"/>
      ./modules/system/layers/base/io/undertow/core/main/module.xml:        <module name="java.sql"/>
      ./modules/system/layers/base/javax/sql/api/main/module.xml:        <module name="java.sql" export="true"/>
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ivassile Ilia Vassilev
                  Reporter:
                  ivassile Ilia Vassilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: