Announcement Announcement Module
Collapse
No announcement yet.
Error while compiling current version of spring-social-facebook Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while compiling current version of spring-social-facebook

    Hi everyone,
    currently, I am trying to get the current version of spring-social-facebook (checked out from the Github repository) compiled. I've followed the steps described within https://github.com/SpringSource/spri...i/Contributing and finally run ./gradlew build. There, the following error occurred:
    :spring-social-facebook-web:compileJava
    [ant:javac] /home/user/workspace/spring-social-facebook/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/SignedRequestDecoder.java:25: error: package javax.crypto does not exist
    [ant:javac] import javax.crypto.Mac;
    [ant:javac] ^
    [ant:javac] /home/user/workspace/spring-social-facebook/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/SignedRequestDecoder.java:26: error: package javax.crypto.spec does not exist
    [ant:javac] import javax.crypto.spec.SecretKeySpec;
    [ant:javac] ^
    [ant:javac] /home/user/workspace/spring-social-facebook/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/SignedRequestDecoder.java:118: error: cannot find symbol
    [ant:javac] SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(), HMAC_SHA256_MAC_NAME);
    [ant:javac] ^
    [ant:javac] symbol: class SecretKeySpec
    [ant:javac] location: class SignedRequestDecoder
    [ant:javac] /home/user/workspace/spring-social-facebook/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/SignedRequestDecoder.java:118: error: cannot find symbol
    [ant:javac] SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(), HMAC_SHA256_MAC_NAME);
    [ant:javac] ^
    [ant:javac] symbol: class SecretKeySpec
    [ant:javac] location: class SignedRequestDecoder
    [ant:javac] /home/user/workspace/spring-social-facebook/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/SignedRequestDecoder.java:119: error: cannot find symbol
    [ant:javac] Mac mac = Mac.getInstance(HMAC_SHA256_MAC_NAME);
    [ant:javac] ^
    [ant:javac] symbol: class Mac
    [ant:javac] location: class SignedRequestDecoder
    [ant:javac] /home/user/workspace/spring-social-facebook/spring-social-facebook-web/src/main/java/org/springframework/social/facebook/web/SignedRequestDecoder.java:119: error: cannot find symbol
    [ant:javac] Mac mac = Mac.getInstance(HMAC_SHA256_MAC_NAME);
    [ant:javac] ^
    [ant:javac] symbol: variable Mac
    [ant:javac] location: class SignedRequestDecoder
    [ant:javac] 6 errors

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':spring-social-facebook-web:compileJava'.
    > Compile failed; see the compiler error output for details.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED
    My java version is the following one:
    java version "1.7.0_147-icedtea"
    OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-0ubuntu0.11.10.1)
    OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
    Does anyone has hints how to solve this issue?

    Best,
    XComp

  • #2
    Did some research on this and it appears to be a problem with Gradle milestone 8 and how it deals with source/target compatibility. (See http://forums.gradle.org/gradle/topi...x_crypt_cipher).

    I'm on MacOSX building with Java 1.6 (I've not been brave enough to try 1.7 yet). What you might try is editing build.gradle and changing the Gradle version to a newer version. I've tried 1.0-rc-3 locally and it seems to work, but again I wasn't experiencing the same problems as you.

    Somewhere near the bottom of build.gradle, you'll find the line setting gradleVersion. Change it to:

    Code:
    gradleVersion = '1.0-rc-3'
    Then run "gradlew cleanWrapper wrapper" to generate a new wrapper script. And then try "gradlew clean build" to see how it goes. Let me know if this solves your problem or not. If it does, then I'll adjust all of the builds to 1.0-rc-3.

    Comment


    • #3
      Unfortunately, it didn't help. But the error output changed. I've checked in the error log on pastebin: http://pastebin.com/Zd88bkvQ (available until June 15, 2012)

      Comment


      • #4
        This new error sounds less like a Spring Social Facebook problem and more like a bug in OpenJDK 7, triggered by Spring Social Facebook's documentation generation. This bug https://bugs.launchpad.net/ubuntu/+s...-7/+bug/913434 hints to the same problem, specifically the comment #5 (https://bugs.launchpad.net/ubuntu/+s...434/comments/5) discusses this same error message.

        This makes some sense, since there are several others out there successfully building Spring Social Facebook using JDKs other than OpenJDK 7.

        I'm not sure how to fix this problem (especially if it is, in fact, a bug in OpenJDK), but there are some options to avoid it. The obvious answer is to try building using a different JDK other than OpenJDK 7. But you might also try to build without building the reference documentation. To do that, use "gradlew -x reference clean build".

        Comment


        • #5
          Awesome, you were right. I've changed the JDK version to 1.6 and now the build is working. Thanks!

          Comment


          • #6
            Glad to hear it. Those kinds of problems are always a hassle to resolve. I probably need to setup a VM with Ubuntu and OpenJDK 7 for these kinds of things, but just haven't had the opportunity or the pressing need to do so. Had this not worked for you, that may have been my next step. Glad it worked!

            Comment

            Working...
            X