Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: [1] 2

Author Topic: Bizarre loading error.  (Read 8756 times)

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Bizarre loading error.
« on: June 07, 2019, 10:44:12 AM »

Crash to desktop on game load; progress bar makes it most of the way and then it pukes.

Posting the error log because it's a real stump-the-chump. Alterations to the ModPlugin itself don't seem to have helped; it's clearly more fundamental than that. I've narrowed it down to something I'm personally doing in this mod; just not sure what.

It seems like I made some sort of basic error that I can't track down. I've looked in CoreLifecyclePluginImpl but nothing jumps out at me. Best guess is faction-related, the game trying to verify something about the faction file it can't.

Any idea what I'm doing wrong? Or at least, where to look?

Spoiler
21981 [Thread-5] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Failed to find script of class [com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl]
java.lang.RuntimeException: Failed to find script of class [com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl]
   at com.fs.starfarer.loading.scripts.ScriptStore.new(Unknown Source)
   at com.fs.starfarer.settings.StarfarerSettings.for(Unknown Source)
   at com.fs.starfarer.launcher.ModManager.getEnabledModPlugins(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:745)
[close]
« Last Edit: June 07, 2019, 10:50:42 AM by Soren »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #1 on: June 07, 2019, 11:02:39 AM »

Just to double-check, you don't have a class named CoreLifecyclePluginImpl in your mod, do you? Also: do you have a "coreLifecyclePlugin" specified in your settings.json? (You generally speaking shouldn't.)

I'd try a clean reinstall of the game. This looks like it's failing to find a core class - and just based on the stack trace, I wouldn't have said it's mod-related - which is super weird.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Bizarre loading error.
« Reply #2 on: June 07, 2019, 11:10:52 AM »

No, no class by that name. I've tried reinstalling everything but the core game.

It's definitely mod related. The game loads and plays just fine without this mod enabled. What I think is happening is that I'm missing something that the game needs for the mod to pass verifyFactionData() in CoreLifecyclePluginImpl and it's choking.
« Last Edit: June 07, 2019, 11:19:34 AM by Soren »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #3 on: June 07, 2019, 11:33:05 AM »

Hmm - if verifyFactionData() threw an exception, that would be in the log, and this is not it.

At some point on startup, the game gets all the ModPlugins from the enabled mods into a list so that it can call their various methods (such as onGameLoad()) as needed. The first element in this list is the plugin specified in coreLifecyclePlugin in settings.json - the core's version of the ModPlugin, since the core also needs to do things in response to the same kind of events (onGameLoad()), etc.

The part that's failing, according to the exception, is trying to create a new instance of the class specified there, see:

Failed to find script of class [com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl]

The full classname appears to be correct. I'm not sure why this might happen. Some possibilities:
1) The actual class file is missing or corrupted
2) The class does not have a default constructor (it doesn't, but it also doesn't have a non-default one, so that's fine)
3) The default constructor throws an exception (I think the error would be different, and also see: it not having an explicit default constructor anyway, or any initialization code that might fail)

#1 seeming the more likely, that's why I'm recommending a reinstall of the game. It's not getting to the point where it'd try to verify faction data; that would be when you're loading an actual campaign game.

It's definitely mod related. The game loads and plays just fine without this mod enabled.

I'd still try a clean install just to rule issues with the base install out.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Bizarre loading error.
« Reply #4 on: June 07, 2019, 11:52:29 AM »

I thought that too, but when I have Nexerelin enabled, which *does* extend CoreLifecyclePluginImpl, *that* class (NexCoreLifecyclePlugin) is what crashes. When this new mod is disabled, Starsector works fine, with or without Nexerelin.

At this point, more than replacing the base game, replacing my new mod's files one by one until it works seems more likely to yield results.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #5 on: June 07, 2019, 12:00:12 PM »

May be worth checking if there are other errors/stack traces in the log prior to the crash - could be the sort of thing that gets logged but doesn't crash the game, but sets it up for this to happen later on.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Bizarre loading error.
« Reply #6 on: June 07, 2019, 12:09:26 PM »

Yup, tried that. A search for ERROR turns up this:

Spoiler
5238 [Thread-5] ERROR com.fs.starfarer.loading.WeaponSpreadsheetLoader  - Weapon spec [target_painter] not found in weapon_data.csv
5866 [Thread-5] ERROR com.fs.starfarer.loading.ShipHullSpreadsheetLoader  - Ship hull spec [module_hightech_decor] not found in ship_data.csv
5866 [Thread-5] ERROR com.fs.starfarer.loading.ShipHullSpreadsheetLoader  - Ship hull spec [flare] not found in ship_data.csv
7074 [Thread-5] INFO  com.fs.starfarer.loading.SpecStore  - Loaded spec with id [Terror_|_constellation]
7078 [Thread-5] INFO  com.fs.starfarer.loading.SpecStore  - Loaded spec with id [Ferror_|_star, planet, moon, nebula, constellation]
14107 [Thread-5] INFO  com.fs.graphics.TextureLoader  - Cleaned buffer for texture graphics/swp/portraits/ibb_terror.png (using cast)
19088 [Thread-5] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Failed to find script of class [exerelin.plugins.NexCoreLifecyclePlugin]
[close]

I wonder if this isn't happening because the only system file I'm adding to the mod uses procgen to assign a constellation a random position out on the fringe.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #7 on: June 07, 2019, 12:22:11 PM »

19088 [Thread-5] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Failed to find script of class [exerelin.plugins.NexCoreLifecyclePlugin]

Is that showing up with Nex disabled? If so: can you try moving Nex to another folder and see if that changes things?
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Bizarre loading error.
« Reply #8 on: June 07, 2019, 12:31:13 PM »

No, with Nex disabled I get the original error - 'Failed to find script of class [com.fs.starfarer.api.impl.campaign.CoreLifecyclePluginImpl]'

And, as I said before, Nex works correctly without this new mod turned on.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #9 on: June 07, 2019, 12:34:00 PM »

Ah, alright, whew.

I still have no idea what's going on, and would (still) in your shoes do a clean reinstall before mucking around with anything. If something is corrupt in the install, who knows how it might manifest? Could just be randomly triggered by something innocuous in your mod. I'm not saying this *is* the problem but it's fairly low-cost to rule out... I mean, it's up to you, obviously - just saying that personally I'd do that as a sanity check because this is so freakin' weird.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Bizarre loading error.
« Reply #10 on: June 07, 2019, 12:59:20 PM »

Yeah, I just tried it, still getting this error.

I'm officially out of ideas, I keep digging around for requisite content I haven't added and coming up blank. All the scripts I'm using are simple reworks of stuff I already had working, so it's not likely to be those (I've gone over the scripts that seemed like likely culprits with a fine-toothed comb).

I'll let you know if/how I eventually fix it, just so no one has to ask this again.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #11 on: June 07, 2019, 01:01:09 PM »

If you can reproduce this on a clean install with relatively minimal reqs (i.e. graphicslib/lazylib/etc), I can take a quick look if you send me your mod.
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Bizarre loading error.
« Reply #12 on: June 07, 2019, 01:01:55 PM »

Thank you! I realize I've taken enough of your time up with this garbage, but let me package it up and send you a link by PM.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #13 on: June 07, 2019, 01:04:43 PM »

No worries, this'll be... fun. Hopefully it happens in my dev environment, would be considerably more painful if not.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Bizarre loading error.
« Reply #14 on: June 07, 2019, 01:28:07 PM »

Alright, got this loaded up, with the error and everything, and I see this in the log:

4216 [Thread-7] INFO  com.fs.starfarer.loading.scripts.ScriptClassLoader  - Loading class: data.scripts.MagellanModPlugin
Exception in thread "Thread-7" java.lang.UnsupportedClassVersionError: data/scripts/MagellanModPlugin : Unsupported major.minor version 52.0
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
   at com.fs.starfarer.loading.scripts.ScriptStore$3.run(ScriptStore.java:401)
   at java.lang.Thread.run(Thread.java:745)


This shorts out the script loader, so the game crashes the first time it needs to use any other script. Looks like the MagellanModPlugin (and presumably the rest of the jar?) is complied for a newer version of the JRE than the game is running with.
Logged
Pages: [1] 2