Skip to Main Content

Java Programming

ClassNotFoundException

User_WL6FPApr 24 2018 — edited Apr 25 2018

Hi,

I'm getting ClassNotFoundException error in this code below.

String url ="http://<some-path>/app.jar";

URL[] classLoaderUrls = new URL[]{new URL(url)};

                           

ClassLoader cl = new URLClassLoader(classLoaderUrls);

Class<?> beanClass = cl.loadClass("com.app.MyClass"); // Throwing ClassNotFoundException although this class is present in the JAR in the  fully qualified package name.

Any clue what to fix here ?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2018
Added on Apr 24 2018
2 comments
180 views