没有为org.apache.commons.logging.LogFactory定义实现

时间:2018-02-19 11:46:57

标签: wildfly

我们正在尝试从JBoss4.2.3迁移到Wildfly,当我们尝试将战争从JBoss4.2.3部署到Wildfly11时,我们遇到以下异常:

Caused by: org.apache.commons.discovery.DiscoveryException: No implementation defined for org.apache.commons.logging.LogFactory
        at org.apache.commons.discovery.tools.DiscoverClass.find(DiscoverClass.java:404)
        at org.apache.commons.discovery.tools.DiscoverClass.newInstance(DiscoverClass.java:579)
        at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:418)
        at org.apache.commons.discovery.tools.DiscoverSingleton.find(DiscoverSingleton.java:378)
        at org.apache.axis.components.logger.LogFactory$1.run(LogFactory.java:45)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)

        at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
        ... 28 more

Module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.ca.pamsc.httpclient">
   <resources>
      <resource-root path="commons-httpclient-3.1.jar" />
   </resources>
   <dependencies>
      <module name="org.apache.commons.logging" />
   </dependencies>
</module>

战争结构:

acem.war
└───WEB-INF
    │   faces-config.xml
    │   filebrowse.tld
    │   jboss-deployment-structure.xml
    │   jboss-web.xml
    │   jsftaglib.tld
    │   userbrowse.tld
    │   web.xml
    │
    └───lib
            acem.jar
            axis.jar
            commons-beanutils-1.7.0.jar
            commons-digester-1.6.jar
            commons-discovery-0.2.jar
            commons-el-1.0.jar
            commons-fileupload-1.2.jar
            commons-io-1.3.1.jar
            commons-lang-2.6.jar
            cpchart.jar
            jaxb-api.jar
            jaxb-impl.jar
            jaxb1-impl.jar
            jsr173_1.0_api.jar
            jstl.jar
            myfaces-api.jar
            myfaces-impl.jar
            namespace.jar
            openviz2.jar
            relaxngDatatype.jar
            standard.jar
            tomahawk-1.1.5.jar
            wcom.jar
            xsdlib.jar

更新1: 我已经尝试手动将Apache commons日志记录jar文件添加到modules文件夹中,但在这种情况下它会出现以下错误:

Caused by: org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.LogFactoryImpl does not implement org.apache.commons.logging.LogFactory
        at org.apache.commons.discovery.tools.ClassUtils.verifyAncestory(ClassUtils.java:180)
        at org.apache.commons.discovery.tools.SPInterface.verifyAncestory(SPInterface.java:201)

Module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.ca.pamsc.httpclient">
<resources>
   <resource-root path="commons-httpclient-3.1.jar"/>
   <resource-root path="commons-logging-1.0.4.jar"/>
</resources>
</module>

UPDATE2: 通过引用以下线程创建了common-logging.properties文件,但仍然出现此错误

Caused by: org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.LogFactoryImpl does not implement org.apache.commons.logging.LogFactory

JavaAgent in Lotus Notes 6.5 using axis api gives Exception "No implementation defined for org.apache.commons.logging.LogFactory"

1 个答案:

答案 0 :(得分:0)

这是commons-logging-jboss-logmanager项目中的“错误”,已在1.0.3.Final中修复。问题是某些项目似乎重新打包commons-logging并添加META-INF/services/org.apache.commons.logging.LogFactory文件,默认commons-logging:commons-logging JAR似乎没有。

下载org.jboss.logmanager:commons-logging-jboss-logmanager:1.0.3.Final并更换模块应该是安全的。您只需将下载的库放在$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/commons/logging/main/中,然后编辑module.xml以指向新版本。