2013-04-04 95 views
0

當我運行時與Jar文件相關的主類我得到以下錯誤。有人請幫助我。謝謝。在jar文件上執行主要調用時發生錯誤

D:\data\Gateway\dist>java -jar Gateway.jar com.Application 
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/support/AbstractApplicationContext 
     at java.lang.Class.getDeclaredMethods0(Native Method) 
     at java.lang.Class.privateGetDeclaredMethods(Unknown Source) 
     at java.lang.Class.getMethod0(Unknown Source) 
     at java.lang.Class.getMethod(Unknown Source) 
     at sun.launcher.LauncherHelper.getMainMethod(Unknown Source) 
     at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) 
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support.AbstractApplicationContext 
     at java.net.URLClassLoader$1.run(Unknown Source) 
     at java.net.URLClassLoader$1.run(Unknown Source) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at java.net.URLClassLoader.findClass(Unknown Source) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     ... 6 more 

回答

3

消息

java.lang.NoClassDefFoundError: 
    org/springframework/context/support/AbstractApplicationContext 

表明罐子org.springframework.context必須被添加到類路徑。

+0

嗨瓦赫! 非常感謝你釋放回來。 祝您有美好的時光! 謝謝。 – Channa 2013-04-08 16:21:07

+0

沒問題。我希望你能解決你的問題! – 2013-04-08 19:44:55

+0

嗨瓦赫!是的,我解決了它。非常感謝。 – Channa 2013-04-08 19:53:11