问题描述
我有一个简单的web应用程序,托管在tomcat-7上,只有一个servlet。 servlet的目标是创建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 for user'user1'...< br>);
String token = channelService.createChannel(user1);
response.getWriter()。write(toekn =>+ token);
$ / code $ / pre
但它给了我一个下面的错误...
类型异常报告
*消息* ** API包'channel'或者调用'CreateChannel )'找不到。**
* description * **服务器遇到内部错误(找不到API通道或调用CreateChannel())。执行此请求**
异常
com.google.apphosting.api.ApiProxy $ CallNotFoundException:API包通道或调用CreateChannel()不是找到。
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)
**我是否缺少一些图书馆?如果是,那么哪个和哪里可以找到这些。**
任何帮助真的很感谢。
它!!!
我的应用程序的目标是在这些频道上创建Google频道并发送消息。
我的印象是,google频道API是一个独立的库,试图将相关的.jar放在我的tomcat应用程序的lib中。
但我错了。 Google频道API库仅适用于Google AppEngine服务器。因此,任何需要利用这些Google API的应用程序都必须托管在Google AppEngine Server上。
如果我错了,我很乐意听取专家的意见。 >
I have a simple web application hosted on tomcat-7 with single servlet. The aim of servlet is to create google channel and then request for a token on opened channel for a user. I have following configuration...
WEB-INF
-- lib
-- appengine-api-1.0-sdk-1.4.3.jar
-- classes
-- Gc.class
The source of Gc.java is...
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);
}
}
But it gives me an following error...
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)
** Am I missing some libraries? If yes then which and where can I found those.**Any help is really appreciated.
解决方案 I got it!!!The goal of my application is to create google channels and send messages on these channels.
I was under impression that, google channel API is an independent library and was tried to place relevant .jar in lib of my tomcat application.
But I was wrong. Google channel API libraries only works on Google AppEngine Server. And thus, any application needs to leverage these Google APIs must be hosted on Google AppEngine Server.
I am open to listen from experts, if I am wrong.
这篇关于未找到API程序包“通道”或调用“CreateChannel()”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!