Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5841905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:56:58+00:00 2026-05-22T11:56:58+00:00

I’m having problems with the Channel API – any help would be greatly appreciated.

  • 0

I’m having problems with the Channel API – any help would be greatly appreciated.

I’ve no problems with the API on the local dev server, but when I put it up on appspot, I get an esoteric exception thrown. Full stack trace is attached, but the headline is:

com.google.appengine.api.channel.ChannelFailureException: An unexpected error occurred.     
Caused by: com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 2: Unknown

I’ve boiled the app down to a servlet and a jsp (both attached) to make sure I’m not doing anything over-complicated. Reading some of the messages on this forum and others it might be my misuse of tokens vs channel keys, but I’ve tried every combination I can think of to no avail!

Snippet of servlet:

ChannelService channelService = ChannelServiceFactory.getChannelService();
String channelKey = getChannelKey(userService.getCurrentUser().getUserId());
String token = channelService.createChannel(channelKey);

and

ChannelService channelService = ChannelServiceFactory.getChannelService();
channelService.sendMessage(new ChannelMessage(channelKey, message)); 

Snippet of jsp:

channel = new goog.appengine.Channel(channelToken);
socket = channel.open();

From the stack trace, the client is connecting to the channel OK, and successfully sends a message up, but the servlet writing the message back to the channel is the bit that fails.

Thanks very much in advance for any help!

Code:

ChannelTestController.java

ChannelTestPage.jsp

Logs:

/ChannelTestMessage.do
com.google.appengine.api.channel.ChannelFailureException: An unexpected error occurred.
at com.google.appengine.api.channel.ChannelServiceImpl.getExceptionForError(ChannelServiceImpl.java:112)
at com.google.appengine.api.channel.ChannelServiceImpl.sendMessage(ChannelServiceImpl.java:68)
at com.webstersmalley.chessweb.web.ChannelTestController.sendMessage(ChannelTestController.java:74)
at com.webstersmalley.chessweb.web.ChannelTestController.getChannelTestMessage(ChannelTestController.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:43)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:439)
at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 2: Unknown
at com.google.net.rpc.RpcStub$RpcCallbackDispatcher$1.runInContext(RpcStub.java:1050)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
at com.google.net.rpc.RpcStub$RpcCallbackDispatcher.rpcFinished(RpcStub.java:1071)
at com.google.net.rpc.RPC.internalFinish(RPC.java:2184)
at com.google.net.rpc.impl.RpcNetChannel.finishRpc(RpcNetChannel.java:2338)
at com.google.net.rpc.impl.RpcNetChannel.messageReceived(RpcNetChannel.java:1267)
at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:328)
at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:299)
at com.google.net.async.Connection.handleReadEvent(Connection.java:474)
at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831)
at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103)
at com.google.net.async.GlobalEventRegistry$2.runLoop(GlobalEventRegistry.java:95)
at com.google.net.async.LoopingEventDispatcher$EventDispatcherThread.run(LoopingEventDispatcher.java:385)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:56:59+00:00Added an answer on May 22, 2026 at 11:56 am

    I cross-posted this on Google’s own discussion forum for the Appengine Java API, and it was answered there.

    A summary is that the problem occurs when high replication is switched on (as all new apps are, by default, now), and the non-default version is being used.

    My app was a recent one (hence high rep was on), and I was trying a bunch of different ways of getting the Channels to work, so I was not using the default version of my app. Switching default to point at the latest version and using that URL caused the problem to go away!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.