2

単一のサーブレットを使用して、tomcat-7でホストされている単純なWebアプリケーションがあります。サーブレットの目的は、Googleチャネルを作成してから、ユーザーが開いているチャネルでトークンを要求することです。私は次の構成を持っています...

WEB-INF
  -- lib
    -- appengine-api-1.0-sdk-1.4.3.jar
  -- classes
    -- Gc.class

Gc.javaのソースは...

import com.google.appengine.api.channel.*;
public class Gc extends HttpServlet {
  protected void doGetPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.getWriter().write("Creating channel...<br>");
    ChannelService channelService = ChannelServiceFactory.getChannelService();
    response.getWriter().write("Channel created!<br>");
    response.getWriter().write("Getting token for user 'user1'...<br>");
    String token = channelService.createChannel("user1");
    response.getWriter().write("toekn => "+token);
  }
}

しかし、それは私に次のエラーを与えます...

type Exception report

*message* **The API package 'channel' or call 'CreateChannel()' was not found.**

*description* **The server encountered an internal error (The API package 'channel' or call 'CreateChannel()' was not found.) that prevented it from fulfilling this request.**

exception

com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'channel' or call 'CreateChannel()' was not found.
    com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:98)
    com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:50)
    com.google.appengine.api.channel.ChannelServiceImpl.createChannel(ChannelServiceImpl.java:40)
    webRtc.Gc.doGetOrPost(Gc.java:46)
    webRtc.Gc.doGet(Gc.java:31)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

**いくつかのライブラリがありませんか?はいの場合、それらをどこでどこで見つけることができますか。**どんな助けでも本当にありがたいです。

4

1 に答える 1

1

わかった!!!私のアプリケーションの目標は、Googleチャネルを作成し、これらのチャネルでメッセージを送信することです。

私は、グーグルチャネルAPIが独立したライブラリであり、Tomcatアプリケーションのlibに関連する.jarを配置しようとしたという印象を受けました。

しかし、私は間違っていました。GoogleチャネルAPIライブラリは、GoogleAppEngineServerでのみ機能します。したがって、これらのGoogle APIを活用する必要があるアプリケーションは、GoogleAppEngineServerでホストする必要があります。

私が間違っている場合、私は専門家からの意見を聞くことができます。

于 2012-12-20T08:43:41.713 に答える