Skip to content

java.lang.NoClassDefFoundError: com/face4j/facebook/Client #24

@lajthabalazs

Description

@lajthabalazs

First time using face4j, not a big J2EE expert either, so it might be some simple misstake.

I downloaded the libraries, addded both dependencies and the 1.7.1 jars to the Google Appengine project.

Servlet's code is:

package hu.edudroid.facebook_sample.server;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.face4j.facebook.Client;
import com.face4j.facebook.enums.Display;
import com.face4j.facebook.enums.HttpClientType;
import com.face4j.facebook.enums.Permission;
import com.face4j.facebook.factory.FacebookFactory;

public class FacebookServlet extends HttpServlet {

private static final String APP_SECRET = "xxxxxx";
private static final String APP_ID = "xxxxxxxx";
private static final String REDIRECT_URL = "xxxxxxxxxxx";

private static final long serialVersionUID = -5750323052726353067L;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    Client client = new Client(APP_ID, APP_SECRET);
    FacebookFactory facebookFactory = new FacebookFactory(client, HttpClientType.URL_FETCH_SERVICE);
    String redirectURL = facebookFactory.getRedirectURL(REDIRECT_URL, Display.POPUP, Permission.EMAIL, Permission.OFFLINE_ACCESS);
    System.out.println("Redirecting " + redirectURL);
    PrintWriter out = resp.getWriter();
    out.write(redirectURL);
    out.flush();
}

}

How could I make this work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions