2013-07-07 67 views
0

出於某種原因,從我的Bukkit插件中獲取以下錯誤。的UpdatePlayer.java,這裏的錯誤是開始,58號線是HttpClient httpclient = new DefaultHttpClient();新的DefaultHttpClient奇怪的Java錯誤()

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" 

這是所有我想在插件的第一臺服務器上工作正常,但後來我們交換服務器和我得到這個錯誤。任何有識之士將不勝感激。

+1

檢查Java版本和commons-兩個服務器上的日誌記錄版本 – Satya

+0

我無權訪問舊服務器。目前的版本如下:'commons-logging':'1.1.1','java':'1.7.0_21'。 – BenjaminRH

回答

1

什麼異常是,LogFactory的版本,加載的類加載器不具有簽名的方法:

Classloader LogFactory.getClassLoader(Class) 

發生了什麼事是你的應用程序(或第3第三方JAR)是針對一個版本的org.apache.commons.logging.LogFactory API編譯的,但您的運行時正在加載不同的版本。

根據項目的在線javadocs,1.1.x版本的公用日誌記錄中存在getClassLoader(Class)方法,但不存在於1.0.4版本中。 (它是一個半內部方法...它聲明瞭protected ...所以依賴性更可能來自實現或擴展log4j而不是來自客戶端代碼的JAR。)

+0

這是問題所在。非常感謝! – BenjaminRH