Error of "ClassNotFound Exception"
I have a code below -
Code :
ParserConfiguration parserConfiguration;
String parserConfigurationClassName = this.cli.getParserConfigImpl();//Gets implementation's name #pritam
System.out.println(parserConfigurationClassName+">>");
Class parserConfigurationClass;
try {
parserConfigurationClass = Class.forName(parserConfigurationClassName);
}
catch (ClassNotFoundException e) {
e.printStackTrace();
throw new IllegalArgumentException("Failed to load parserConfigImpl [" + parserConfigurationClassName + "]: Class not found");
}
I am getting ClassNotFoundException at forName method.
Can anybody suggest anything that will help.
Thanks & regards,
multicoder
Re: Help with ClassNotFound Exception
Hello multicoder. Welcome to the Java Programming Forums.
Have you imported the correct classes into your project?
Re: Help with ClassNotFound Exception
Quote:
Originally Posted by
JavaPF
Hello multicoder. Welcome to the Java Programming Forums.
Have you imported the correct classes into your project?
yes I have imported all necessary packages and classes,
and this is not the import issue for the class of which the object is getting created runtime, but something else for sure.
Re: Help with ClassNotFound Exception
Is this class you are trying to create available on the classpath? How are you running your program?
// Json