Java Websphere Log4j2类路径问题
我正在websphere中部署一个实用程序jar,它发布两个API。现在,这些API将由Web应用程序调用。现在,这个jar使用log4j2进行日志记录。我试图通过添加来自两个log4j2 jar(log4j-api-2.0.2.jar&&log4j-core-2.0.2.jar)的包来创建一个uber jar。我通过使用ant构建实用程序jar来实现这一点 下面是为我构建jar的ant代码片段Java Websphere Log4j2类路径问题,java,websphere,classpath,log4j2,Java,Websphere,Classpath,Log4j2,我正在websphere中部署一个实用程序jar,它发布两个API。现在,这些API将由Web应用程序调用。现在,这个jar使用log4j2进行日志记录。我试图通过添加来自两个log4j2 jar(log4j-api-2.0.2.jar&&log4j-core-2.0.2.jar)的包来创建一个uber jar。我通过使用ant构建实用程序jar来实现这一点 下面是为我构建jar的ant代码片段 <!--Creates the client jar file --> <tar
<!--Creates the client jar file -->
<target name="clientjar" depends="compile">
<jar destfile="${dist.dir}/client/myUtility.jar" basedir="${class.dir}">
<zipgroupfileset dir="${lib.dir}" includes="*.jar" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Build-Date" value="${timestamp}" />
<section name="${ant.project.name}">
<attribute name="Implementation-Title" value="${project.implementation.title}"/>
<attribute name="Specification-Version" value="${project.version}"/>
</section>
</manifest>
</jar>
</target>
我的问题是,当位于同一jvm上的web应用程序调用JARAPI时,log4j会发出以下错误消息
错误状态记录器Log4j2找不到日志记录实现。请将log4j核心添加到类路径。正在使用SimpleLogger登录到控制台
任何指针都会很有帮助。如果您解压缩log4j core jar并将其作为更大的jar文件的一部分重新压缩,请确保包含所有最初在log4j core jar中的文件。它包含log4japi将查找的许多配置文件。如果这些文件不存在,您将得到您遇到的错误。我确实将重新压缩的版本与原始版本进行了比较。除了manifest.mf文件外,一切似乎都正常。清单文件似乎与原始jar附带的清单文件不同。你认为这是个问题吗?