question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to find constructure w/ JDK11-OpenJ9

See original GitHub issue

Describe the bug Unable to create NPCs. Reflection is unable to locate the correct constructor.

NPCLib usage option 3

NPCLib JAR name 2.4.1 Plugin shaded into JAR

Server version PaperSpigot-4c7641d (aka; paper-443 for 1.8.8)

To Reproduce Create an NPC using any of the create methods.

Expected behavior n/a

Screenshots

> [06:07:18 ERROR]: [ACF] Caused by: java.lang.IllegalStateException: Unable to find constructor for class net.minecraft.server.v1_8_R3.EntityArmorStand ([class net.minecraft.server.v1_8_R3.WorldServer]).
> [06:07:18 ERROR]: [ACF] at com.comphenix.tinyprotocol.Reflection.getConstructor(Reflection.java:279)
> [06:07:18 ERROR]: [ACF] at net.jitse.npclib.hologram.Hologram.createPackets(Hologram.java:117)
> [06:07:18 ERROR]: [ACF] at net.jitse.npclib.hologram.Hologram.<init>(Hologram.java:92)
> [06:07:18 ERROR]: [ACF] at net.jitse.npclib.nms.v1_8_R3.NPC_v1_8_R3.createPackets(NPC_v1_8_R3.java:39)
> [06:07:18 ERROR]: [ACF] at net.jitse.npclib.internal.NPCBase.create(NPCBase.java:132)
> [06:07:18 ERROR]: [ACF] at net.gravitas.gravitasapi.npcs.CustomNPC.build(CustomNPC.java:201)

Additional context We’re using Java 11-OpenJ9. The issue also appeared on our 1.14.4 instances, but was fixed as it was a custom Spigot build, simply by adding a new constructure using WorldServer instead of World (see below).

    // custom constructure to allow NPCLib to correctly target a constructor
    public EntityArmorStand(WorldServer world, double d0, double d1, double d2) {
        this(EntityTypes.ARMOR_STAND, world);
        this.setPosition(d0, d1, d2);
    }

    public EntityArmorStand(World world, double d0, double d1, double d2) {
        this(EntityTypes.ARMOR_STAND, world);
        this.setPosition(d0, d1, d2);
    }

I expect this issue is due to Java 11 and the Reflection class not accepting superclasses as a valid option.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JitseBcommented, Apr 11, 2020

Solved. Will soon post a release with the fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java can't find constructor - Stack Overflow
You need to add a constructor that has the parameters. Java will put a default but I have always found it to be...
Read more >
J-Index (OpenJ9 JDK 11) - Eclipse
Represents the JavaVMOption C structures passed to JNI_CreateJavaVM to create the VM. JavaVMOption(String, ImagePointer) - Constructor for class com.ibm.dtfj.
Read more >
Release Notes - Open source, prebuilt OpenJDK binaries
AdoptOpenJDK provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, ...
Read more >
Java - ArchWiki
OpenJ9 — Eclipse's implementation of JRE/JDK, based on the J9 JVM, ... jdk17-openj9-bin AUR jdk11-openj9-bin AUR jdk8-openj9-bin AUR.
Read more >
News — JRuby.org
Regression where in uncommon cases zlib would fail when trying to detect end-of-stream. This would make some gems fail to install. Github Issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found