Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClassCastException:com.google.appengine.tools.development.ApiProxyLocalImpl cannot be cast to com.google.appengine.tools.development.ApiProxyLocal

I'm new in developing maven application and deploy to google app engine. i'm using appengine 1.9.0 and eclipse kepler 4.3

However when I try to run, I got an error and according to this blog by chris, It suggested to remove this jar.

appengine-api-labs 
appengine-api-stubs 
appengine-testing

I already removed it in the libraries and tried maven clean but the error still appear. below is my libraries.

libraries

below is the full console error:

WARNING: failed _ah_ServeBlobFilter: java.lang.ClassCastException: com.google.appengine.tools.development.ApiProxyLocalImpl cannot be cast to com.google.appengine.tools.development.ApiProxyLocal
3 20, 2014 2:34:57 午前 com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@87ec13{/,C:\Users\Annette\Desktop\WebCaller\src\main\webapp}
java.lang.ClassCastException: com.google.appengine.tools.development.ApiProxyLocalImpl cannot be cast to com.google.appengine.tools.development.ApiProxyLocal
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.init(ServeBlobFilter.java:55)
    at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:224)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:250)
    at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:305)
    at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
    at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:79)
    at com.google.appengine.tools.development.Modules.startup(Modules.java:97)
    at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:255)
    at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
    at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:213)
    at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:211)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:211)
    at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:277)
    at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
    at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:219)
    at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:210)

can anyone point it out? Thanks.

like image 622
blitzen12 Avatar asked Mar 20 '14 02:03

blitzen12


1 Answers

I took the following steps to resolve the issue:

  1. Removing the appengine-api-stubs and appengine-testing
  2. On Properties, and Google > App Engine, I made sure to select the default "App Engine - 1.9.1"
  3. On properties build path, I removed all JARs related to the GAE v1.9.1 and instead added the GAE library from "Add Library"

Surprisingly, my localhost deployment worked eventhough I had appengine-api-labs on my WEB-INF/lib.

Lastly, my WEB-INF/lib contains the following:

  • appengine-agent.jar
  • appengine-agentimpl.jar
  • appengine-api-1.0-sdk-1.9.1.jar
  • appengine-api-labs-1.9.1.jar
  • appengine-api-labs.jar
  • appengine-endpoints-deps.jar
  • appengine-endpoints.jar
  • appengine-jsr107cache-1.9.1.jar

I hope that helps. It worked for me and chances are it might work for you.

like image 83
CAS Avatar answered Sep 24 '22 03:09

CAS