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

  • Home
  • SEARCH
  • 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 8632709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:23:21+00:00 2026-06-12T09:23:21+00:00

I’m creating a login application on Eclipse using Google Web Toolkit(GWT). The code checks

  • 0

I’m creating a login application on Eclipse using Google Web Toolkit(GWT). The code checks for the username and password and if its correct, it shows the o/p as welcome. Still after compiling it is giving me errors.I’m sharing both code and the error message. Please help me out.

    package com.vin.client;
import java.sql.DriverManager;
import java.sql.ResultSet;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dev.generator.ast.Statement;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.*;

public class HelloWorld implements EntryPoint{
    public void onModuleLoad() {
        Button click=new Button("Click Here");
        Label name=new Label("Enter Name");
        Label passwrd=new Label("Enter Password");
        final TextBox t_name=new TextBox();
        final TextBox t_passwrd=new TextBox();
        click.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent ev) {
            try {
                String temp_user=t_name.getText();
                String temp_pass=t_passwrd.getText();
                java.sql.Connection con = null;
                Class.forName("org.hsqldb.jdbcDriver");
                con = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/", "SA", "");
                Statement st=(Statement) con.createStatement();
                ResultSet rs=((java.sql.Statement) st).executeQuery("select username,password from lgfrm");
                String user=rs.getString(1);
                String pass=rs.getString(2);
                if(temp_user.equals(user) && temp_pass.equals(pass)) {
                    Window.alert("Welcome");
                }
                else {
                    Window.alert("Please enter valid details");
                }
        }
        catch (Exception ae) {}
        }
    });
        RootPanel.get().add(name);
        RootPanel.get().add(t_name);
        RootPanel.get().add(passwrd);
        RootPanel.get().add(t_passwrd);
        RootPanel.get().add(click);
    }
    }

Error Message is———-

Compiling module com.vin.HelloWorld Exception in thread
“UnitCacheLoader” java.lang.RuntimeException: Unable to read from byte
cache at
com.google.gwt.dev.util.DiskCache.transferFromStream(DiskCache.java:166)
at
com.google.gwt.dev.util.DiskCacheToken.readObject(DiskCacheToken.java:87)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
…………..and many more like this….Please help me out

  • 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-12T09:23:21+00:00Added an answer on June 12, 2026 at 9:23 am

    Try something like following for Server side :

    UserService.java

    @RemoteServiceRelativePath("userService")
    public interface UserService extends RemoteService {
        String loginUser(String username,String password);
    }
    

    UserServiceAsync.java

    public interface UserServiceAsync {
        void loginUser(String username, String password, AsyncCallback<String> callback);
    }
    

    UserServiceImpl.java

    public class UserServiceImpl extends RemoteServiceServlet  implements UserService {
    
            public String loginUser(String username, String password){
                //database interaction
                return "result"; //return success or failure depending upon logic
        }
    }
    

    Follow Communicate with a Server in GWT and the Anatomy of service
    enter image description here

    For Client Side :

    public class HelloWorld implements EntryPoint{
        //(1) Create the client proxy.
        private UserServiceAsync userService = (UserServiceAsync) GWT.create(UserService.class);
        public void onModuleLoad() {
            Button click=new Button("Click Here");
            Label name=new Label("Enter Name");
            Label passwrd=new Label("Enter Password");
            final TextBox t_name=new TextBox();
            final TextBox t_passwrd=new TextBox();
            click.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent ev) {
                     String temp_user=t_name.getText();
                     String temp_pass=t_passwrd.getText();   
                     /// (2) Create an asynchronous callback and Make the call
                     userService.loginUser(temp_user, temp_pass, new AsyncCallback<String>() {
                         public void onFailure(Throwable caught) {
                                 Window.alert("Please enter valid details");
                          }
    
                         public void onSuccess(String result) {
                             Window.alert("Welcome");
                         }
                     });//end of service call
           });//end of clickhandler
            RootPanel.get().add(name);
            RootPanel.get().add(t_name);
            RootPanel.get().add(passwrd);
            RootPanel.get().add(t_passwrd);
            RootPanel.get().add(click);
        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.