mehdibouhafs / facebook-java-api

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

Error with stream_get in FacebookJaxbRestClient #296

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Use the following code:
FacebookJaxbRestClient client = new FacebookJaxbRestClient(apiKey,
secretKey, sessionId); 

StreamData stream = client3.stream_get(null, null, null, null, null, null,
null);

What is the expected output? What do you see instead?
The stream data of the current logged user. I get the following exception:

Exception in thread "main" java.lang.IllegalAccessError: tried to access
class com.sun.xml.bind.v2.runtime.reflect.opt.Const from class
com.google.code.facebookapi.schema.StreamPost$JaxbAccessorF_appId
    at
com.google.code.facebookapi.schema.StreamPost$JaxbAccessorF_appId.set(FieldAcces
sor_Long.java:59)
    at com.sun.xml.bind.v2.runtime.reflect.Accessor.receive(Accessor.java:171)
    at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(Unmarsh
allingContext.java:492)
    at
com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.ja
va:145)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Abstract
SAXParser.java:601)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElemen
t(AbstractXMLDocumentParser.java:180)
    at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElemen
t(XMLNSDocumentScannerImpl.java:377)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentC
ontentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentS
cannerImpl.java:648)
    at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocum
entScannerImpl.java:140)
    at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocum
ent(XMLDocumentFragmentScannerImpl.java:510)
    at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configu
ration.java:807)
    at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configu
ration.java:737)
    at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
    at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXPa
rser.java:1205)
    at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXPar
serImpl.java:522)
    at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unmarshalle
rImpl.java:211)
    at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unmarshaller
Impl.java:184)
    at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm
pl.java:137)
    at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm
pl.java:194)
    at
com.google.code.facebookapi.FacebookJaxbRestClientBase.getResponsePOJO(FacebookJ
axbRestClientBase.java:148)
    at
com.google.code.facebookapi.FacebookJaxbRestClientBase.parseCallResult(FacebookJ
axbRestClientBase.java:173)
    at
com.google.code.facebookapi.FacebookJaxbRestClient.stream_get(FacebookJaxbRestCl
ient.java:233)
    at PruebaFacebook.main(PruebaFacebook.java:82)

What version of the product are you using? On what operating system?
- facebook-java-api-3.0.2
- Ubuntu linux 9.10 64 bits

Original issue reported on code.google.com by lopez.i...@gmail.com on 23 Feb 2010 at 4:47

GoogleCodeExporter commented 8 years ago
Seeing the exact same issue on Windows Vista 32 bits (also with API 3.0.2).
The stream_get version in FacebookJsonRestClient seems to be working though.

Original comment by amoru...@gmail.com on 15 Mar 2010 at 3:44

GoogleCodeExporter commented 8 years ago
I have seen this issue for getting albums:
java.lang.IllegalAccessError: com/sun/xml/bind/v2/runtime/reflect/opt/Const

Looks like it is this issue: 
https://jaxb.dev.java.net/issues/show_bug.cgi?id=490

Forcing the use of jaxb 2.2 seemed to do the trick:

<dependency>
      <groupId>com.google.code.facebookapi</groupId>
      <artifactId>facebook-java-api</artifactId>
      <version>3.0.3</version>
      <exclusions>
        <exclusion>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>com.google.code.facebookapi</groupId>
      <artifactId>facebook-java-api-schema</artifactId>
      <version>3.0.3</version>
      <exclusions>
        <exclusion>
          <groupId>com.sun.xml.bind</groupId>
          <artifactId>jaxb-impl</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2</version>
    </dependency>

If this is the case, the schema pom should really just be updated to use 2.2...

Original comment by jasper.r...@gmail.com on 16 Mar 2010 at 8:04

GoogleCodeExporter commented 8 years ago
Hello.
have you resolved this problem?
I have the same problem.
I'm looking forward for you advice.

Original comment by chenyime...@gmail.com on 8 Dec 2010 at 2:52