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 9161063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:53:01+00:00 2026-06-17T13:53:01+00:00

I am using a GWT for client side application and REST web service instead

  • 0

I am using a GWT for client side application and REST web service instead of server(not using RPC or servlets in GWT). I want to convert java object to JSON and pass JSON object from client to server and also server to client. But for processing I want to convert JSON object to java object i server. GSON is not supporting by GWT is there any way to convert java object to JSON object and vice versa?

I did a sample project using Autobean framework for converting java object to JSON , but I got the following error

[ERROR] [gwtmodules] - Deferred binding result type 'com.mycompany.gwtmodules.client.MyFactory' should not be abstract
] Failed to create an instance of 'com.mycompany.gwtmodules.client.Gwtmodules' via deferred binding 
java.lang.RuntimeException: Deferred binding failed for 'com.mycompany.gwtmodules.client.MyFactory' (did you forget to inherit a required module?)

Following is my code

public interface Test {


    public int getAge();
    public void setAge(int age);
    public String getName();
    public void setName(String name);

}

import com.google.web.bindery.autobean.shared.AutoBean;
import com.google.web.bindery.autobean.shared.AutoBeanFactory;

public interface MyFactory extends AutoBeanFactory{
AutoBean<Test> test();
}
public class Gwtmodules implements EntryPoint {

    MyFactory factory = GWT.create(MyFactory.class);

    /**
     * This is the entry point method.
     */
    Test makeTest() {
        // Construct the AutoBean
        AutoBean<Test> test = factory.test();

        // Return the Person interface shim
        return test.as();
    }

    Test deserializeFromJson(String json) {
        AutoBean<Test> bean = AutoBeanCodex.decode(factory, Test.class, json);
        return bean.as();
    }

    String serializeToJson(Test test) {
        // Retrieve the AutoBean controller
        AutoBean<Test> bean = AutoBeanUtils.getAutoBean(test);
        return AutoBeanCodex.encode(bean).getPayload();
    }

    public void onModuleLoad() {

        final Test test = makeTest();
        test.setAge(44);
        test.setName("achu");
        final Button button = new Button("Click here");
        button.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                String s = serializeToJson(test);
                Window.alert("alert" + s);

            }
        });
    }
}
  • 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-06-17T13:53:03+00:00Added an answer on June 17, 2026 at 1:53 pm

    is there any way to convert java object to JSON object and vice versa?

    You can use autobean framework of GWT. It can be used at server and client both side.

    • AutoBean framework

    Example:

    String serializeToJson(Test test) 
    {
        // Retrieve the AutoBean controller
        AutoBean<Test> bean = AutoBeanUtils.getAutoBean(test);
        return AutoBeanCodex.encode(bean).getPayload();
    }
    
    Test deserializeFromJson(String json) 
    {     
        AutoBean<Test> bean = AutoBeanCodex.decode(myFactory, Test.class, json);     
        return bean.as();   
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this problem while trying to access REST web service using GWT client.
I am using GWT for my client side application. However, I am not sure
I am using GWT on the client side to connect to an application server
I am using GWT for my client side application. I am not using GWT/Java
I'm using GWT RPC to communicate between client and server. I want to be
I want to upload a file using GWT to REST web service. But I
I’m using GWT 2.5, and RPC to exchange information between client and server. I’m
We decided to write client side application using Ext GWT it is good and
I am developing one application with GWT as client and my server side code
I have to maintain a web application built using GWT 2, GXT 2.2, RPC

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.