Discovered what the main issue is with the single combo box not being
populated, an empty response is coming back from the server. Looked at
the Glassfish logs to find that it has handled a request from the
application and has returned a single result (expected). For some
strange reason the application is getting an empty response, why is
this different when deploying the application to Glassfish?

A status message is now appearing on the main page after doing a
reload of the application and restarting Glassfish. Now debug messages
can be seen on the client side.


DomainsCallback.java:

=================================================================================
package com.darc.autohome.automatortool.client.io;

import java.util.ArrayList;

import com.darc.autohome.automatortool.client.gui.HeaderPanel;
import com.darc.autohome.automatortool.client.model.DomainEntry;
import com.darc.autohome.automatortool.client.model.Domains;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class DomainsCallback implements AsyncCallback<Domains>{
        private HeaderPanel headerPanel;
        private ArrayList<DomainEntry> domains = new
ArrayList<DomainEntry>();

        public DomainsCallback(HeaderPanel headerPanel){
                this.headerPanel = headerPanel;
        }

        @Override
        public void onFailure(Throwable ex) {
                GWT.log("Cannot get domains", ex);
                headerPanel.updateStatus("Cannot get domains");
        }

        @Override
        public void onSuccess(Domains result) {
                try{
                        for(int pos = 0; pos < result.getDomains().length(); 
pos++) {
                        domains.add(result.getDomains().get(pos));
                }
                catch(Exception ex){
                        domains.add(result.getSingleDomain());
                }
        headerPanel.setDomains(domains.toArray(new
DomainEntry[domains.size()]));
        if(domains.size() > 0){
                headerPanel.updateStatus("");
        }
        else{
                headerPanel.updateStatus("No Domains found");
        }
        }
}
=================================================================================


Domains.java:

=================================================================================
package com.darc.autohome.automatortool.client.model;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;

public class Domains extends JavaScriptObject{
        protected Domains() {}

        public final native JsArray<DomainEntry> getDomains() /*-{
        return this.domain;
        }-*/;

        public final native DomainEntry getSingleDomain() /*-{
                return this.domain;
        }-*/;
}
=================================================================================


DomainEntry.java:

=================================================================================
package com.darc.autohome.automatortool.client.model;

import com.google.gwt.core.client.JavaScriptObject;

public class DomainEntry extends JavaScriptObject{
        protected DomainEntry() {}

        public final native String getDomainid() /*-{
                return this.domainid;
        }-*/;

        public final native void setDomainid(String domainid) /*-{
                this.domainid = domainid;
        }-*/;

        public final native String getDomainname() /*-{
                return this.domainname;
        }-*/;

        public final native void setDomainname(String domainname) /*-{
                this.domainname = domainname;
        }-*/;
}
=================================================================================

On Aug 26, 12:07 pm, Nick Apperley <napper...@gmail.com> wrote:
> Have an application that works just fine if it is deployed to Jetty
> (the built-in one), however it doesn't work as expected when it is
> deployed to a remote Glassfish server (as a WAR file). Login page
> appears just fine and the main page appears when a user has logged in
> correctly (via an HTTP POST with CORS). What is different though is
> that a single combo box is not populated (via JSONP), and a status
> message is not appearing (in a GWT Label) on the main page.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to