Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Error of "ClassNotFound Exception"

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Error of "ClassNotFound Exception"

    I have a code below -
    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


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Help with ClassNotFound Exception

    Hello multicoder. Welcome to the Java Programming Forums.

    Have you imported the correct classes into your project?
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help with ClassNotFound Exception

    Quote Originally Posted by JavaPF View Post
    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.

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Help with ClassNotFound Exception

    Is this class you are trying to create available on the classpath? How are you running your program?

    // Json

Similar Threads

  1. Exception handling for TextFields
    By FretDancer69 in forum AWT / Java Swing
    Replies: 1
    Last Post: June 16th, 2009, 07:48 AM
  2. exception while Read very large file > 300 MB
    By ps.ganesh in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: June 11th, 2009, 11:39 PM
  3. Getting Null Pointer Exception in runtime
    By RoadRunner in forum Exceptions
    Replies: 1
    Last Post: April 26th, 2009, 01:21 PM
  4. Exception handling
    By AnithaBabu1 in forum Exceptions
    Replies: 6
    Last Post: August 27th, 2008, 09:37 AM