Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9826

Object IllegalStateException Problem

From ptreves <ptreves@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Object IllegalStateException Problem
Date 2011-11-10 08:23 -0800
Organization http://groups.google.com
Message-ID <ba4fae99-a9a7-4299-b0dd-94a999e2a57c@a5g2000vbb.googlegroups.com> (permalink)

Show all headers | View raw


Hello,

I am working on a Java application, and run into the following
exception when trying to save my Network Configuration Parameters. I
have been looking at the execution stack trace for clues to the
problems.

This is the save() method that calls the different objects to save the
individual Configuration<Types>:

    public void save() throws XmlException, IOException {
        if (logger.isDebugEnabled()) {
            logger.debug("Saving systemwide config...");
        }

        if(!systemwideConfiguration.equals(null)) {
        	systemwideConfiguration.bufferedSave();
        }

        if(!rtdbConfiguration.equals(null)) {
        	rtdbConfiguration.bufferedSave();
        }

        if(!localeConfiguration.equals(null)) {
        	localeConfiguration.saveAsCommitted();
        }

        if(!hmiAccessMgrModel.equals(null)) {
            hmiAccessMgrModel.save();
        }

        if (!CommunicationManager.getInstance().getIsDNA()){
            runtimeGUIConfiguration.bufferedSave();
            eventLoggerConfiguration.bufferedSave();
            dhcpModel.save();
        }

        if (CommunicationManager.getInstance().getIsDNA()){
        	if(!timeSyncModel.equals(null)) {
        		timeSyncModel.save();
        	}
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Saving systemwide config...completed");
        }

        setModified(false);
    }

Here is the corresponding stack trace:

java.lang.IllegalStateException: Please load a version of an object
before saving!
java.lang.IllegalStateException: Please load a version of an object
before saving!
      at
com.gepower.d400.model.config.ConfigurationImpl.getSaveFile(ConfigurationImpl.java:
309)
      at
com.gepower.d400.model.config.ConfigurationImpl.bufferedSave(ConfigurationImpl.java:
357)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.gepower.d400.model.config.ConfigurationManager
$SaveProxy.invoke(ConfigurationManager.java:400)
      at $Proxy0.bufferedSave(Unknown Source)
      at
com.gepower.d400.view.config.systemwide.SystemwideModel.save(SystemwideModel.java:
366)
      at com.gepower.d400.view.config.systemwide.SystemwideController
$SaveAction.doLongOperation(SystemwideController.java:272)
      at com.gepower.d400.swing.BusyThread.run(BusyThread.java:103)

Now, I am thincking that the command:

hmiAccessMgrModel.equals(null)

is causing the problem and should be re-written as:

hmiAccessMgrModel == null

Suggestions as to what the problem might be ?

Paolo

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Object IllegalStateException Problem ptreves <ptreves@gmail.com> - 2011-11-10 08:23 -0800
  Re: Object IllegalStateException Problem Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-10 16:51 +0000
    Re: Object IllegalStateException Problem ptreves <ptreves@gmail.com> - 2011-11-10 08:59 -0800
      Re: Object IllegalStateException Problem Patricia Shanahan <pats@acm.org> - 2011-11-10 10:21 -0800
      Re: Object IllegalStateException Problem Lew <lewbloch@gmail.com> - 2011-11-10 15:03 -0800

csiph-web