Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    Pasquien is on a distinguished road

      0  

    Default NullPointerException using GridstateHandler(Grid<M> component)

    NullPointerException using GridstateHandler(Grid<M> component)


    Using public constructor GridStateHandler(Grid<M> component) results in a NullPointerException.
    Only the GridStateHandler(Grid<M> component, String key) works...

    I think this constructor would be something like...

    public(GridStateHandler(Grid<M> component){
    this(component, component.getStateId());
    }
    Last edited by Pasquien; 14 May 2012 at 6:45 AM. Reason: solving the problem

  2. #2
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    Thanks for the report. I've filed a bug against the team to have them take a look. At a glance, something like what you're proposing seems to make sense. In any case, I'll update this thread with any changes we make.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,634
    Vote Rating
    79
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    I've been looking at this and at a simple test case, but I can't make it break as you've described. Here's the simple code I am invoking:

    Code:
      public void testSimpleHandler() {
        ListStore<String> store = new ListStore<String>(new ModelKeyProvider<String>() {
          @Override
          public String getKey(String item) {
            return item;
          }
        });
        ColumnConfig<String, String> col = new ColumnConfig<String, String>(new IdentityValueProvider<String>());
        ColumnModel<String> columns = new ColumnModel<String>(Collections.<ColumnConfig<String,?>>singletonList(col));
        
        Grid<String> grid = new Grid<String>(store, columns);
        
        GridStateHandler<String> handler = new GridStateHandler<String>(grid);
        handler.loadState();
      }
    If you can provide a sample that doesn't work or a stack trace, we can try to help you further.

    I'd also point out that http://www.sencha.com/examples/#ExamplePlace:basicgrid uses the 1-argument constructor, and seems to work correctly:
    Code:
          GridStateHandler<Stock> state = new GridStateHandler<Stock>(grid);
          state.loadState();
    The only way I can cause an exception is by failing to register a state provider. Such a provider can be specified like this:
    Code:
    StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));

  4. #4
    Ext GWT Premium Member
    Join Date
    Jun 2011
    Posts
    71
    Vote Rating
    0
    Aleksandar Krstik is on a distinguished road

      0  

    Default


    Sorry for bumping a very old thread, but I figured it's better than creating a new one for the same (or almost the same) issue.

    I was trying to implement the StateManager in my application today, and I ran into some problems. I did some debugging and it turns out my program runs just fine if I comment out the line: GridStateHandler<NotificationDTO> state = new GridStateHandler<NotificationDTO>(grid);

    I even tried the sample code and it produced the same error on initializing the GridStateHandler. It leads me to think that the initialization of the StateManager isn't functioning as it should. I do have the line: StateManager.get().setProvider(new CookieProvider("/", null, null, GXT.isSecure()));
    in my code but I get the same error with or without it.

    I should point out that I'm using both gxt 2 and gxt 3 in my app (migrating) but all classes related to saving states are imported from the com.sencha.gxt packages.

    Here's a stack trace I get in console:
    Code:
            
    Caused by: java.lang.ClassNotFoundException: null
    	at com.google.gwt.dev.shell.CompilingClassLoader$MultiParentClassLoader.findClass(CompilingClassLoader.java:365)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    	at com.google.web.bindery.autobean.shared.impl.StringQuoter.createSplittable(StringQuoter.java:58)
    	at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.<init>(AbstractAutoBean.java:71)
    	at com.sencha.gxt.state.client.GridStateHandler_GridStateAutoBean.<init>(GridStateHandler_GridStateAutoBean.java:62)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    	at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    	at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    	at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    	at com.google.web.bindery.autobean.gwt.client.impl.JsniCreatorMap$.invoke$(JsniCreatorMap.java)
    	at com.google.web.bindery.autobean.gwt.client.impl.JsniCreatorMap$.create$(JsniCreatorMap.java:46)
    	at com.google.web.bindery.autobean.gwt.client.impl.AbstractAutoBeanFactory.create(AbstractAutoBeanFactory.java:38)
    	at com.sencha.gxt.state.client.StateManager.getDefaultStateInstance(StateManager.java:94)
    	at com.sencha.gxt.state.client.AbstractStateHandler.<init>(AbstractStateHandler.java:46)
    	at com.sencha.gxt.state.client.ComponentStateHandler.<init>(ComponentStateHandler.java:31)
    	at com.sencha.gxt.state.client.GridStateHandler.<init>(GridStateHandler.java:101)
    	at com.artisol.client.ui.notifications.Notifications.testSimpleHandler(Notifications.java:146)
    	at com.artisol.client.ui.notifications.Notifications.asWidget(Notifications.java:99)
    	at com.google.gwt.user.client.ui.Widget.asWidgetOrNull(Widget.java:46)
    	at com.sencha.gxt.widget.core.client.container.Container.add(Container.java:72)
    	at com.sencha.gxt.widget.core.client.event.BeforeShowEvent.dispatch(BeforeShowEvent.java:63)
    	at com.sencha.gxt.widget.core.client.event.BeforeShowEvent.dispatch(BeforeShowEvent.java:1)
    	at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    	at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    	at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    	at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    	at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    	at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)
    	at com.sencha.gxt.widget.core.client.Component.fireEvent(Component.java:291)
    	at com.sencha.gxt.widget.core.client.Component.fireCancellableEvent(Component.java:1224)
    	at com.sencha.gxt.widget.core.client.Window.show(Window.java:952)
    	at com.sencha.gxt.widget.core.client.event.SelectEvent.dispatch(SelectEvent.java:65)
    	at com.sencha.gxt.widget.core.client.event.SelectEvent.dispatch(SelectEvent.java:1)
    	at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    	at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    	at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    	at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    	at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)
    	at com.sencha.gxt.cell.core.client.AbstractEventCell.fireEvent(AbstractEventCell.java:89)
    	at com.sencha.gxt.cell.core.client.ButtonCell.onClick(ButtonCell.java:455)
    	at com.sencha.gxt.cell.core.client.ButtonCell.onBrowserEvent(ButtonCell.java:298)
    	at com.sencha.gxt.widget.core.client.cell.CellComponent.onBrowserEvent(CellComponent.java:224)
    	at com.sencha.gxt.widget.core.client.button.CellButtonBase.onBrowserEvent(CellButtonBase.java:163)
    	at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)
    	at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)
    	at sun.reflect.GeneratedMethodAccessor302.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:172)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    	at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    	at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    	at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    	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:213)
    	at sun.reflect.GeneratedMethodAccessor298.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:172)
    	at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
    	at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    	at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    	at java.lang.Thread.run(Thread.java:662)
    Can anyone shed some light on the subject? Thank you in advance!

  5. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,634
    Vote Rating
    79
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    A ClassNotFoundException suggests that some class is missing from your path. Can you confirm that have the json.jar on your classpath and that these classes are available?
    Code:
    import org.json.JSONArray;
    import org.json.JSONException;
    import org.json.JSONObject;
    Those three classes are used in JsonSplittable, the return value from StringQuoter.createSplittable which is where your app is throwing the ClassNotFoundException. I suspect if you fix this setup issue, the error will go away, otherwise we will need to see a test sample that is having the problem to get more info.

  6. #6
    Ext GWT Premium Member
    Join Date
    Jun 2011
    Posts
    71
    Vote Rating
    0
    Aleksandar Krstik is on a distinguished road

      0  

    Default


    Thanks a lot! I added the following dependency in maven and it works ok now:

    Code:
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>20131018</version>
            </dependency>
    Out of curiosity, is this jar expected to be present in all GXT projects by default? I mean, since it's required for execution was my project setup incorrectly so it didn't have it or..? I'm just wondering because I haven't seen any documentation which mentions it as a requirement. Thanks again!

  7. #7
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,634
    Vote Rating
    79
    Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice Colin Alworth is just really nice

      0  

    Default


    This is actually required by GWT itself, and since GXT uses GWT, GXT needs this artifact. GWT uses this to run its AutoBean tools, and GXT uses those autobeans for dealing with state in a easy-to-serialize way.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar