0

出于某种原因,从我的 Bukkit 插件中收到以下错误。的第 58 行UpdatePlayer.java,错误开始的地方是HttpClient httpclient = new DefaultHttpClient();

2013-07-06 21:22:28
[SEVERE] at com.adventurize.players.UpdatePlayer.run(UpdatePlayer.java:58)

2013-07-06 21:22:28
[SEVERE] at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:146)

2013-07-06 21:22:28
[SEVERE] at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:187)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:316)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:517)

2013-07-06 21:22:28
[SEVERE] at java.security.AccessController.doPrivileged(Native Method)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:531)

2013-07-06 21:22:28
[SEVERE] at java.lang.Class.newInstance(Class.java:327)

2013-07-06 21:22:28
[SEVERE] at java.lang.Class.newInstance0(Class.java:374)

2013-07-06 21:22:28
[SEVERE] at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

2013-07-06 21:22:28
[SEVERE] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

2013-07-06 21:22:28
[SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

2013-07-06 21:22:28
[SEVERE] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.impl.LogFactoryImpl.<init>(LogFactoryImpl.java:95)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.impl.LogFactoryImpl.initDiagnostics(LogFactoryImpl.java:476)

2013-07-06 21:22:28
[SEVERE] at org.apache.commons.logging.impl.LogFactoryImpl.getClassLoader(LogFactoryImpl.java:447)

2013-07-06 21:22:28
[SEVERE] java.lang.NoSuchMethodError: org.apache.commons.logging.LogFactory.getClassLoader(Ljava/lang/Class;)Ljava/lang/ClassLoader;

2013-07-06 21:22:28
[SEVERE] Exception in thread "Thread-8"

这在我尝试插件的第一台服务器上一切正常,但后来我们切换了服务器,我收到了这个错误。任何见解将不胜感激。

4

1 回答 1

1

异常的意思是加载的类加载器的版本LogFactory没有带有签名的方法:

    Classloader LogFactory.getClassLoader(Class)

发生的情况是您的应用程序(或某些第 3 方 JAR)是针对org.apache.commons.logging.LogFactoryAPI 的一个版本编译的,但您的运行时正在加载不同的版本。

根据该项目的在线 javadocs,该getClassLoader(Class)方法存在于1.1.xcommons 日志记录的版本中,但不在1.0.4版本中。(它是一个半内部方法......它声明protected......所以依赖更有可能来自一些实现或扩展 log4j 的 JAR,而不是来自客户端代码。)

于 2013-07-07T04:06:02.627 回答