Search code examples
playframeworkfbconnect

playframework integration with fbconnect


I installed the playframework fbconnect module (version 0.6). I keep getting the following error. I am following the steps of the basic example. Even the sample-and-test application in the module folder gives the same error.

Compilation error
The file {module:..}/app/controllers/FBConnect.java could not be compiled. Error raised is : play.modules.fbconnect.FBConnectPlugin cannot be resolved

play.exceptions.CompilationException: play.modules.fbconnect.FBConnectPlugin cannot be resolved
    at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
    at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:676)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:520)
    at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:282)
    at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:424)
    at play.Play.start(Play.java:505)
    at play.Play.detectChanges(Play.java:629)
    at play.Invoker$Invocation.init(Invoker.java:198)
    at Invocation.HTTP Request(Play!)

Solution

  • Ouch! It seems that fbconnect-0.6 doesn't correctly install itself in Play! Here's how I got it working:

    (my Play! directory is /usr/local/share/play-1.2.4)

    cd /usr/local/share/play-1.2.4/modules
    sudo git clone git://github.com/murz/play-fbconnect.git
    sudo mv play-fbconnect fbconnect-0.6
    

    Now we've got the proper fbconnect-0.6 downloaded in place in Play! We still need to build it, though:

    cd fbconnect-0.6
    sudo vim build.xml
    

    (or use any other editor you like :-) ) Add the <property ..> element so that the build.xml starts like this:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <project name="fbconnect" default="build" basedir=".">
        <property name="play.path" location="/usr/local/share/play-1.2.4" />
    

    Now build.xml knows where my Play! is. Now I've just got to build fbconnect. (remember, I'm still in /usr/local/share/play-1.2.4/modules)

    sudo ant
    

    (You will need to have ant installed: http://ant.apache.org/)

    I've still done the other configuration that you've done. Now when I start my Play! application, I'm getting a 'You need to configure fbconnect' error - which is what I expect, since I've not configured it. But it should work for you after configuration.

    Hopefully the fbconnect maintainers will fix their installation, so that this won't be necessary in future, or perhaps both of us have somehow misunderstood the installation instructions and someone nice can tell us what we did wrong. But for now, this should get you working.

    Good luck!