一个Log4j 1.2.15引起的一个怪异问题

大概在2个月前已经完成了sword项目的源代码开发,并且在eclipse环境中已经完成了功能性测试。但是打包成jar文件进行运行问题,出现下面的问题:Log4jLoggerFactory
的死循环。
引用

C:\Documents and Settings\sys53\桌面>java  -classpath codesword.jar com.codesword.CodeGenerate
log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
Exception in thread "main" java.lang.StackOverflowError
        at java.lang.String.equalsIgnoreCase(String.java:1120)
        at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:70)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88)
        at org.apache.log4j.Category.<init>(Category.java:52)
        at org.apache.log4j.Logger.<init>(Logger.java:22)
        at org.apache.log4j.spi.NOPLogger.<init>(NOPLogger.java:39)
        at org.apache.log4j.spi.NOPLoggerRepository.getRootLogger(NOPLoggerRepository.java:89)
        at org.apache.log4j.LogManager.getRootLogger(LogManager.java:189)
        at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:71)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88)
        at org.apache.log4j.Category.<init>(Category.java:52)
        at org.apache.log4j.Logger.<init>(Logger.java:22)
        at org.apache.log4j.spi.NOPLogger.<init>(NOPLogger.java:39)
        at org.apache.log4j.spi.NOPLoggerRepository.getRootLogger(NOPLoggerRepository.java:89)
        at org.apache.log4j.LogManager.getRootLogger(LogManager.java:189)
        at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:71)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88)
        at org.apache.log4j.Category.<init>(Category.java:52)
        at org.apache.log4j.Logger.<init>(Logger.java:22)
        at org.apache.log4j.spi.NOPLogger.<init>(NOPLogger.java:39)
        at org.apache.log4j.spi.NOPLoggerRepository.getRootLogger(NOPLoggerRepository.java:89)
        at org.apache.log4j.LogManager.getRootLogger(LogManager.java:189)
        at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:71)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88)
        at org.apache.log4j.Category.<init>(Category.java:52)
        at org.apache.log4j.Logger.<init>(Logger.java:22)
        at org.apache.log4j.spi.NOPLogger.<init>(NOPLogger.java:39)
        at org.apache.log4j.spi.NOPLoggerRepository.getRootLogger(NOPLoggerRepository.java:89)
。。。。

由于工作项目忙的原因一直没有去研究这个问题。
看到了je的问答上回答说:Log4j 1.2.15存在一个bug会导致log4j:ERROR LogMananger.repositorySelector was null likely due to
于是我换成了Log4j 1.2.14版本,问题解决了!

至于为什么eclipse下为什么运行正常,在单独命令行运行jar时却会有错误还是没有想通。
谁知道能给原因吗?

你可能感兴趣的:(java,apache,eclipse,thread,log4j)