ClassNotFoundException on maven Dependency
Posted: Tue May 23, 2023 11:23 pm
Hello!
I added the "com.google.code.gson" dependency to use in my java code in a framework.
But when the method is called I am getting "ClassNotFoundException" error.
Is it necessary to do some configuration in the POM for the dependency to be recognized?
Error:
Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at ro.sync.basic.classloader.LateDelegationClassLoader.loadClass(LateDelegationClassLoader.java:192)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
I added the "com.google.code.gson" dependency to use in my java code in a framework.
But when the method is called I am getting "ClassNotFoundException" error.
Is it necessary to do some configuration in the POM for the dependency to be recognized?
Error:
Caused by: java.lang.ClassNotFoundException: com.google.gson.Gson
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at ro.sync.basic.classloader.LateDelegationClassLoader.loadClass(LateDelegationClassLoader.java:192)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)