ClassLoader issue inside tomcat

Discussion in 'Software' started by somdatta, Mar 28, 2008.

  1. somdatta

    somdatta

    Joined:
    Mar 28, 2008
    Messages:
    1
    I am using a Classloader inside my web-application which is used to get a configuration file(module-conf.xml) as a stream

    -----
    InputStream inputStream = getClass().getClassLoader().getResourceAsStream(CONFIG_FILE_NAME);
    ------
    Further is use this stream to create a Document object
    ------
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse(inputStream);

    ------
    When I try to read the config file for 1st time I get the configuration. If I modify/delete the configuration file, class loader is not able to read the modified file. Even the file is deleted class loader still gives me the stream object.
    This requirement works fine if application is run as a stand alone.
    somdatta, Mar 28, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Silverstrand

    TYAN Tomcat K8E (S2865) Motherboard @ BonaFideReviews

    Silverstrand, Sep 7, 2005, in forum: Front Page News
    Replies:
    0
    Views:
    828
    Silverstrand
    Sep 7, 2005
  2. Dan Rice
    Replies:
    9
    Views:
    883
    Dan Rice
    Feb 4, 2005
  3. chet

    Cisco Tomcat

    chet, Nov 14, 2006, in forum: Cisco
    Replies:
    1
    Views:
    2,555
  4. Oom
    Replies:
    1
    Views:
    1,078
  5. Oom
    Replies:
    0
    Views:
    590
Loading...

Share This Page