huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

Beginner: Issues with Deploying into Tomcat #139

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to get friends list from client I am generating client as follows

client = new FacebookXmlRestClient(_apiKey, _secretKey, sessionKey); 

No errors here but when i try to execute

client.friends_get();

I get the following exception

java.lang.AbstractMethodError:
org.apache.xerces.dom.DeferredDocumentImpl.normalizeDocument()V
    at
com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult(FacebookXmlRes
tClient.java:198)
    at
com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult(FacebookXmlRes
tClient.java:67)
    at
com.google.code.facebookapi.ExtensibleClient.callMethod(ExtensibleClient.java:61
2)
    at
com.google.code.facebookapi.ExtensibleClient.callMethod(ExtensibleClient.java:50
8)
    at
com.google.code.facebookapi.FacebookXmlRestClient.auth_getSession(FacebookXmlRes
tClient.java:182)
    at de.imc.facebook.HelloFaceBook.doPost(HelloFaceBook.java:86)

Original issue reported on code.google.com by amir.wasim on 12 Nov 2008 at 2:16

GoogleCodeExporter commented 8 years ago
BTW I am using JDK 1.5 and the required jar files for jdk 1.5 are on CLASSPATH
variable in windows e.g D:\Program Files\Apache Software Foundation\Tomcat
6.0\lib\jaxb-api-2.1.jar;D:\Program Files\Apache Software Foundation\Tomcat
6.0\lib\jaxb-impl-2.1.jar;D:\Program Files\Apache Software Foundation\Tomcat
6.0\lib\jsr173-api-1.0.jar;

Original comment by amir.wasim on 12 Nov 2008 at 3:51

GoogleCodeExporter commented 8 years ago
weird. I can only guess that you're also bringing in an explicit dependency on
xerces, when you should not have to, since jdk 1.5 has xml parsers built in..  
what's
your full classpath?

Also, are you not using maven for dependency management?

Original comment by fern...@gmail.com on 12 Nov 2008 at 6:52

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Its D:\Program Files\Apache Software Foundation\Tomcat
6.0\webapps\aha\WEB-INF\lib\jaxb-api-2.1.jar;D:\Program Files\Apache Software
Foundation\Tomcat 6.0\webapps\aha\WEB-INF\lib\jaxb-impl-2.1.jar;D:\Program
Files\Apache Software Foundation\Tomcat
6.0\webapps\aha\WEB-INF\lib\jsr173-api-1.0.jar;D:\Program Files\Apache Software
Foundation\Tomcat 6.0\webapps\aha\WEB-INF\lib\json-1.0.jar;

And i am not using maven for dependency mangement

Original comment by amir.wasim on 13 Nov 2008 at 8:33

GoogleCodeExporter commented 8 years ago
Add next libraries to your classpath:

xalan-2.7.0.jar 
xercesImpl-2.8.1.jar 
dom4j-1.6.1.jar 
xml-apis-1.3.03.jar

Original comment by rdmytre...@gmail.com on 13 Nov 2008 at 9:39

GoogleCodeExporter commented 8 years ago
After adding these as well doesnt change any thing. Still getting the same 
exception.
Classpath looks as follows now

D:\Program Files\Apache Software Foundation\Tomcat
6.0\webapps\aha\WEB-INF\lib\jaxb-api-2.1.jar;D:\Program Files\Apache Software
Foundation\Tomcat 6.0\webapps\aha\WEB-INF\lib\jaxb-impl-2.1.jar;D:\Program
Files\Apache Software Foundation\Tomcat
6.0\webapps\aha\WEB-INF\lib\jsr173-api-1.0.jar;D:\Program Files\Apache Software
Foundation\Tomcat 6.0\webapps\aha\WEB-INF\lib\json-1.0.jar;D:\Program 
Files\Apache
Software Foundation\Tomcat 
6.0\webapps\aha\WEB-INF\lib\xalan-2.7.0.jar;D:\Program
Files\Apache Software Foundation\Tomcat
6.0\webapps\aha\WEB-INF\lib\xercesImpl-2.8.1.jar;D:\Program Files\Apache 
Software
Foundation\Tomcat 6.0\webapps\aha\WEB-INF\lib\dom4j-1.6.1.jar;D:\Program 
Files\Apache
Software Foundation\Tomcat 6.0\webapps\aha\WEB-INF\lib\xml-apis-1.3.03.jar;

Original comment by amir.wasim on 13 Nov 2008 at 9:52

GoogleCodeExporter commented 8 years ago
This is definitely a problem restricted to your build and, as such, you're in 
the
best and only position to fix it. Have you attached a Java debugger to your 
runtime
environment? Simpler still is to just start using Maven for dependency 
management.
Please close this issue as it is not a general, repeatable issue with the Java
Facebook API.

Original comment by david.j....@googlemail.com on 16 Nov 2008 at 10:52

GoogleCodeExporter commented 8 years ago
yeah.. i kind of agree with david, I don't think it's the library, but just the 
way
amir has set it up.. so I'll keep it open for a bit longer.. maybe I can help 
him
figure it out, else...

So, are you building a war file and deploying it to tomcat?  Or what are you 
doing? 
You should not be adding these jar files to tomcat directly, but should be 
included
into your war file lib directory..

Original comment by fern...@gmail.com on 18 Nov 2008 at 3:26

GoogleCodeExporter commented 8 years ago

Original comment by fern...@gmail.com on 18 Nov 2008 at 3:31

GoogleCodeExporter commented 8 years ago
No i am not deploying it as war file, its part of another webapp for which 
classes
are in classes folder. If i write something e.g

        servletOutput.println("Hello FaceBook sessionKey "+sessionKey);
        servletOutput.println("Hello FaceBook authToken"+authToken);
        servletOutput.println("Hello FaceBook _apiKey"+_apiKey);
        servletOutput.println("Hello FaceBook _secretKey"+_secretKey);

and dont do anything it is visible in the application @ facebook, but if i call

client = new FacebookXmlRestClient(_apiKey, _secretKey, sessionKey); 
client.friends_get();

I get the exception.....

Original comment by amir.wasim on 18 Nov 2008 at 8:16

GoogleCodeExporter commented 8 years ago
Closing due to it being off-topic and inactive.

Original comment by david.j....@googlemail.com on 2 Dec 2008 at 1:04