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

ClassNotFoundException #14

Open
antoineNRB opened this issue Oct 6, 2021 · 3 comments
Open

ClassNotFoundException #14

antoineNRB opened this issue Oct 6, 2021 · 3 comments

Comments

@antoineNRB
Copy link

antoineNRB commented Oct 6, 2021

Hi I've been trying to use your tool but I ran into this error when using $ java -jar Postman2Jmx.jar my_postman_collection.json my_jmx_file.jmx

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.loadium.postman2jmx.app.Postman2Jmx.<clinit>(Postman2Jmx.java:15)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 1 more

with java 14 and 11, and Maven 3.8.3, on windows and wsl

Any idea what is happening ? Thanks !

@antoineNRB
Copy link
Author

I was able to build a working jar by making it a fat jar, this way it works 👍

@ChenHaihao
Copy link

我在进行json文件转jmx文件时报错了。这是我输入的命令行。“java -jar Postman2Jmx.jar /f/XXXX.postman_collection.json postman_file.jmx”

以下为报错信息
“Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.loadium.postman2jmx.app.Postman2Jmx.(Postman2Jmx.java:15)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more”

@jaya437
Copy link

jaya437 commented Oct 3, 2023

I created an uber/fat jar using following maven plugin "maven-shade-plugin"

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.loadium.postman2jmx.app.Postman2Jmx</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin>

   But it appears the following error while executing the jar file.
   
   `Error: A JNI error has occurred, please check your installation and try again

Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
at sun.security.util.SignatureFileVerifier.process(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.ensureInitialization(Unknown Source)
at java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)`

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

No branches or pull requests

3 participants