3 Replies Latest reply on Apr 1, 2003 11:18 AM by 3004

    NullPointerException in 2.5 trying to load class fields.

    3004
      In 2.5b1 we have encountered an error: when Kodo tries to load field of
      persistent object it throws NullPointerException:

      [FATAL] [DefaultAWTExceptionHandler] [14:35:09] - System error occured.
      com.solarmetric.kodo.runtime.FatalException:
      java.lang.NullPointerException
      NestedThrowables:
      java.lang.NullPointerException
           at
      com.solarmetric.kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:2062)
           at
      com.solarmetric.kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:737)
           at ua.extreme.cardwarehouse.card.Card.jdoGetdeck(Card.java)
           at ua.extreme.cardwarehouse.card.Card.setCurrentWarehouse(Card.java:147)

      I've attached source and class file of the Card class.


        • 1. Re: NullPointerException in 2.5 trying to load class fields.
          3004
          Alexey,

          Could you post the full stack trace please? What you've posted is just
          the wrapper around the NPE.

          -Patrick


          On Fri, 28 Mar 2003 07:49:00 -0500, Alexey Maslov wrote:
          In 2.5b1 we have encountered an error: when Kodo tries to load field of
          persistent object it throws NullPointerException:

          [FATAL] [DefaultAWTExceptionHandler] [14:35:09] - System error occured.
          com.solarmetric.kodo.runtime.FatalException:
          java.lang.NullPointerException
          NestedThrowables:
          java.lang.NullPointerException
               at
          com.solarmetric.kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:2062)
               at
          com.solarmetric.kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:737)
               at ua.extreme.cardwarehouse.card.Card.jdoGetdeck(Card.java) at
               ua.extreme.cardwarehouse.card.Card.setCurrentWarehouse(Card.java:147)

          I've attached source and class file of the Card class.
          --
          Patrick Linskey
          SolarMetric Inc.
          • 2. Re: NullPointerException in 2.5 trying to load class fields.
            3004
            Patric,

            Here it is:

            [FATAL] [DefaultAWTExceptionHandler] [10:39:28] - System error occured.
            com.solarmetric.kodo.runtime.FatalException:
            java.lang.NullPointerException
            NestedThrowables:
            java.lang.NullPointerException
                 at
            com.solarmetric.kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:2062)
                 at
            com.solarmetric.kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:737)
                 at ua.extreme.cardwarehouse.card.Card.jdoGetdeck(Card.java)
                 at ua.extreme.cardwarehouse.card.Card.setCurrentWarehouse(Card.java:149)
                 at
            ua.extreme.cardwarehouse.warehouse.Warehouse.placeCard(Warehouse.java:120)
                 at
            ua.extreme.cardwarehouse.warehouse.Warehouse.placeCards(Warehouse.java:131)
                 at
            ua.extreme.cardwarehouse.card.ui.PlaceCardsToWarehouseInteractor.storePressed(PlaceCardsToWarehouseInteractor.java:48)
                 at
            ua.extreme.cardwarehouse.card.ui.PlaceCardsDialog$3.actionPerformed(PlaceCardsDialog.java:77)
                 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
                 at
            javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
                 at
            javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
                 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
                 at
            javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
                 at java.awt.Component.processMouseEvent(Component.java:5134)
                 at java.awt.Component.processEvent(Component.java:4931)
                 at java.awt.Container.processEvent(Container.java:1566)
                 at java.awt.Component.dispatchEventImpl(Component.java:3639)
                 at java.awt.Container.dispatchEventImpl(Container.java:1623)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
                 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
                 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
                 at java.awt.Container.dispatchEventImpl(Container.java:1609)
                 at java.awt.Window.dispatchEventImpl(Window.java:1590)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
                 at
            java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
                 at
            java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
                 at
            java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
                 at java.awt.Dialog.show(Dialog.java:538)
                 at
            ua.extreme.cardwarehouse.storekeeper.ui.WarehouseManagementPane$1.actionPerformed(WarehouseManagementPane.java:67)
                 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
                 at
            javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
                 at
            javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
                 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
                 at
            javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
                 at java.awt.Component.processMouseEvent(Component.java:5134)
                 at java.awt.Component.processEvent(Component.java:4931)
                 at java.awt.Container.processEvent(Container.java:1566)
                 at java.awt.Component.dispatchEventImpl(Component.java:3639)
                 at java.awt.Container.dispatchEventImpl(Container.java:1623)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
                 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
                 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
                 at java.awt.Container.dispatchEventImpl(Container.java:1609)
                 at java.awt.Window.dispatchEventImpl(Window.java:1590)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
                 at
            java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
                 at
            java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
                 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
                 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
                 at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
            NestedThrowablesStackTrace:
            java.lang.NullPointerException
                 at com.solarmetric.kodo.runtime.PCDataImpl.store(PCDataImpl.java:348)
                 at
            com.solarmetric.kodo.runtime.datacache.DataCacheStoreManager.load(DataCacheStoreManager.java:348)
                 at
            com.solarmetric.kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:2054)
                 at
            com.solarmetric.kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:737)
                 at ua.extreme.cardwarehouse.card.Card.jdoGetdeck(Card.java)
                 at ua.extreme.cardwarehouse.card.Card.setCurrentWarehouse(Card.java:149)
                 at
            ua.extreme.cardwarehouse.warehouse.Warehouse.placeCard(Warehouse.java:120)
                 at
            ua.extreme.cardwarehouse.warehouse.Warehouse.placeCards(Warehouse.java:131)
                 at
            ua.extreme.cardwarehouse.card.ui.PlaceCardsToWarehouseInteractor.storePressed(PlaceCardsToWarehouseInteractor.java:48)
                 at
            ua.extreme.cardwarehouse.card.ui.PlaceCardsDialog$3.actionPerformed(PlaceCardsDialog.java:77)
                 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
                 at
            javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
                 at
            javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
                 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
                 at
            javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
                 at java.awt.Component.processMouseEvent(Component.java:5134)
                 at java.awt.Component.processEvent(Component.java:4931)
                 at java.awt.Container.processEvent(Container.java:1566)
                 at java.awt.Component.dispatchEventImpl(Component.java:3639)
                 at java.awt.Container.dispatchEventImpl(Container.java:1623)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
                 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
                 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
                 at java.awt.Container.dispatchEventImpl(Container.java:1609)
                 at java.awt.Window.dispatchEventImpl(Window.java:1590)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
                 at
            java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
                 at
            java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
                 at
            java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
                 at java.awt.Dialog.show(Dialog.java:538)
                 at
            ua.extreme.cardwarehouse.storekeeper.ui.WarehouseManagementPane$1.actionPerformed(WarehouseManagementPane.java:67)
                 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
                 at
            javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
                 at
            javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
                 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
                 at
            javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
                 at java.awt.Component.processMouseEvent(Component.java:5134)
                 at java.awt.Component.processEvent(Component.java:4931)
                 at java.awt.Container.processEvent(Container.java:1566)
                 at java.awt.Component.dispatchEventImpl(Component.java:3639)
                 at java.awt.Container.dispatchEventImpl(Container.java:1623)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
                 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
                 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
                 at java.awt.Container.dispatchEventImpl(Container.java:1609)
                 at java.awt.Window.dispatchEventImpl(Window.java:1590)
                 at java.awt.Component.dispatchEvent(Component.java:3480)
                 at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
                 at
            java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
                 at
            java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
                 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
                 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
                 at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)


            Patrick Linskey wrote:
            Alexey,

            Could you post the full stack trace please? What you've posted is just
            the wrapper around the NPE.

            -Patrick


            On Fri, 28 Mar 2003 07:49:00 -0500, Alexey Maslov wrote:

            In 2.5b1 we have encountered an error: when Kodo tries to load field of
            persistent object it throws NullPointerException:

            [FATAL] [DefaultAWTExceptionHandler] [14:35:09] - System error occured.
            com.solarmetric.kodo.runtime.FatalException:
            java.lang.NullPointerException
            NestedThrowables:
            java.lang.NullPointerException
                 at
            com.solarmetric.kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:2062)
                 at
            com.solarmetric.kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:737)
                 at ua.extreme.cardwarehouse.card.Card.jdoGetdeck(Card.java) at
                 ua.extreme.cardwarehouse.card.Card.setCurrentWarehouse(Card.java:147)

            I've attached source and class file of the Card class.
            • 3. Re: NullPointerException in 2.5 trying to load class fields.
              3004
              Alexey,

              Thanks. I've logged a bug for this issue:

              http://bugzilla.solarmetric.com/show_bug.cgi?id=612

              The only current workaround is to disable caching for the class in
              question, by setting the 'can-cache' metadata extension.

              -Patrick

              --
              Patrick Linskey
              SolarMetric Inc.