OpenMods / OpenPeripheral-Integration

Extra OP adapters
MIT License
9 stars 9 forks source link

Java NullPointException when calling getBeeBreedingData #19

Closed msgerbs closed 8 years ago

msgerbs commented 8 years ago

Didn't see this mentioned anywhere yet. Calling apiary.getBeeBreedingData gives the following results: java.lang.NullPointerException without any info

Running FTB Infinity 1.10.1 with: forestry_1.7.10-3.6.3.20 OpenModsLib-1.7.10-0.8 OpenPeripheralAddons-1.7.10-0.4 OpenPeripheralCore-1.7.10-1.2 OpenPeripheralIntegration-1.7.10-0.3

Apologies if this is fixed in a recent commit, I didn't see any issues and the last commit to the relevant file is 8 months ago.

Deweyoxberg commented 8 years ago

May help to know that the versions reported were a downgrade from the latest available and that still did not resolve the issue. Wondering if it's possibly an issue with forestry; was unable to test the forestry version that was last known to be functional. -Dewey

boq commented 8 years ago

I tested that command with just OP+Forestry 3.6.3.20 and couldn't reproduce crash, so it is probably weird third-party bee.

Anyway, I'm not really sure where it crashes. Can you search in server log (file, not console) for line containing Error during method getBeeBreedingData and post stacktrace below?

Deweyoxberg commented 8 years ago

Will do soon as I get home and can recreate the crash.

In the meantime where would the log file be? I am guessing in the root directory? -Dewey

boq commented 8 years ago

In logs folder. They are called either fml-client-latest.log or fml-server-latest.log

Deweyoxberg commented 8 years ago

Nothing in the logs with getBeeBreedingData. Ideas?

Deweyoxberg commented 8 years ago

Hrm, reading above.. this isn't a crash; it's what is spat out by ComputerCraft when trying to use programs to breed bees. Source code is here:

https://github.com/Forte40/openbee

boq commented 8 years ago

Yeah, but if you get java.lang.NullPointerException in ComputerCraft, that means there is matching stacktrace in logs (on server, of course). Full CC code doesn't matter in this case, single call should crash as well.

Deweyoxberg commented 8 years ago

I've checked in the fml-client-latest.log and fml-server-latest.log for this call repeatedly and I find nothing with getBeeBreedingData, or "breeding" for that matter. Is it possible I'm just missing something obvious?

The only log I do have is from Computercraft:

openbee version 2.2.1 priority: speciesChance speed fertility nocturnal tolerantFlyer caveDwelling temperatureTolerance humidityTolerance effect flowering flowerProvider territory openbee:255: Caught exception class java.lang.NullPointerException without any info

Lines 250 through 260 from OpenBee:

       mutations[parent1] = {
        mutateTo = {[offspring]={[parent2] = chance}}
      }
    end
  end
  for _, parents in pairs(apiary.getBeeBreedingData()) do
    fixParents(parents)
    addMutateTo(parents.allele1, parents.allele2, parents.result, parents.chance)
    addMutateTo(parents.allele2, parents.allele1, parents.result, parents.chance)
  end
  mutations.getBeeParents = function(name)
    return apiary.getBeeParents((nameFix[name] or name))
  end
  return mutations, beeNames
end
boq commented 8 years ago

Ehhhhh, so I had too start my better computer, get FTB, install Infinity, and BAM! the logs are there:

[17:55:22] [Coroutine-2/DEBUG] [OpenMods/]: Error during method getBeeBreedingData(6) execution on peripheral apiculture_2_name, args: []
java.lang.NullPointerException
    at net.minecraft.item.ItemStack.func_82833_r(ItemStack.java:427) ~[add.class:?]
    at magicbees.bees.BeeMutation.getSpecialConditions(BeeMutation.java:538) ~[BeeMutation.class:?]
    at openperipheral.integration.forestry.AdapterBeeHousing.getBeeBreedingData(AdapterBeeHousing.java:78) ~[AdapterBeeHousing.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31]
    at openperipheral.adapter.method.MethodDeclaration$CallWrap.call(MethodDeclaration.java:308) ~[MethodDeclaration$CallWrap.class:?]
    at openperipheral.adapter.method.MethodDeclaration$CallWrap.call(MethodDeclaration.java:322) ~[MethodDeclaration$CallWrap.class:?]
    at openperipheral.interfaces.cc.wrappers.AdapterPeripheral.call(AdapterPeripheral.java:64) [AdapterPeripheral.class:?]
    at openperipheral.interfaces.cc.wrappers.AdapterPeripheral.callMethod(AdapterPeripheral.java:85) [AdapterPeripheral.class:?]
    at dan200.computercraft.core.apis.PeripheralAPI$PeripheralWrapper.call(PeripheralAPI.java:110) [PeripheralAPI$PeripheralWrapper.class:?]
    at dan200.computercraft.core.apis.PeripheralAPI.callMethod(PeripheralAPI.java:477) [PeripheralAPI.class:?]
    at dan200.computercraft.core.lua.LuaJLuaMachine$2.invoke(LuaJLuaMachine.java:332) [LuaJLuaMachine$2.class:?]
    at org.luaj.vm2.lib.VarArgFunction.onInvoke(Unknown Source) [VarArgFunction.class:?]
    at org.luaj.vm2.TailcallVarargs.eval(Unknown Source) [TailcallVarargs.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.lib.BaseLib.pcall(Unknown Source) [BaseLib.class:?]
    at org.luaj.vm2.lib.BaseLib$BaseLibV.invoke(Unknown Source) [BaseLib$BaseLibV.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.lib.BaseLib.pcall(Unknown Source) [BaseLib.class:?]
    at org.luaj.vm2.lib.BaseLib$BaseLibV.invoke(Unknown Source) [BaseLib$BaseLibV.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.TailcallVarargs.eval(Unknown Source) [TailcallVarargs.class:?]
    at org.luaj.vm2.TailcallVarargs.arg1(Unknown Source) [TailcallVarargs.class:?]
    at org.luaj.vm2.LuaClosure.call(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.lib.BaseLib.pcall(Unknown Source) [BaseLib.class:?]
    at org.luaj.vm2.lib.BaseLib$BaseLibV.invoke(Unknown Source) [BaseLib$BaseLibV.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.call(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.execute(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.onInvoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaClosure.invoke(Unknown Source) [LuaClosure.class:?]
    at org.luaj.vm2.LuaThread$State.run(Unknown Source) [LuaThread$State.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] 

So MagicBees.

With some debugging I found out that faulty species is: BM_BOUND (Blood Magic?) and problem is caused by BeeMutation.requiredBlock == null.

Only thing I can do is add sanity check and ignore faulty bee. Please report this issue to MagicBees here.

Deweyoxberg commented 8 years ago

Thanks Boq; sorry, I really did try to find the logs you needed. Feel bad that you made it so easy and had to go through so much trouble. Thank you for doing that. That looks like a normal crash log when minecraft dies completely; wish it would have and generated such a report. Maybe there's something I have not enabled server or client side to generate such verbose info?

Anyhow, I opened the issue on the magic bees end. Thanks for your superb help.

boq commented 8 years ago

Well, it's not actual crash, so I don't think it's necessary to stop Minecraft.

And I would have to install Infinity anyway, since it's not reproducible just with MagicBees and there is nothing about Blood Magic in logs.

Deweyoxberg commented 8 years ago

I did remove MagicBees from my own install today and received a different error message:

openbee:157: forestry.api.apiculture.IBee.isIreegularMating()Z

So, off to Forestry I go to sort this one out.

Thanks for your help Boq. :)

boq commented 8 years ago

Oh, that's OpenMods/OpenPeripheral#253, OpenMods/OpenPeripheral#254, #16 and OpenMods/OpenPeripheral#257 duplicate.

Deweyoxberg commented 8 years ago

Ah, that makes sense then. I did downgrade Open stuff to last known working version when initially attempting to fix the problem. Will update, then. :D Thanks for the links!

boq commented 8 years ago

I'm not sure if this fix is already released. But you can use OpenPeripheral-Integration snapshot 76 for a while.