Pbs with GWT + Eclipse + Jetty + Neo4J

45 views
Skip to first unread message

Guillen Antonio

unread,
Oct 12, 2021, 1:09:53 PM10/12/21
to GWT Users
Hi all,

I am struggling with a pb using RPC:

When I use the service to create and store my objects in my DB (Neo4J) using remote service, all is Fine.
When I try to load my objects all is ok in my service class and in Neo4J as well. But at the last line of the method public static void writeResponse(ServletContext servletContext,  HttpServletResponse response, String responseContent, boolean gzipResponse)  throws IOException {

I have an exception.

Here is the method of com.google.gwt.user.server.rpc.RPCServletUtils


  public static void writeResponse(ServletContext servletContext,
      HttpServletResponse response, String responseContent, boolean gzipResponse)
      throws IOException {

    byte[] responseBytes = responseContent.getBytes(CHARSET_UTF8);
    if (gzipResponse) {
      // Compress the reply and adjust headers.
      //
      ByteArrayOutputStream output = null;
      GZIPOutputStream gzipOutputStream = null;
      Throwable caught = null;
      try {
        output = new ByteArrayOutputStream(responseBytes.length);
        gzipOutputStream = new GZIPOutputStream(output);
        gzipOutputStream.write(responseBytes);
        gzipOutputStream.finish();
        gzipOutputStream.flush();
        setGzipEncodingHeader(response);
        responseBytes = output.toByteArray();
      } catch (IOException e) {
        caught = e;
      } finally {
        if (null != gzipOutputStream) {
          gzipOutputStream.close();
        }
        if (null != output) {
          output.close();
        }
      }

      if (caught != null) {
        servletContext.log("Unable to compress response", caught);
        response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        return;
      }
    }

    // Send the reply.
    //
    response.setContentLength(responseBytes.length);
    response.setContentType(CONTENT_TYPE_APPLICATION_JSON_UTF8);
    response.setStatus(HttpServletResponse.SC_OK);
    response.setHeader(CONTENT_DISPOSITION, ATTACHMENT);
    response.getOutputStream().write(responseBytes);
  }

And the return message on my console is:

200 - POST /spotgwt/spotData (127.0.0.1) 501 bytes
   Request headers
      Host: 127.0.0.1:8887
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
      Accept: */*
      Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
      Accept-Encoding: gzip, deflate
      Content-Type: text/x-gwt-rpc; charset=utf-8
      X-GWT-Permutation: A082E84D087467DED16699006D694A7B
      X-GWT-Module-Base: http://127.0.0.1:8887/spotgwt/
      Content-Length: 228
      Origin: http://127.0.0.1:8887
      DNT: 1
      Connection: keep-alive
      Referer: http://127.0.0.1:8887/SpotGWT.html
      Sec-Fetch-Dest: empty
      Sec-Fetch-Mode: cors
      Sec-Fetch-Site: same-origin
   Response headers
      Date: Tue, 12 Oct 2021 16:57:51 GMT
      Content-Encoding: gzip
      Content-Length: 501
      Content-Type: application/json; charset=utf-8
      Content-Disposition: attachment

Can you help me.

Thanks a lot

Antonio

Michael Conrad

unread,
Oct 12, 2021, 1:31:42 PM10/12/21
to google-we...@googlegroups.com
You didn't provide the exception stack trace.... It is needed for anyone to be able to help you.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/9073c1bb-20b6-4c19-90af-d462e8034716n%40googlegroups.com.

David Nouls

unread,
Oct 15, 2021, 9:32:31 AM10/15/21
to GWT Users
What is the exception stack trace ?
--
Reply all
Reply to author
Forward
0 new messages