Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: Could not initialize class com.jcabi.manifests.Manifests #333

Open
Penglong-LE opened this issue Dec 26, 2021 · 1 comment

Comments

@Penglong-LE
Copy link

Penglong-LE commented Dec 26, 2021

in our project, when calling Manifests.read method, it always throws an exception NoClassDefFoundError, seems the root cause is the initialization of static block failed in Manifests as the message shown below, I don't know why this error happen, and how to fix, could someone help ?

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at com.jcabi.log.PreFormatter.process(PreFormatter.java:122) ~[jcabi-log-0.14.jar:?]
at com.jcabi.log.PreFormatter.(PreFormatter.java:77) ~[jcabi-log-0.14.jar:?]
at com.jcabi.log.Logger.format(Logger.java:116) ~[jcabi-log-0.14.jar:?]
at com.jcabi.log.Logger.error(Logger.java:240) ~[jcabi-log-0.14.jar:?]
at com.jcabi.manifests.Manifests.(Manifests.java:140) ~[jcabi-manifests-1.1.jar:?]

@janenicholson
Copy link

This was enough information for me to determine that com.jcabi.manifests.Manifests has a bug here

static {
    try {
        Manifests.DEFAULT.append(new ClasspathMfs());
    } catch (final IOException ex) {
        Logger.error(
            Manifests.class,
            "#load(): '%s' failed %[exception]s", ex
        );
    }
}

The error message has 2 %s but only one arg to fill it, and is therefore ArrayOutOfBounds-ing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants