Hi 

Here I am doing google directory search that will search all the people in 
same directory using java.
Below is the block of code

public class DirectorySampleServlet
    extends AbstractAppEngineAuthorizationCodeServlet {

  /**
   * Be sure to specify the name of your application. If the application 
name is {@code null} or
   * blank, the application will log a warning. Suggested format is 
"MyCompany-ProductName/1.0".
   */
  private static final String APPLICATION_NAME = "";

  private static final long serialVersionUID = 1L;

  @Override
  public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws IOException, ServletException {
    // Get the stored credentials using the Authorization Flow
    AuthorizationCodeFlow authFlow = initializeFlow();
    Credential credential = authFlow.loadCredential(getUserId(req));
    // Build the Directory object using the credentials
    @SuppressWarnings("unused")
    Directory admin = new Directory.Builder(
        Utils.HTTP_TRANSPORT, Utils.JSON_FACTORY, credential)
        .setApplicationName(APPLICATION_NAME)
        .build();

    // Add the code to make an API call here.

    // Send the results as the response
    resp.setStatus(200);
    resp.setContentType("text/html");
    PrintWriter writer = resp.getWriter();
    writer.println("Success! Now add code here.");
  }
  @Override
  protected AuthorizationCodeFlow initializeFlow() throws ServletException, 
IOException {
    return Utils.initializeFlow();
  }

  @Override
  protected String getRedirectUri(HttpServletRequest req) throws 
ServletException, IOException {
    return Utils.getRedirectUri(req);
  }
}




I have included all the dependency jar file and build path also.And this 
code is compiled successfully but while running in localhost 
its giving following error.



org.mortbay.util.MultiException[java.lang.NoClassDefFoundError: 
com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeCallbackServlet,
 
java.lang.NoClassDefFoundError: 
com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeServlet]
at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:656)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:249)
at 
com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:306)
at 
com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
at 
com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:79)
at com.google.appengine.tools.development.Modules.startup(Modules.java:88)
at 
com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:254)
at 
com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
at 
com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:212)
at 
com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:210)
at java.security.AccessController.doPrivileged(Native Method)
at 
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:210)
at 
com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:414)
at 
com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at 
com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:348)
at 
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:324)
java.lang.NoClassDefFoundError: 
com/google/api/client/extensions/appengine/auth/oauth2/AbstractAppEngineAuthorizationCodeCallbackServlet


Someone please help me regarding this.Thanks in advance



-- 
This message and any files transmitted with it are the property of 
Sigma-Aldrich Corporation, are confidential, and are intended solely for 
the use of the person or entity to whom this e-mail is addressed. If you 
are not one of the named recipient(s) or otherwise have reason to believe 
that you have received this message in error, please contact the sender and 
delete this message immediately from your computer. Any other use, 
retention, dissemination, forwarding, printing, or copying of this e-mail 
is strictly prohibited.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to