GoogleJsonResponse Error: 500 Internal Server Error

I wrote a small application running in the local environment without any problems, but after I deployed the application to the Google App Engibe, it stopped working. Here is the client side code:

    CollectionResponseLong asd = null;
    try {
        asd = getEndpoint().getClosePeople(id).execute();
    } catch (IOException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }

I see that it works on the server side, as well as with the following code:

@SuppressWarnings({ "unchecked", "unused" })
@ApiMethod(name = "getClosePeople",path = "getClosePeople")
public CollectionResponse<Long> getClosePeople(@Named("id") Long id)    {

    PersistenceManager mgr = getPersistenceManager();
    Cursor cursor = null;
    List<Long> execute = null;
    String cursorString = null; 
    Integer limit = null; 

        User user = mgr.getObjectById(User.class, id);
    mgr = getPersistenceManager();
    Query query = mgr.newQuery(User.class);
    if (cursorString != null && cursorString != "") {
        cursor = Cursor.fromWebSafeString(cursorString);
        HashMap<String, Object> extensionMap = new HashMap<String, Object>();
        extensionMap.put(JDOCursorHelper.CURSOR_EXTENSION, cursor);
        query.setExtensions(extensionMap);
    }

//  query.setFilter("GeoHash == '" + user.getGeoHash() +"'" + " && Id != " + id);
    query.setFilter("GeoHash == '" + user.getGeoHash() +"'" + " && Id != " + id);
    query.setResult("Id");

    if (cursorString != null && cursorString != "") {
        cursor = Cursor.fromWebSafeString(cursorString);
        HashMap<String, Object> extensionMap = new HashMap<String, Object>();
        extensionMap.put(JDOCursorHelper.CURSOR_EXTENSION, cursor);
        query.setExtensions(extensionMap);
    }

    if (limit != null) {
        query.setRange(0, limit);
    }
    execute = (List<Long>) query.execute();
    cursor = JDOCursorHelper.getCursor(execute);
    if (cursor != null)
        cursorString = cursor.toWebSafeString();
    for (Long obj : execute)
        ;
    System.out.println("STRING " + execute.toString());


    mgr.close();


    System.out.println(CollectionResponse.<Long> builder().setItems(execute)
    .setNextPageToken(cursorString).build().getItems().toString());


    return CollectionResponse.<Long> builder().setItems(execute)
            .setNextPageToken(cursorString).build();

    }   

I see in the server side logs that there is no problem before the return statement, because System.out prints the answer I want. But I get the following error in eclipse, and it’s also interesting that the Google Application Admin console is missing an error log

com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal server error:

. Call Builder # setApplicationName.  com.google.api.client.googleapis.json.GoogleJsonResponseException: 500  {   "": 500,   "": [{     "": "",     "": " ",     "reason": "internalError"  }],   "": " "  } com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113) com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest $1.interceptResponse(AbstractGoogleClientRequest.java:312) com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1045) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343) at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)

,

, , , : )

String . . , - , ( Google). : String String [] StringObject StringArrayObject, , .

+4
2

" " , AppEngine , , , . @nebulae, appengine-web.xml. , , , . Eclipse Properties → Google → AppEngine → , .

: "Google App Ebgşbe" "Google App Engine". , , - , , .

, , .

0

, 3 cloudEndpoint.getResult(). , , .

0

Source: https://habr.com/ru/post/1530851/


All Articles