Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [0.95.1a-RC6] Mod .jars not being loaded?  (Read 1009 times)

Histidine

  • Admiral
  • *****
  • Posts: 4682
    • View Profile
    • GitHub profile
[0.95.1a-RC6] Mod .jars not being loaded?
« on: July 17, 2022, 08:52:10 AM »

Today we had a couple of users on the Discord server whose Starsector is CTDing on game load, running only LazyLib and no other mods. Also happens with my test mod and no other mods.

The error looks like this:
33875 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [org.lazywizard.lazylib.LazyLib]
java.lang.RuntimeException: Error loading [org.lazywizard.lazylib.LazyLib]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.lazywizard.lazylib.LazyLib
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:179)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more
26360 [Thread-3] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Error loading [org.histidine.amino.plugins.AminoModPlugin]
java.lang.RuntimeException: Error loading [org.histidine.amino.plugins.AminoModPlugin]
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.histidine.amino.plugins.AminoModPlugin
   at org.codehaus.janino.JavaSourceClassLoader.findClass(JavaSourceClassLoader.java:179)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 2 more

There were also a couple such reports on the LazyLib thread earlier this year.

Earlier, when it was a script in MagicLib that was failing to load (during rulecmd validation), I determined that (at least in the MagicLib case) the relevant mod .jar is where it should be, it's specified in the mod_info.json, and the .class file at the expected path in the .jar.

Is it possible that ScriptStore is silently failing to load the mod .jar and letting the game continue loading – until it needs to load the mod plugin class and the jig is up?
(Even though it logs "Getting ready to load jar file <path>" just fine)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: [0.95.1a-RC6] Mod .jars not being loaded?
« Reply #1 on: July 17, 2022, 09:05:35 AM »

Hmm. The game basically does this:
Code
for (String path : jarPaths) {
File file  = new File(path);
try {
urls[i] = file.toURL();
log.info("Getting ready to load jar file [" + path + "]");
} catch (MalformedURLException e) {
log.error(e.getMessage(), e);
}
i++;
}

log.info("Loading jar files");
parent = new URLClassLoader(urls, parentClassLoader);

With jarPaths containing the paths to the jar files from all of the mods. So, I guess it's a question of whether URLClassLoader could silently fail to load one of the jars?

I wonder if, say, having some kind of unexpected character in the game install path might be causing trouble. I seem to remember for example that the game doesn't like if there's... I want to say a "!" in the install dir? But then the game itself just doesn't run, though it's possible something like that might have a less obvious effect like we're seeing here. Or: lack of read permissions on the jar file, somehow? I'd ask them to run as admin, in case that helps. Not sure what else to think.
Logged

Wispborne

  • Captain
  • ****
  • Posts: 408
  • Discord: wispborne
    • View Profile
Re: [0.95.1a-RC6] Mod .jars not being loaded?
« Reply #2 on: July 25, 2022, 09:05:19 AM »

The user followed up - it was caused by their antivirus, something called SAScanner.

Quote
it was my antivirus, had to load the game in not fullscreen, load the mods one at a time and allow them through the antivirus.
all i know is that i clicked allow on the antivirus pop up and the mods started working
Logged
Mod: Persean Chronicles | Mod Manager: SMOL | Tool: VRAM Estimator | Tool: Forum+Discord Mod Database | If I'm inactive for 3 months, anyone can use any of my work for anything (except selling it or its derivatives).