-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPE while loading a save-file #4021
Comments
Can you please post the full log files (legacy, MM, and, if related, MHQ) from loading this file? This appears to be a critical bug at first read. |
I've tracked down the issue, it;s a race condition during loadign the save.
The Server Instance is still null when that is being accsessed, However after several tries I was able to get it to load. |
If you still need the logs I can post them, but I'll see if I can write a patch for this over christmas vacation. |
The error message in question normally originates from different game versions, which is why I wanted the log to check. However, I've found a location where this state of affairs can occur, namely megamek/megamek/src/megamek/client/ui/swing/MegaMekGUI.java Lines 543 to 552 in 7772631
This was added in #2458, and started showing as an issue with #3652. |
Environment
Linux Megamek 0.49.10, java 11.0.13
Description
Loading a save game fails. After some digging through the logs and the error message it seems to be unhappy about some Arrow IV attacks made by infantry.
Files
night.sav.gz
Log message bellow;
19:35:13,427 INFO [megamek.MegaMek] {main}
megamek.MegaMek.initializeLogging(MegaMek.java:115) - Starting MegaMek v0.49.10
Build Date: N/A
Today: 2022-12-04
Origin Project: MegaMek
Java Vendor: Ubuntu
Java Version: 11.0.13
Platform: Linux 5.11.0-49-generic (amd64)
System Locale: en_US
Total memory available to MegaMek: 2 GB
19:35:13,429 INFO [megamek.MegaMek] {main}
megamek.MegaMek.handleLegacyLogging(MegaMek.java:128) - Redirecting System.out, System.err, and Throwable::printStackTrace output to legacy.log
19:35:13,546 INFO [megamek.client.ui.preferences.SuitePreferences] {main}
megamek.client.ui.preferences.SuitePreferences.loadFromFile(SuitePreferences.java:118) - Loading user preferences from: mmconf/mm.preferences
19:35:13,583 INFO [megamek.client.ui.preferences.SuitePreferences] {main}
megamek.client.ui.preferences.SuitePreferences.loadFromFile(SuitePreferences.java:138) - Finished loading user preferences
19:35:13,815 INFO [megamek.MegaMek] {main}
megamek.MegaMek.startGUI(MegaMek.java:315) - Starting MegaMekGUI.
19:35:21,528 ERROR [megamek.client.ui.swing.MegaMekGUI] {AWT-EventQueue-0}
megamek.client.ui.swing.MegaMekGUI.loadGame(MegaMekGUI.java:548) - Unable to load file: /home/dirk/apps/mekhq-0.49.10/savegames/night.sav.gz
com.thoughtworks.xstream.converters.ConversionException: Failed calling method
---- Debugging information ----
message : Failed calling method
cause-exception : java.lang.NullPointerException
cause-message : null
method : megamek.common.weapons.ArtilleryWeaponIndirectFireHandler.readObject()
class : megamek.common.weapons.ArtilleryWeaponIndirectFireHandler
required-type : megamek.common.weapons.ArtilleryWeaponIndirectFireHandler
converter-type : com.thoughtworks.xstream.converters.reflection.SerializableConverter
line number : 545411
class[1] : java.util.Vector
required-type[1] : java.util.Vector
converter-type[1] : com.thoughtworks.xstream.converters.collections.CollectionConverter
class[2] : megamek.common.Game
required-type[2] : megamek.common.Game
converter-type[2] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
version : 1.4.14
Caused by: java.lang.NullPointerException
at megamek.common.weapons.WeaponHandler.readObject(WeaponHandler.java:435)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.thoughtworks.xstream.core.util.SerializationMembers.callReadObject(SerializationMembers.java:132)
... 65 more
The text was updated successfully, but these errors were encountered: