nicho92 / MtgDesktopCompanion

Cards manager for magic the gathering
Apache License 2.0
163 stars 35 forks source link

Execution error: Cannot invoke "org.magic.api.interfaces.MTGCardsProvider.init()" #167

Closed allentiak closed 3 years ago

allentiak commented 3 years ago

When executing, I get the following error:

java.lang.NullPointerException: Cannot invoke "org.magic.api.interfaces.MTGCardsProvider.init()" because the return value of "org.magic.tools.MTG.getEnabledPlugin(java.lang.Class)" is null
    at org.magic.api.main.MtgDesktopCompanion.<init>(MtgDesktopCompanion.java:55)

Please see sceenshot below: MTG Companion error--Screenshot from 2021-06-06 17-38-28

full debug log (for local master build)

Tested on Java 15 on Debian "testing", both versions 2.25 (both local build and official release) and master (local build on current master - 5003ca9ef5d78f5cece2bc0612360aa5c703de7e).

(Important: I haven't run the script mentioned in the release page, simply because I don't know exactly when should I do so.)

nicho92 commented 3 years ago

Hi, can you open USERHOME/.magicDeskCompanion/mtgcompanion-conf.xml and check if you have a provider to "true".

<providers>
    <provider>
      <class>org.magic.api.providers.impl.PrivateMTGSetProvider</class>
      <enable>false</enable>
    </provider>
    <provider>
      <class>org.magic.api.providers.impl.ScryFallProvider</class>
      <enable>false</enable>
    </provider>
    <provider>
      <class>org.magic.api.providers.impl.MTGSQLiveProvider</class>
      <enable>true</enable>
    </provider>
    <provider>
      <class>org.magic.api.providers.impl.Mtgjson5Provider</class>
      <enable>false</enable>
    </provider>
    <provider>
      <class>org.magic.api.providers.impl.MagicTheGatheringIOProvider</class>
      <enable>false</enable>
    </provider>
  </providers>
allentiak commented 3 years ago

Thanks for the pointer!

From what I see, the only provider I had enabled in the config file was obsolete. I only had org.magic.api.providers.impl.Mtgjson4Provider enabled.

I tried enabling org.magic.api.providers.impl.MTGSQLiveProvider, and it worked!

After the program started, it automatically updated MTGJSON's version to 5.

allentiak commented 3 years ago

(@nicho92 Whereas your answer did solve my problem, I haven't closed this one only because I'm not sure whether this manual fix would require an update from your end. I leave this up to you)

nicho92 commented 3 years ago

Hi, no problem, thanks for your feedbacks. I've no feedback like this one... maybe a missclick/bug...

(Important: I haven't run the script mentioned in the release page, simply because I don't know exactly when should I do so.)

If you are using 2.25 from a previous setup, you can launch it now . It will update JsonServer and HttpServer plugin.

allentiak commented 3 years ago

Hi, no problem, thanks for your feedbacks. I've no feedback like this one...

No problem. I know that, without reproducibility information, it becomes very difficult for you to help others back...

(Important: I haven't run the script mentioned in the release page, simply because I don't know exactly when should I do so.)

If you are using 2.25 from a previous setup, you can launch it now . It will update JsonServer and HttpServer plugin.

Done. Thanks.