P
ptreves
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
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