Unable to find constructure w/ JDK11-OpenJ9
See original GitHub issueDescribe 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:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solved. Will soon post a release with the fix.
https://github.com/JitseB/NPCLib/releases/tag/2.4.2-SNAPSHOT