简体   繁体   中英

Google App Engine: java.lang.NoClassDefFoundError: com/google/appengine/api/datastore/Query$Filter

I'm getting this error in production only - the development server works fine.

An older version of my app works fine in production as well - but every time I do a new deployment I get this error when I access my app. I tried to recompile the particular class where the error is thrown and to change the code, but still no luck.

I'm not really sure, but I guess it has something to do with the deployment process itself .. I'm deploying from Eclipse. I'm using:

  • Eclipse Version: Oxygen.3 Release (4.7.3)
  • Google Cloud Tools SDK 194.0.0
  • App Engine 1.9.63

Thanks!

UPDATE:

Here is some simple test code:

@Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
    res.setContentType("text/plain");
    res.setCharacterEncoding("UTF-8");

    // this throws: java.lang.NoClassDefFoundError - only in PRODUCTION
    Query.Filter filter = Query.FilterOperator.EQUAL.of("name", null);

    res.getWriter().print("Hello App Engine: " + filter);
}

This fails in production but works on the development server!

Update 2: Opened an issue with Google: https://issuetracker.google.com/issues/76144204

This is a Google issue which is currently being looked into: https://issuetracker.google.com/issues/76144204

The fix for the moment is to copy appengine-api-1.0-sdk-1.9.63.jar file into the WEB-INF/lib directory as explained in this comment: https://issuetracker.google.com/issues/76144204#comment45

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM