.properties config files

Hi developers,
I know that WDJ allow .properties files to be accessed both by API and by Visual Admin.
I would like to do the same with properties file placed in a J2EE server component accessed by plain java object (pojo).
I know how to read files in a jar, but how should I make them visibile to Visual Admin?
I don't want to put my configs in WDJ because these are backend config files.
Can anyone help?
Thanks, regards
Vincenzo

In the case you have to use SAP AS Java Configuration Adapter API:
InitialContext ctx = new InitialContext();
ConfigurationRuntimeInterface configRuntimeInterface = (ConfigurationRuntimeInterface) ctx.lookup("configuration");
ConfigurationContext configContext = configRuntimeInterface.getConfigurationContext();
ConfigurationHandler configHandler = configContext.getConfigurationHandler();
Configuration serviceConfig = configHandler.openConfiguration("cluster_data/server/cfg/...<your app name>", ConfigurationHandler.READ_ACCESS);
PropertySheet propSheet = serviceConfig.getPropertySheetInterface();
serviceConfig.close();
BR, Sergei

Similar Messages

  • Reloading the Properties form config file

    the doubt is on reloading the properties without restarting the server...
    Earlier, I have a PropertyReader class which loads the properties from config file, here is the process I followed.
    1)Calling the getInstance() from out side, which test the local instance variable exist or not, if it exists, then skip the creating new instance, else create the object by calling the self Constructor. Here is the method
       public static PropertyReader getInstance(String fileName) throws IOException{
            if (instance==null){
                try {
                    instance = new PropertyReader(fileName);
                } catch (IOException e) {
                    throw e;
            return instance;
        }2) In the Constructor, I read the properties from the property file like the following.
        Properties props = new Properties();
        InputStream fileIn = null;
        fileIn = getClass().getResourceAsStream("/" + "ldap.properties");
        props.load(fileIn);In this scenario I can't access the modified properties until I restart the server.
    Now, I came to change the code to reload the properties with the following scenario.
    1) in my getInstance method, I skip checking the instance and just calling new objct every time.
       public static PropertyReader getInstance(String fileName) throws IOException{
            return new PropertyReader(fileName);
        }2) Even after this, I can't access the latest properties, then I change the code in the Constructor like the following .
           URL codebase = getClass().getProtectionDomain().getCodeSource().getLocation();
                String subPath = codebase.getPath().substring(0, codebase.getPath().indexOf("WEB-INF")+16);
                file = new java.io.File(subPath+"ldap.properties");
                fileIn = new FileInputStream(file);
                props.load(fileIn);Here it is, now I'll be able to get the latest properties even without restarting the server.
    So here I got couple of questions.
    1) What if I create new instace everytime, will that cause any trouble in the memory point-of-view? i.e. load trouble?
    2) What is the difference between 2 nd step in each scenario ? I can't get the exact difference.
    Thanks,
    Sumant K
    Edited by: sumant14 on Jun 4, 2009 6:47 PM

    sumant14 wrote:
    So here I got couple of questions.
    1) What if I create new instace everytime, will that cause any trouble in the memory point-of-view? i.e. load trouble?If you create just ONE object occasionally? Don't waste your time worrying about that. Unless you're doing this thousands of times each second.
    2) What is the difference between 2 nd step in each scenario ? I can't get the exact difference.The first one just gets the properties file from the classpath. The second one is a bizarre hack which might do the same thing, or it might fail in certain circumstances.

  • Change config file properties programatically

    hi, all i have created one config file and from that file i am readindg data. Now when i click on this file it shows that this file is in read only format. Now in this same config file i want to write the data but when i try to write data by using write key function it gives me some error just like please check the permission of the file.
    For this config file i canot change its permission to archive permenantly. So Is there any way to change the file permission programatically from read only archieve and again from archieve to read only.

    You can change the file permissions programmatically using LabVIEW.  This allows you to temporarily change the permission and modify the file before restoring the permissions to their original settings.
    The Set Permission is found within the Advanced File Functions of the File I/O section of the Functions Palette.
    The information below is from the Context Help.
    R
    Message Edited by JoeLabView on 09-16-2008 08:07 AM
    Attachments:
    filePermission.PNG ‏33 KB

  • How can I use my log4j config file of my web project in ias?

    I used log4j in my web project. So I put a config file "log4j.properties" in my project WEB-INF/classes/.
    It works well in tomcat. But when I deploy it to ias parent by orabpel project, It didn't work know!
    I can only see my log in "$ORACLE_HOME/opmn/logs", and some message I nedd is losed, such as the class name, line,datetime, Thread and so on.
    I think the config file of my project is't work, maybe log4j use some config file of ias but me.thx
    So where is the log4j config file of ias, can i modify it ?
    Or how can I let my project use my config file not ias? Any one can help me, thx!

    If you are wondering if/how to control the log messages coming from bpel, here is the corresponding log4j config file that it uses:
    $ORACLE_HOME/bpel/domains/<DOMAIN_NAME>/config/log4j-config.xml

  • Unable to view the contents in NQS Config file

    Hi Forum,
    After I successfully install the OBI EE 10.1.3 Application, I am unable to view the contents in NQS Config file. It is opening in Notepad with error showing as "The filename, directory name or volume label syntax is incorrect."
    So please guide me in resolving this issue.
    Regards
    Cool j

    You probably have restricted access to the file. Check if the drive is ntfs. If the os user is in administrator group, you can give permissions in file properties.

  • Unable to check config files through EM in 10.1.3.3.0

    Hi All,
    I have OAS (10.1.3.3.0) webserver and appserver in installed on different machines.
    as we all know earlier release ie 10g(10.1.2) we can check all he config files like httpd.conf, ssl.conf etc through EM, but can we check config files in this relase ie.(10.1.3.3.0) through EM.
    Regards
    Kumar

    Kumar,
    Oracle HTTP Server (OHS) in 10.1.3.x can not be managed using AS Control (EM), like you could do it in 10.1.2.x. Not just viewing OHS's config files you can't also start/stop it, make config changes (server properties, performance directives, log configuration etc.), view performance metrics and log entries etc. This is mainly due to AS Control in 10.1.3.x is changed to be JMX based and OHS doesn't have any MBeans in 10.1.3.x. So OHS can't be managed and monitored (except seeing its up/down state) via AS Control in 10.1.3.x.
    FYI, OHS in next major release of Oracle Fusion Middleware (i.e. 11gR1) can be fully managed and monitored in AS Control but for now you will have to do it manually.
    Thanks
    Shail

  • Offline Servicing of OS fails (failed to find properties of file 5)

    Hi,
    I'm unable to get the Offline Update Servicing of the OS to work. In the OfflineServicingMgr.log I Keep getting:
    Failed to get update applicability. Dism.exe command line is below:"C:\Windows\system32\cmd.exe" /q /c ""D:\Microsoft\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\dism.exe" /Image:"D:\ConfigMgr_OfflineImageServicing\I0100042\ImageMountDir" /LogPath:%WINDIR%\Logs\Dism\dism_sccmAMD64.log /English /Get-PackageInfo /Packagepath:"D:\ConfigMgr_OfflineImageServicing\fc1721b9-7ee8-44a6-9842-b7d89596f126\KB2890660.cab">>D:\ConfigMgr_OfflineImageServicing\I0100042\[email protected]"
    after this happened 5 times I get the following:
    Failed to find properties of file 5
    UnMounting Image (Commit Changes = 0) ...
    Completed processing image package I0100042. Status = Failed
    I also checked the dism_sccmAMD64.log but can't find a solution to this Problem, there are to much Errors in there.
    dism_sccmAMD64.log:
    2014-08-27 10:34:49, Info DPX Started DPX phase: Apply Deltas Provided In File
    2014-08-27 10:34:49, Info DPX File could not be expanded, Source=update.mum, Target=(null), status=0x80070002
    2014-08-27 10:34:49, Info DPX ProvideRequestedDataByFile failed, Response file Name: \\?\D:\ConfigMgr_OfflineImageServicing\7e1f745c-af8b-47a6-a3e0-41288d29c831\Windows8.1-KB2898464-x64.cab
    2014-08-27 10:34:49, Info DPX Ended DPX phase: Apply Deltas Provided In File
    2014-08-27 10:34:49, Info DPX DpxException hr=0x80070002 code=0x020102
    2014-08-27 10:34:49, Info DPX Ended DPX phase: Resume and Download Job
    2014-08-27 10:34:49, Info DPX DpxException hr=0x80070002 code=0x020217
    2014-08-27 10:34:49, Info CBS Failed to extract file update.mum from cabinet \\?\D:\ConfigMgr_OfflineImageServicing\7e1f745c-af8b-47a6-a3e0-41288d29c831\Windows8.1-KB2898464-x64.cab [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
    2014-08-27 10:34:49, Info CBS Failed to extract package manifest from cabinet [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
    2014-08-27 10:34:49, Info CBS Failed to initialize internal package [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
    2014-08-27 10:34:49, Error CBS Failed to create internal package [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
    2014-08-27 10:34:49, Error DISM DISM Package Manager: PID=7840 TID=31584 Failed opening package. - CDISMPackageManager::Internal_CreatePackageByPath(hr:0x80070002)
    2014-08-27 10:34:49, Error DISM DISM Package Manager: PID=7840 TID=31584 Failed to get the underlying CBS package. - CDISMPackageManager::OpenPackageByPath(hr:0x80070002)
    2014-08-27 10:34:49, Error DISM DISM Package Manager: PID=7840 TID=31584 Failed to open the package at location: "D:\ConfigMgr_OfflineImageServicing\7e1f745c-af8b-47a6-a3e0-41288d29c831\Windows8.1-KB2898464-x64.cab" - CPackageManagerCLIHandler::ProcessPackagePath(hr:0x80070002)
    2014-08-27 10:34:49, Error DISM DISM Package Manager: PID=7840 TID=31584 Failed to get the list of packages from the command line. - CPackageManagerCLIHandler::ProcessCmdLine_GetPackageInfo(hr:0x80070002)
    2014-08-27 10:34:49, Error DISM DISM Package Manager: PID=7840 TID=31584 Failed while processing command get-packageinfo. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80070002)
    2014-08-27 10:34:49, Error DISM DISM.EXE: DISM Package Manager processed the command line but failed. HRESULT=80070002
    2014-08-27 10:34:49, Info DISM DISM Provider Store: PID=7840 TID=31584 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect
    2014-08-27 10:34:49, Info DISM DISM Provider Store: PID=7840 TID=31584 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect
    2014-08-27 10:34:49, Info DISM DISM Provider Store: PID=7840 TID=31584 Found the PE Provider. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect
    2014-08-27 10:34:49, Info DISM DISM Provider Store: PID=7840 TID=31584 Finalizing the servicing provider(DISM Package Manager) - CDISMProviderStore::Internal_DisconnectProvider
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SOFTWARE
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SOFTWARE, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SYSTEM
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SYSTEM, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SECURITY
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SECURITY, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SAM
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/SAM, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/COMPONENTS
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/COMPONENTS, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/DEFAULT
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/System32/config/DEFAULT, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Users/default/ntuser.dat
    2014-08-27 10:34:49, Info CBS Failed to unload offline registry: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Users/default/ntuser.dat, the client may still need it open. [HRESULT = 0x80070005 - E_ACCESSDENIED]
    2014-08-27 10:34:49, Info CBS Unloading offline registry hive: {bf1a281b-ad7b-4476-ac95-f47682990ce7}D:/ConfigMgr_OfflineImageServicing/I0100042/ImageMountDir/Windows/system32/smi/store/Machine/schema.dat

    Right before, the error you mentioned, I see a couple of file not found message. You might want to check those, still it can be anything from a file that doesn't exist till too little disk space.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Delete multiple files from multiple locations using config file

    Hello All,
    I am fairly new to .net and I have to make a windows application to delete files older than 90 days from multi ple locations. these multiple locations cant be hard coded and have to be configurable, also the number of days to delete the files have to be
    configurable.
    I think the answer to this would be an app.config file. but dont know how to use the same.
    can anyone tell me about this and if possible help me out with a code snippet.?

    Add settings like picture below.  Add the string by press the double dot icon.
    The use the code below
    static void Main(string[] args)
    int deleteDays = Properties.Settings.Default.DeleteDays;
    StringCollection folders = Properties.Settings.Default.Folders;
    foreach (string folder in folders)
    DirectoryInfo info = new DirectoryInfo(folder);
    FileSystemInfo[] deleleteFiles = info.EnumerateFiles()
    .Where(x => x.LastWriteTime < DateTime.Today.AddDays(deleteDays))
    .ToArray() ;
    foreach(FileSystemInfo file in deleleteFiles)
    File.Delete(file.FullName);
    jdweng

  • Dynamic configuration of properties/descriptor files?

    Hello all,
    I am trying to use configuration files used in j2ee applications (property files, deployment descriptors) in a more dynamic manner. I have been searching for a suitable solution for some time now.
    I have come across the following syntax within a configuration or properties file in a legacy project that I am to maintain.
    <some-tag>
    <some-config value=${theVariable}/>
    </some-tag>
    Notice the JSTL-like syntax ${theVariable}
    The above code comes from an xreg config file, read at startup.
    I do not think that there is custom code that parses the file so that it is updated, but I think that this is a pretty cool mechanism for dynamic configuration of applications especially if the properties come from the shell environment variables and can be set at will, or from the java -D option.
    If anyone knows anything about this technique please respond to the present mail or to [email protected]
    thank you,
    Joe
    Joe

    Hi,
    I have very similar requirement, In my scenario I need to pick up files from 4 static locations and based on the file name and pick up type(file/ftp) I can find out the destination's connectivity information from a Cross-Referencing table(Based on MS-SQL Database table- I can get this using look API) in this table we maintaining more than 100 destinations(host/user_name/password etc).
    Now I need to set the connectivity information dynamically at runtime. I know this is not possible with Standard XI but does anyone thinks this is possible by any technical way using with XI.. Adapter Modules or Java Proxies?
    This is very Critical to win the war with other middleware tools. Please let me know your thoughts and comments...
    thanks,
    Laxman Molugu

  • ClassLoader in JAR file not loading config file properly

    Hi all,
    I have an application that I am going to deploy using JavaWS, and everything works fine except for one little hitch. I have a configuration file, nvacconfig, located at NVAC.jar/config/nvacconfig. I'm trying to load this file into my application using a ClassLoader, but it does not seem to be working.
    I have a method from a certain class that loads the configuration file. The class is not important, as it is part of an API that I cannot alter. This class has a load(String file) method, that loads the specified configuration file with a String argument. This works fine when I run my application from the command line and when the configuration file is not located in the JAR, but I need to include this configuration file in my JAR, so I can run my app in the JWS sandbox.
    To load the file when it is NOT inside a JAR, and is simply located at config/nvacconfig, I just use:
    id.properties.load("config/nvacconfig");and it loads the configuration file, nvacconfig.
    When I include the file in my JAR and try to load it using a ClassLoader, it does not seem to work, and the load method cannot find the file. This is how I am trying to accomplish this:
    ClassLoader cl = this.getClass().getClassLoader();
    URL url = cl.getResource("config/nvacconfig");
    String file = url.toString(); //I have also tried String file = url.getFile();
    id.properties.load(file);This does not work, and I'm not sure why.
    Is there something I am doing wrong? Is this the wrong way to go about this?
    Any advice would be greatly appreciated.
    Thanks,
    Dan
    Message was edited by:
    Djaunl

    try this:
    import java.io.*;
    import java.util.jar.*;
    import java.util.zip.*;
    public class ExtractFromJAR {
         public void extractFileFromJAR(String dest, String fileName) {
              try {
                   String home = getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replaceAll("%20",
                   JarFile jar = new JarFile(home);
                   ZipEntry entry = jar.getEntry(fileName);
                   File efile = new File(dest, entry.getName());
                   InputStream in = new BufferedInputStream(jar.getInputStream(entry));
                   OutputStream out = new BufferedOutputStream(new FileOutputStream(efile));
                   byte[] buffer = new byte[2048];
                   for (;;) {
                        int nBytes = in.read(buffer);
                        if (nBytes <= 0)
                             break;
                        out.write(buffer, 0, nBytes);
                   out.flush();
                   out.close();
                   in.close();
              } catch (Exception e) {
                   e.printStackTrace();
         public static void main(String args[]) {
              new ExtractFromJAR().extractFileFromJAR(".", "file.txt");
    }

  • Startup class cannot find a config file.

    I have written a startup class to configure log4j in Weblogic.
    The class runs but cannot find the configuration file. The
    code for the startup class is as follows....
    package com.n2bb.ams.common.util;
    import java.io.FileInputStream;
    import java.io.File;
    import java.io.IOException;
    import java.net.URL;
    import java.util.Properties;
    import com.n2bb.ams.common.util.FileLocator;
    import org.apache.log4j.xml.DOMConfigurator;
    * Insert the type's description here.
    * Creation date: (12/5/00 11:12:13 AM)
    * @author: Administrator
    public class ApplicationStartUp implements weblogic.common.T3StartupDef {
         * ApplicationStartUp constructor comment.
         public ApplicationStartUp() {
              super();
         * setServices method comment.
         public void setServices(weblogic.common.T3ServicesDef arg1) {
         * startup method comment.
         public String startup(String arg1, java.util.Hashtable arg2) throws Exception {
              String resource = null;
              try {
                   resource = (String) arg2.get("configFileName");
                   System.out.println("ConfigFileName: " + resource);
                   URL configFileResource = ApplicationStartUp.class.getResource(resource);
                   System.out.println("configFileResource: " + configFileResource.toString());
                   String file = configFileResource.getFile();     
                   DOMConfigurator.configure(file);
                   return "Log4j configuration initialized completed.";          
              } catch (Exception e) {
                   System.out.println("Cannot open config file: " + resource);
                   return "Log4j configuration failed to initialized.";
    The section of the config.xml the calls my startup class looks
    like....
    <StartupClass
    Arguments="configFileName=/bea/user_projects/mydomain/log4j-config.xml"
    ClassName="com.n2bb.ams.common.util.ApplicationStartUp"
    Name="AMS Startup Class" Targets="myserver"/>
    I have tested the code in a standalone class and it works fine.
    Why can't I find the log4j-config.xml file? Any help would be
    greatly appreciated.

    Wow, your system must have a long history of having picked up assorted bad stuff ...
    You have CleanMyMac2, which should definitely be removed.
    You have other stuff (MacCleanse, for example) that I don't have first-hand knowledge about but should very likely be removed.
    You are using Google Chrome which is a resource hog.
    Further, your Adobe Flash player is not current.
    If I had all these issues, I would do a clean install of Yosemite and only reintroduce the essential stuff.
    You can search for the .plist files by opening finder, holding down the Option key, and doing Go > Library from Finder's menu and then searching for the file(s).

  • How to use a config file?

    People,
    i have a basic question. How to extract the contents from a ".config" file?
    I have a config file with few sections and few global variables defined.
    how to extract these data; or how to use this file?
    a sample .config file, that i have is,
    # global variables
    pageTitle = "Main Menu"
    bodyBgColor = #000000
    tableBgColor = #000000
    rowBgColor = #00ff00
    [Customer]
    pageTitle = "Customer Info"
    [Login]
    pageTitle = "Login"
    focus = "username"
    Intro = """This is a value that spans more
    than one line. you must enclose
                   it in triple quotes."""
    # hidden section
    [.Database]
    host=my.domain.com
    db=ADDRESSBOOK
    user=php-user
    pass=foobar
    How would i extract these data; or how to utilize this file first of all?
    - Kumar
    [ [email protected] ]

    Hi Kumar,
    Instead of .config file you can use .properties file. Place the configuration part in that file. Use ResourceBundle class. This class have methods like getResourceString(String key) which reads the .properties file and returns a String as it's Value. I normally use the same. I have written one class for it. C if you can use it. The keys are case sensitive. initialize is a directory in which i am keeping my Config.properties file.
    import java.util.*;
    import java.text.*;
    import java.net.*;
    import javax.swing.*;
    public class ReadConfig
    public static ResourceBundle resources;
    * This is responsible for getting data from Config.properties for setting properties externally.
    static
    try
    resources = ResourceBundle.getBundle("initialize.Config", Locale.getDefault());
    catch (MissingResourceException mre)
    JOptionPane.showMessageDialog(new JFrame(), "initialize/Config.properties not found.\n Please report it to administrator.");
    System.err.println("initialize/Config.properties not found");
    System.exit(1);
    }//static
    public ReadConfig()
    System.out.println(getResourceString("DatabaseName"));
    System.out.println(getResourceString("JDBCDriver"));
    System.out.println(getResourceString("DSN"));
    System.out.println(getResourceString("ConnectionString"));
    }//constructor
    public String[] tokenize(String input)
    Vector v = new Vector();
    StringTokenizer t = new StringTokenizer(input);
    String cmd[];
    while (t.hasMoreTokens())
    v.addElement(t.nextToken());
    cmd = new String[v.size()];
    for (int i = 0; i < cmd.length; i++)
    cmd[i] = (String) v.elementAt(i);
    return cmd;
    * A method takes string as parameter and reference of ResourceBundle.
    * It is used with <b>Resources Bundle</b> i.e. with .properties file.
    * When value of particular string from .properties file has to retrive.
    public String getResourceString(String nm, ResourceBundle resources)
    String str;
    try
    str = resources.getString(nm);
    catch (MissingResourceException mre)
    str = null;
    return str;
    * A method takes string as parameter. It is used with <b>Resources Bundle
    * </b> i.e. with .properties file. When value of particular string from .properties
    * file has to retrive.
    public static String getResourceString(String nm)
    String str;
    try
    str = resources.getString(nm.trim());
    catch (MissingResourceException mre)
    str = null;
    return str;
    }//getResourceString(String nm)
    * This method takes string as parameter and returns corresponding <b>URL</b>.
    * If key is <b>null</b>, then will return <b>null</b>.
    public URL getResource(String key)
    String name = getResourceString(key);
    if (name != null)
    URL url = this.getClass().getResource(name);
    return url;
         return null;
    }//getResource(String key)
    public static void main(String[] args)
    new ReadConfig();
    }//main
    }//class
    Hope this will be helpful to you.
    Kind Regards
    Sandeep

  • Config - files ???

    is there any built-in functions for reading/writing configfiles in JAVA?
    if there is(I think I saw some examples somewhere, but I do not rember where) please give me a link where I can find examples
    thanks in advance
    .leonard

    It s quite easy to read config files.
    This works for me :
    Properties properties = new Properties();
    properties.load(getClass().getResource(filename).openStream());
    String prop1 = properties.getProperty("prop.propName1");
    String prop2 = properties.getProperty("prop.propName2");
    ...

  • Facec-config file in JDeveloper 11.1.1.1.0

    Adding following in faces-config file causes 'Unexpected severe Jdeveloper error' dialog box whenever I open jspx file. I am using JDeveloper 11.1.1.1.0
    <resource-bundle>
    <base-name>message</base-name>
    <var>msg</var>
    </resource-bundle>
    Why is this happening & is there any configuration change if done in Jdeveloper, this error can be avoided ?

    1) Select the project for which you would like to generate the jar.
    2) Right Click the selected right and select 'Project Properties'
    3) Select the 'Deployment' in the left tab.
    4) Click on 'New' to create a new deployment profile and in the popup dialog, select 'Jar File' profile type and provide the name.
    5) Press 'ok' to save the changes.
    6) Select the project and right click and select 'Deploy to' and select the jar profile name you have specified.
    The Jar library is generated and the full path to the library jar is shown in the log window.
    Thanks,
    Navaneeth

  • Setting Logging API config file

    Hi,
    Is there a way I can set the Logging API's config file (java.util.logging.config.file) from within my program? I have tried using System.setProperty but it doesn't seem to work. The only way I seem to be able to set the property is with -D on the command line.
    Thanks
    Rob

    Is there a way I can set the Logging API's config file (java.util.logging.config.file) from within my program? I have tried using System.setProperty but it doesn't seem to work. The only way I seem to be able to set the property is with -D on the command line.Read the Logging Overview Dokumentation
    anyway
    InputStream inputStream = new FileInputStream("logging.properties");
    LogManager.getLogManager().readConfiguration(inputStream);
    ...

Maybe you are looking for

  • Application crashes when using JNI with Jdk 1,2, 1.3 and 1.4

    Hi! I have this application that has a GUI written in Java and a file parser written in C. JNI is used to connect these parts together. The problem is that the application only works when I am using jdk 1.1.8 but not when using jdk1.2, jdk1.3 or jdk1

  • HT1373 Authorizing Multiple Apple IDs on iTunes

    Years ago, when first signing up to use iTunes, I registered an ID and Password.  After some time and buying many songs, I changed my Apple ID and Password.  I recently purchased a new computer and discovered in order to get all my purchased songs on

  • Can I modify the value of an enviroment entry for an EJB without having to re-deploy.

    I wish to modify the value of an envrioment entry for an EJB. The entry already exists and has been created using <env-entry> <env-entry-name>myFlag</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>true</env-entry-v

  • Netflix on iPad G1

    I rencently found out that i can get netflix on my iPad G1, but when i go to the app store and try to download it, it tells me that i need to update to the latest verison of ISO 6, but apparently i cant get 6 or 7 on the first ipad. Is there anything

  • What is the Safe OC (base clock) for MSI Eplices plus?

    Default Base clock for this board is 134. How much can i go still consider as safe OC?