jeudi 14 septembre 2023

Crash Caused by: java.util.ServiceConfigurationError

Hello I have a problem when I call method.invoke() I have a crash Caused by: java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.apache.logging.slf4j.SLF4JServiceProvider not a subtype. The strange thing is that when I use java classes, the functions all work fine, but when others the error that I posted above occurs, but I want to point out that classes methods and functions that increase java classes work fine. Here is the code for method.invoke()

for (Method method : clazz.getDeclaredMethods()){
    try {
        method.setAccessible(true);
        method.invoke(clazz.getDeclaredConstructor().newInstance());
    } catch (IllegalAccessException | InvocationTargetException e) {
        throw new RuntimeException(e);
    } catch (InstantiationException e) {
        throw new RuntimeException(e);
    } catch (NoSuchMethodException e) {
        throw new RuntimeException(e);
    }
}
@SubscribeEvent
public static void test() {
    System.out.print(SomeClass.someFunction());
}

I used ChatGpt but it didn't help me.





Aucun commentaire:

Enregistrer un commentaire