Results 1 to 5 of 5

Thread: Getting null exception when Attempting to use the GXT library

  1. #1
    Ext GWT Premium Member
    Join Date
    Jun 2008
    Posts
    50

    Default Getting null exception when Attempting to use the GXT library

    Hi I am having an issue after upgrading from 2.0.x to 2.2.4. I am using GWT 2.2. I am getting the following exception right in the entryPoint onModuleLoad function. Here are the details:

    exception
    Code:
    ERROR: Unable to load module entry point class client.com.pnt.webapp.fluvaccine.FluVaccine (see associated exception for details). java.lang.NullPointerException: null
        at com.extjs.gxt.ui.client.GXT.init(GXT.java:374)
        at com.extjs.gxt.ui.client.widget.Component.<clinit>(Component.java:203)
        at client.com.pnt.webapp.fluvaccine.FluVaccine.onModuleLoad(FluVaccine.java:19)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
        at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
        at java.lang.Thread.run(Thread.java:680)
    ERROR: Failed to load module 'FluVaccine' from user agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0.1) Gecko/20100101 Firefox/5.0.1' at 10.0.1.12:51452.
    and here is the entryPoint class. The exception fires on this line "LayoutContainer layout = new LayoutContainer();"
    Code:
    package client.com.pnt.webapp.fluvaccine;
    
    import com.extjs.gxt.themes.client.Slate;
    import com.extjs.gxt.ui.client.GXT;
    import com.extjs.gxt.ui.client.widget.LayoutContainer;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    
    /**
     * Created by IntelliJ IDEA.
     * User: mkasperski
     * Date: Aug 24, 2010
     * Time: 12:02:58 PM
     */
    public class FluVaccine implements EntryPoint
    {
        public void onModuleLoad() {
            GXT.setDefaultTheme(Slate.SLATE, false);
            LayoutContainer layout = new LayoutContainer();
            layout.setAutoHeight(true);
            layout.add(new FluVaccineMain());
    
    //        RootPanel.get().setWidgetPosition(layout, 6, 6);
    
            RootPanel.get().add(layout);
        }
    }
    Here is the GWT module xml

    Code:
    <module>
    
        <inherits name='com.google.gwt.user.User'/>
        <inherits name="com.extjs.gxt.ui.GXT"/>
        <inherits name="com.extjs.gxt.themes.Themes"/>
    
        <entry-point class="client.com.pnt.webapp.fluvaccine.FluVaccine"/>
        <servlet path="/FluVaccineServiceImpl" class="server.com.pnt.webapp.fluvaccine.FluVaccineServiceImpl"/>
        <servlet path='/ReportViewer' class='server.com.pnt.webapp.fluvaccine.servlets.ReportRunner' />
    
    </module>
    and finally the public folder structure

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    Have you tried to clear your cache?

    Are you registering the theme?

  3. #3
    Ext GWT Premium Member
    Join Date
    Jun 2008
    Posts
    50

    Default

    Hmm.. I just cleared all caches and now.. it is going hanging on the same line.. just hangs forever..

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Posts
    79

    Default

    It is because you didn't register Slate theme.
    Add this line as first to the onModuleLoad
    Code:
    ThemeManager.register(Slate.SLATE);

  5. #5
    Ext GWT Premium Member
    Join Date
    Jun 2008
    Posts
    50

    Default

    Yep.. That was the problem.. Would be nice to have a more descriptive exception.. Thank you.

    Manuel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •