当使用smack和servlets连接到Facebook聊天时

时间:2014-04-23 10:58:52

标签: java facebook servlets chat smack

使用jar文件:smack3.3.1.jarrestfb 1.5.4.jar

SEVERE: Allocate exception for servlet FriendsListServlet
java.lang.ClassNotFoundException: org.jivesoftware.smack.XMPPException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)
    at java.lang.Class.getConstructor0(Class.java:2708)
    at java.lang.Class.newInstance0(Class.java:328)
    at java.lang.Class.newInstance(Class.java:310)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1104)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:662)

1 个答案:

答案 0 :(得分:0)

myeclipse的问题,我从myproject中删除了所有jar文件(右键单击)>>属性>> java Built Path>>库。 然后我将jar文件直接添加到myproject的lib文件夹中。 它解决了我的问题。