Reading property files:: please help

Discussions

EJB programming & troubleshooting: Reading property files:: please help

  1. Reading property files:: please help (1 messages)

    I am running a client program that calls ejbs under j2ee reference implementation server by Sun. In the client program (not within the ejb), I need to read some property files. But I cannot get "new FileInputStream(PropertyFile)" to work. I have imported the necessary packages.

    I cannot even instantiate a FileWriter for logging messages in this client program.

    Any help will be helpful
    Thanks
  2. Reading property files:: please help[ Go to top ]

    see if this code helps.
    -----------------------------------------------
    String strPropfile = "rmi.properties";//property file must //be placed in class path

    Properties props = new Properties(System.getProperties());
    InputStream is = ClassLoader.getSystemResourceAsStream(strPropfile);

    props.load(new BufferedInputStream(is));
    System.setProperties(props);//sets default + ur properties //in the System...


    //access any Property in the file any where within the same //JVM
    RmiRegistry = System.getProperty("RmiRegistry");
    ----------------------------------------------------