mercredi 29 janvier 2020

java.lang.NoSuchMethodError after system is running for multiple hours

Assume a public Class A

public class A {

    public boolean test(Object a) {
        return true;
    }

}

and let this method invoke via

java.lang.Class.forName("A").getMethod(test, Object.class).invoke(new A(), new Object());

This routine works during Application's runtime 24/7 but seems to fail non-deterministic. It throws a NoSuchMethodError.

Do you have any idea, why this method will fail from one timepoint to another?

We use the java 8 version from open jdk project and run the application in suse enterprise 14.0.4 and this server was up and running without any hint of interruption.

After restarting the application without any changes on the jar the function invokation works perfectly fine again.





Aucun commentaire:

Enregistrer un commentaire