Results 1 to 2 of 2
  1. #1
    edwardmluk is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default [SOLVED] Apache Commons Properties file exceptions

    I'm having trouble implementing the Apache commons library. All I want to do is read a properties file. I'm using the code:

    Java Code:
    Configuration config = new PropertiesConfiguration("setup.properties");
    And even thought it's in a try catch block which catches all exceptions, it keeps saying ConfigurationException must be caught or declared to be thrown. So if I wrap it in its own try catch, to catch that exception it says the ConfigurationException is an incompatible type and not throwable.

    I've read the user guide for apache commons, but that doesn't help me solve the problem. Regardless if I pass PropertiesConfiguration a string or file...same error.

    Any ideas?

    Ed

  2. #2
    edwardmluk is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    Fixed: Needed the apache lang library too. Then all is fine.

Similar Threads

  1. Replies: 3
    Last Post: 01-29-2012, 10:44 AM
  2. Replies: 3
    Last Post: 07-25-2011, 03:19 PM
  3. send email using apache commons email
    By jnamendi in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 10-14-2008, 05:55 PM
  4. RegExp to remove tag from html file with exceptions
    By Daedalus in forum Advanced Java
    Replies: 3
    Last Post: 09-27-2008, 04:43 AM
  5. Replies: 0
    Last Post: 09-13-2008, 07:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •