500 server error, while deploying a google app

1 view
Skip to first unread message

dab7 via StackOverflow

unread,
Apr 29, 2013, 9:41:45 AM4/29/13
to google-appengin...@googlegroups.com

this is my first google app engine servlet which i wanted to make it crawling a website so i created threads using backgroundThread in app engine, my problem is when i run this application on the localhost:8888 it works correctly and do the task it's supposed to do.

Youm7 youm7Crawler = new Youm7(); log.info("start 1"); Thread youm7Thread = ThreadManager.createBackgroundThread(youm7Crawler); log.info("start 2"); log.info("start 3"); youm7Thread.start(); but once i try deploying it as on server i got an error 500 server and i get this critical error in the log

    `Uncaught exception from servlet
java.lang.IllegalStateException: This feature is only available to backend instances.
    at com.google.appengine.api.system.SystemServiceImpl.translateException(SystemServiceImpl.java:40)
    at com.google.appengine.api.system.SystemServiceImpl.startBackgroundRequest(SystemServiceImpl.java:28)
    at com.google.apphosting.runtime.ApiProxyImpl$BackgroundThreadFactory.newThread(ApiProxyImpl.java:1125)
    at com.google.appengine.api.ThreadManager.createBackgroundThread(ThreadManager.java:88)
    at newscrawler.crawlerServlet.doGet(crawlerServlet.java:30)
    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.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:57)
    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 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.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:266)
    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 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
    at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:722)
2013-04-29 06:27:25.205 /myreminderapp 200 66ms 0kb Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31`

so what should i do to make it works on the server like on my local



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/16280086/500-server-error-while-deploying-a-google-app

skywalker via StackOverflow

unread,
Apr 29, 2013, 10:01:45 AM4/29/13
to google-appengin...@googlegroups.com

The deployment of GAE can be on two types of machines, one which are frontend (default), they have lot of restrictions but they can scale very fast. The other ones are backends, backend instances do not have as much restrictions as front end. Since your application uses Threds, it can only run as backend instance. You need to configure your applications backends via an xml file, more details here You need to deploy it as backend instance, When you are uploading your application through google eclipse plugin, the window has an option to select which frontends and backends to deploy.

-Hope this helps



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/16280086/500-server-error-while-deploying-a-google-app/16280572#16280572
Reply all
Reply to author
Forward
0 new messages