Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 682963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:39:17+00:00 2026-05-14T01:39:17+00:00

I am using nested Asynchronous callbacks to save my front-end data to the back-end

  • 0

I am using nested Asynchronous callbacks to save my front-end data to the back-end database. The data is being save into the tables the way i want them to, but it is printing that it failed. Here is the code:

    if(erasync == null)
        erasync = GWT.create(EntityRelationService.class);
    AsyncCallback<Void> callback = new AsyncCallback<Void>(){
        public void onFailure(Throwable caught) {
            String msg = caught.getLocalizedMessage();
             if (caught instanceof NotFoundException) {
                msg = ((NotFoundException) caught).getType()
                      + ((NotFoundException) caught).getMessage();
             }
           System.out.println("Failed" + msg);
        }
        public void onSuccess(Void result) {
                    if(erasync == null)
                        erasync = GWT.create(EntityRelationService.class);
                    AsyncCallback<Void> callbackOthers = new AsyncCallback<Void>(){
                        @Override
                        public void onFailure(Throwable caught) {
                            String msg = caught.getLocalizedMessage();
                             if (caught instanceof NotFoundException) {
                                msg = ((NotFoundException) caught).getType()
                                      + ((NotFoundException) caught).getMessage();
                             }
                           System.out.println("Failed" + msg);
caught.printStackTrace();
                        }
                        public void onSuccess(Void result) {
                            System.out.println("Success");
                        }                           
                    };
                    erasync.setEntityType(name, top, left, pname, callbackOthers);
        };
        erasync.setProject(name, callback);

Here it prints successful for the first callback, but for the nested one it says failed though it saves the value. Here is the stack that it prints for failure:

com.google.gwt.user.client.rpc.StatusCodeException: 
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:192)
    at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
    at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:393)
    at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
    at java.lang.Thread.run(Thread.java:619)

Am i missing something?

Any input will be of great help.
Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:39:18+00:00Added an answer on May 14, 2026 at 1:39 am

    Hey I solved the problem. I was having this problem because the window was reloading and changing the status code when there were still asynchronous calls in process. I included the window reload at the end of my method and its working fine now. Thanks all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In SharePoint it has a nasty habit of using nested tables everywhere. I want
I have a problem with animations using jQuery on nested tables. I want to
I'm using nested routes and I want to provide some sort of a shortcut
I'm using nested sets to store hierarchical data in a MyISAM table; the table
I have a problem with the normal way rails operates when using nested forms
I'm currently using nested comments to quickly activate/deactivate code during testing, the way I'm
I have da database with categories using nested sets. i have a function, that
I am working on a web application and using nested tables quite a bit
I am trying to create a 2d array using nested containers. I want to
Instead of using HTML tables, I'm thinking of just using nested list structures to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.