helmidreijer / channel-tac-toe

Automatically exported from code.google.com/p/channel-tac-toe
0 stars 0 forks source link

java.lang.IllegalArgumentException: Invalid client ID. The clientid must be fewer than 64 bytes when encoded to UTF-8. #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new eclipse project with AppEngine 1.5.5
2. Manually copy files into place from TicTacToe SVN
3. Run app, log on with 2-character user.

What is the expected output? What do you see instead?
I'm expecting to see the tictactoe game running on my local machine.
I added two println's to see the problem:

    System.out.println("<p>userid: " + userId );
    System.out.println("<p>channelKey: " + game.getChannelKey(userId) 

Here is the output:
<p>userid: 11562343036115170244
<p>channelKey: 
11562343036115170244ahRqYXZhLWNoYW5uZWwtdGFjLXRvZXIKCxIER2FtZRgYDA

Any help would be appreciated, thanks,
--Erik
What version of the product are you using? On what operating system?
Win7.  I see that TicTacToe is distributed with AppEngine 1.3.8.
Trying to get it to run on 1.5.5

Please provide any additional information below.

Oct 31, 2011 12:58:21 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via 
com.google.apphosting.utils.jetty.JettyLogger
Oct 31, 2011 12:58:21 PM 
com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed 
C:\src\jsource\eclipseWorkspace\tic-tac-toe\war\WEB-INF/appengine-web.xml
Oct 31, 2011 12:58:21 PM 
com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed 
C:\src\jsource\eclipseWorkspace\tic-tac-toe\war\WEB-INF/web.xml
Oct 31, 2011 7:58:22 AM com.google.appengine.tools.development.DevAppServerImpl 
start
INFO: The server is running at http://localhost:8888/
<p>userid: 11562343036115170244
<p>channelKey: 
11562343036115170244ahRqYXZhLWNoYW5uZWwtdGFjLXRvZXIKCxIER2FtZRgYDA
Oct 31, 2011 7:58:48 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: /tic_tac_toe
java.lang.IllegalArgumentException: Invalid client ID. The clientid must be 
fewer than 64 bytes when encoded to UTF-8.
    at com.google.appengine.api.channel.ChannelServiceImpl.getExceptionForPrecondition(ChannelServiceImpl.java:110)
    at com.google.appengine.api.channel.ChannelServiceImpl.createChannel(ChannelServiceImpl.java:37)
    at com.google.appengine.demos.channeltactoe.TicTacToeServlet.doGet(TicTacToeServlet.java:77)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    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 com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
    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 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351)
    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.HttpParser.parseNext(HttpParser.java:547)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
<p>userid: 11562343036115170244
<p>channelKey: 
11562343036115170244ahRqYXZhLWNoYW5uZWwtdGFjLXRvZXIKCxIER2FtZRgZDA
Oct 31, 2011 7:58:48 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: /favicon.ico
java.lang.IllegalArgumentException: Invalid client ID. The clientid must be 
fewer than 64 bytes when encoded to UTF-8.
    at com.google.appengine.api.channel.ChannelServiceImpl.getExceptionForPrecondition(ChannelServiceImpl.java:110)
    at com.google.appengine.api.channel.ChannelServiceImpl.createChannel(ChannelServiceImpl.java:37)
    at com.google.appengine.demos.channeltactoe.TicTacToeServlet.doGet(TicTacToeServlet.java:77)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    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 com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:58)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)
    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 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:351)
    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.HttpParser.parseNext(HttpParser.java:547)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Original issue reported on code.google.com by eostermu...@gmail.com on 31 Oct 2011 at 1:06

GoogleCodeExporter commented 9 years ago
In Game.Java
replace getChannelKey() function with

public String getChannelKey(String user) {
String channelkey = user + KeyFactory.keyToString(key);
int length = channelkey.length();
if(length > 64){
channelkey = channelkey.substring(length - 64, length);
}
return channelkey;
}

Original comment by soad.ha...@gmail.com on 22 Feb 2012 at 1:07