Get domain root directory programmatically

hello,
          There is any way to get the domain root directory path programmatically ??
          i.e : D:\bea\user_projects\domains\platformR1
          thanks

John,
OK. If you want to go the JMX route, have a look at the CurrentDirectory attribute of the ServerRuntime mbean. It would report your directory as this:
C:\bea\user_projects\domains\myDomain\.
Mike
Weblogic/J2EE Security Blog: http://monduke.com

Similar Messages

  • Getting Application root directory name dynamically

    hi all,
    For some reason I need to get Application root directory name dynamically
    and use it somewhere.
    Im using resin and default app dir is "doc" i've another directory "abc" and set
    that as application root directory.
    So from jsp i need to get the application root directory name.
    thx in adv,
    kiran

    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath
    use the following in you jsp
    <%=application.getRealPath("/")%>this will give you the application root directory.

  • How to get the root directory of a domain?

    I have a domain setup at
    C:\bea\user_projects\domains\myDomain
    I have tried the following;
    Getting the domain object : get attr DomainConfiguration from DomainRuntimeServiceMBean
    Get root dir : get attr RootDirectory from domain object
    It returns ".", but I need the full path.
    Is there an issue with the RootDirectory from domain object or in my approach?

    John,
    OK. If you want to go the JMX route, have a look at the CurrentDirectory attribute of the ServerRuntime mbean. It would report your directory as this:
    C:\bea\user_projects\domains\myDomain\.
    Mike
    Weblogic/J2EE Security Blog: http://monduke.com

  • How to get jdk installation directory programmatically?

    when we install jdk, we can select a directory to install it, i.e.
    F:\myfolder\jdk1401
    this is not JRE directory and can not be got by java method System.getProperties()
    my Q is:
    how to get the directory progammatically in Java program?
    thx

    Most commercial software gives the user the oppotunity to specify the JDK they want to use. Some search for the JDK for them, but often involve a directory search. The registry trick should work, but you need to check the directory still exists. The user can move/delete it without the registry being updated, this is very easy if the drive is a network drive.
    Note:
    if the jdk is installed on a network drive, the registry may not be setup for each user. They can see it but it does not appear in the registry.
    If you setting up a web server e.g. tomcat, it typically runs as a different login id to the user installing it. Network drives are different for different users, so network drive letters may not work. Using the UNC instead of the drive letter can get around this problem.
    If the user tries to install his run anay where software on a non-windows system, there will be no registry.
    Good Luck.

  • How to get the current application root directory

    Hi Experts,
    I am deploying an ADF Application to a Standalone WLS 10.3. During development I am using Integrated WLS (which comes with JDeveloper 11.1.1.5.0). During development, I configured my application to create log files in my local machine (where Integrated WLS is running) by using absolute path for my log file. Now, I am moving to a standalone instance of WLS for testing (before moving to production).
    Now I need to keep my log files under my application root directory. Please let me know how to get the absolute path of the deployed application root directory from WLS ENV/System property into my application's Java Code.
    I tried the below java code,
    Current weblogic server name is: " + System.getProperty("weblogic.Name") --> This gives me the name of the server where my application is running.
    Current weblogic server name is: " + System.getProperty("weblogic.Root") --> This returns NULL. How to get the Root directory of my application using some system property inside my application at runtime??
    Thanks
    Rathnam

    One method is to create a File(""); and do getPath() on it.
    At least it's worked for me.

  • Obtaining root directory of web application

    Hi all.
    I am beginer in web application developing. You probably know how it is. Problem after problem:)
    So I started developing in JSF using NetBeans 6.0 with Tomcat 6.0.14 and i have the folowing problem:
    How can I programically get the root directory of my web application? I need it because I use some kind of filter, which redirects to error page, when unauthorized user tries to access protected resources. This error page is in root directory of my web application and has commandLink to logging site (action is set for method, which returns some string and navigation is defined for this string in facesconfig.xml), which is also in root directory. When I want to access for example /restricted/user/userPage.jsp and I am not logged in, the error page is displayed, but command link does not work. I supose the is a problem in current directory which is probably set for /restricted/user/.
    Thank You for any clues.
    Regards,
    Jahn Gurda

    Hello!
    I am also new to web applications and JSF. But I can tell you that its a little hard to programically achieve the security you want to achieve i.e. displaying some error page if the user is not logged in, however you can do it relatively easily using web.xml or sun-web.xml files by defining some roles, filters etc.
    I read that somewhere, try searching on Google...I have not implemented that myself.
    As far as obtaning the root directory of web application is concerned you may try following in your button_action method or any where in Page Bean class:
    ServletContext theApplicationsServletContext = (ServletContext) this.getExternalContext().getContext();
    String rootPath = theApplicationsServletContext.getRealPath("/");Then use "rootPath" where ever you want, it contains the path of the root directory.
    It atleast works for me.....
    Its strange that no one has answered this query for so long. Hope someone does early, I also want the clear answer.
    Thanks!
    Edited by: T.B.M on Oct 20, 2008 12:45 AM

  • Set installer root drive programmatically

    Hi Gang,
    I'm creating a "master installer" in LV that will in turn install 3 existing apps by running the installers programmatically.  I don't know much about the MSI.  Is there a way to set the root directory programmatically by a command line argument or a text file setting or something?  As with every project, we're pressed for time.
    I'll appreciate any help.
    Thanks,
    Roger

    A starting point is to create one of the installers and run its setup.exe with:
    setup.exe /?
    I don't see a ROOTDIR override. The help says to search NI.com for "InstallerAutomation", which turns up this:
    http://digital.ni.com/public.nsf/allkb/878FC4C374013ADF8625733D00688F67?OpenDocument
    Not what you need, though.

  • FinRep 9.3.1: All users getting error opening reports from root directory

    We are having an irritating, although not missiion critical error
    When a user (any user) attempts to open a report from the explorer view in Financial Reporting 9.3.1, we receive an "_Error 1000165"._ No explanation is provided. No folders are openable within the explorer view except "Personal Page."
    It is possible to open reports by opening a report that got accidentally stored in the root directory and then opening another report from the menu system in the usual way. So it is not a user permissions/provisioning issue.
    Is there a fix to this? I am afraid someone will clean out the root directory and then we won't be able to access our reports.
    Update: I can use the pattern "VariancePercent([B(A)],[A(A)])" to cut this to 27 Columns by varying the direct reference to the column. But is there an easier way to do this?
    Edited by: user10868938 on Feb 24, 2009 3:43 PM

    We have been able to complete the update of our users SSID's in our Planning SQL tables through the utility. We had to create the users in Essbase first though.
    However, if I try to log into Planning (through Workspace) I still cannot see the Planning applicaitons I should have access too. In Shared Services if I pull up my network ID and View Report, I do not get any Planning groups to show up that I belong too. I can open the group in HSS and see my ID is in it but when I do the View Report on my ID nothing comes up.
    Additionally, if I add a user from scratch to the existing Planning groups that we've migrated and do the View Report they will show up for that user and the security passes through to Planning/Essbase so that I could log on fine. So, the problem is not with adding new users but the existing one's that were migrated. HSS shows the users in the groups but if you view a Report for those users it doesn't look like you belong to any groups.
    We are going to apply a patch to Shared Services to see if it helps. It's suppose to deal with Groups that have users from multple domains but one set of those users cannot log into the application they should have access too. We applied this in our stand-alone S9 Essbase environment a couple of months ago to deal with a break between our existing users and groups from HSS to Essbase. Maybe this will be the final piece.

  • Policy domain root for Active directory

    Does anyone know how to configure policy domain root in Active directory ?.
    I am installing COREid Access policy manager which needs a policy domain root input during the web interface configuration.
    Please some one help in resolving this issue.

    Hi,
    I might help if can give the exact description of the issue that you are getting. However I have encountered similar or exact problem that you are having. Let me know whci ldap directory you are using with your CoreID install.

  • How can i get also the files in the root directory and how can i for testing add items of IEnumerable FTPListDetail to List string ?

    What i get is only the directories and files that in other nodes. But i have also files on the root directory and i never
    get them. This is a screenshot of my program after i got the content of my ftp. I'm using treeView to display my ftp content:
    You can see two directories from the root but no files on the root it self. And in my ftp server host i have files in the root direcory.
    This is the method i'm using to get the directory listing:
    public IEnumerable<FTPListDetail> GetDirectoryListing(string rootUri)
    var CurrentRemoteDirectory = rootUri;
    var result = new StringBuilder();
    var request = GetWebRequest(WebRequestMethods.Ftp.ListDirectoryDetails, CurrentRemoteDirectory);
    using (var response = request.GetResponse())
    using (var reader = new StreamReader(response.GetResponseStream()))
    string line = reader.ReadLine();
    while (line != null)
    result.Append(line);
    result.Append("\n");
    line = reader.ReadLine();
    if (string.IsNullOrEmpty(result.ToString()))
    return new List<FTPListDetail>();
    result.Remove(result.ToString().LastIndexOf("\n"), 1);
    var results = result.ToString().Split('\n');
    string regex =
    @"^" + //# Start of line
    @"(?<dir>[\-ld])" + //# File size
    @"(?<permission>[\-rwx]{9})" + //# Whitespace \n
    @"\s+" + //# Whitespace \n
    @"(?<filecode>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<owner>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<group>\w+)" +
    @"\s+" + //# Whitespace \n
    @"(?<size>\d+)" +
    @"\s+" + //# Whitespace \n
    @"(?<month>\w{3})" + //# Month (3 letters) \n
    @"\s+" + //# Whitespace \n
    @"(?<day>\d{1,2})" + //# Day (1 or 2 digits) \n
    @"\s+" + //# Whitespace \n
    @"(?<timeyear>[\d:]{4,5})" + //# Time or year \n
    @"\s+" + //# Whitespace \n
    @"(?<filename>(.*))" + //# Filename \n
    @"$"; //# End of line
    var myresult = new List<FTPListDetail>();
    foreach (var parsed in results)
    var split = new Regex(regex)
    .Match(parsed);
    var dir = split.Groups["dir"].ToString();
    var permission = split.Groups["permission"].ToString();
    var filecode = split.Groups["filecode"].ToString();
    var owner = split.Groups["owner"].ToString();
    var group = split.Groups["group"].ToString();
    var filename = split.Groups["filename"].ToString();
    var size = split.Groups["size"].Length;
    myresult.Add(new FTPListDetail()
    Dir = dir,
    Filecode = filecode,
    Group = group,
    FullPath = CurrentRemoteDirectory + "/" + filename,
    Name = filename,
    Owner = owner,
    Permission = permission,
    return myresult;
    And then this method to loop over and listing :
    private int total_dirs;
    private int searched_until_now_dirs;
    private int max_percentage;
    private TreeNode directories_real_time;
    private string SummaryText;
    private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
    var directoryNode = new TreeNode(name);
    var directoryListing = GetDirectoryListing(path);
    var directories = directoryListing.Where(d => d.IsDirectory);
    var files = directoryListing.Where(d => !d.IsDirectory);
    total_dirs += directories.Count<FTPListDetail>();
    searched_until_now_dirs++;
    int percentage = 0;
    foreach (var dir in directories)
    directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
    if (recursive_levl == 1)
    TreeNode temp_tn = (TreeNode)directoryNode.Clone();
    this.BeginInvoke(new MethodInvoker( delegate
    UpdateList(temp_tn);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    percentage = (searched_until_now_dirs * 100) / total_dirs;
    if (percentage > max_percentage)
    SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
    max_percentage = percentage;
    backgroundWorker1.ReportProgress(percentage, SummaryText);
    foreach (var file in files)
    TreeNode file_tree_node = new TreeNode(file.Name);
    file_tree_node.Tag = "file" ;
    directoryNode.Nodes.Add(file_tree_node);
    numberOfFiles.Add(file.FullPath);
    return directoryNode;
    Then updating the treeView:
    DateTime last_update;
    private void UpdateList(TreeNode tn_rt)
    TimeSpan ts = DateTime.Now - last_update;
    if (ts.TotalMilliseconds > 200)
    last_update = DateTime.Now;
    treeViewMS1.BeginUpdate();
    treeViewMS1.Nodes.Clear();
    treeViewMS1.Nodes.Add(tn_rt);
    ExpandToLevel(treeViewMS1.Nodes, 1);
    treeViewMS1.EndUpdate();
    And inside a backgroundworker do work how i'm using it:
    var root = Convert.ToString(e.Argument);
    var dirNode = CreateDirectoryNode(root, "root", 1);
    e.Result = dirNode;
    And last the FTPListDetail class:
    public class FTPListDetail
    public bool IsDirectory
    get
    return !string.IsNullOrWhiteSpace(Dir) && Dir.ToLower().Equals("d");
    internal string Dir { get; set; }
    public string Permission { get; set; }
    public string Filecode { get; set; }
    public string Owner { get; set; }
    public string Group { get; set; }
    public string Name { get; set; }
    public string FullPath { get; set; }
    Now the main problem is that when i list the files and directories and display them in the treeView it dosen't get/display
    the files in the root directory. Only in the sub nodes.
    I will see the files inside hello and stats but i need also to see the files in the root directory.
    1. How can i get and list/display the files of the root directory ?
    2. For the test i tried to add to a List<string> the items in var files to see if i get the root files at all.
       This is what i tried in the CreateDirectoryNode before it i added:
    private List<string> testfiles = new List<string>();
    Then after var files i did:
    testfiles.Add(files.ToList()
    But this is wrong. I just wanted to see in testfiles what items i'm getting in var files in the end of the process.
    Both var files and directoryListing are IEnumerable<FTPListDetail> type.
    The most important is to make the number 1 i mentioned and then to do number 2.

    Risa no.
    What i mean is this. This is a screenshot of my ftp server at my host(ipage.com).
    Now this is a screenshot of my program and you can see that in my program i have only the directories hello stats test but i don't have the files in the root: htaccess.config swp txt 1.txt 2.png....all this files i don't have it on my treeView.
    What i want it to be is that on my program on the treeView i will also display the files like in my ftp server.
    I see in my program only the directories and the files in the directories but i don't see the files on the root directory/node.
    I need it to be like in my ftp server i need to see in my program the htaccess 1.txt 2.png and so on.
    So what i wrote in my main question is that in the var files i see this files of the root directory i just don't know to add and display them in my treeView(my treeView is treeViewMS1).
    I know i checked in my program in the method CreateDirectoryNode i see in the first iteration of the recursive that var files contain this root files i just dont know how to add and display them in my treeView.
    On the next iterations when it does the recursive it's adding the directories hello stats test and the files in this directories but i need it to first add the root files.

  • How do I get iWeb to publish just the files to my root directory

    Hey all, when I publish my site to my hosting server via iWeb it's just copying the entire folder into my root directory instead of copying the files to the root directory. This is causing my site url to look like this: www.mysite.com/myfolder/ how do I get iWeb to publich the files in the "myfolder" to my server instead of the entire folder?

    I needed to do this while keeping ftp publishing inside iWeb, and so I developed a sneaky solution. I just figured this out, so there may be some extra steps in here. Here goes:
    Find the iWeb application on the computer you are publishing from.
    Control-Click on the application and choose "Show Package Contents".
    In the window that appears, open the folder "Contents".
    Control-Click on the folder "Resources" and choose "Get Info".
    In the window that appears, open the "Sharing and Permissions" drop-down.
    Click the lock in the lower-right corner and enter your password.
    Where it says "Read Only" across from "Everyone", click the arrows and choose "Read and Write".
    Close the "Info" window and open the "Resources" folder.
    Find the "defaultPublishConfiguration.plist" file and change the permissions (repeat steps 4-7 but with "defaultPublishConfiguration.plist" instead of the "Resources" folder).
    Open the "defaultPublishConfiguration.plist" file in TextEdit.
    Find the line "<string>/Web/Sites</string>".
    Change it to "<string>/Web</string>".
    Save and close the text file.
    Restart iWeb.
    Go to your publishing settings and enter the information for your server. Point the "Directory/Path" to the folder above your server's root web folder.
    Set "Site Name" to the name of your server's web folder.
    Make sure that none of the files in your server's web folder have the same name as those iWeb would upload.
    Select File>Publish Entire Site.
    It should now publish your site to "http://www.yourdomain.org/Home.html".
    Hope it works!
    mindoftea

  • Getting list of files in root directory

    I have seen many forum talking somewhat on this subject but I always see them using c: (for windows) as the example directory. I need to write this so that I can go to a Unix directory.
    Example:
    I want to go to the root directory from where I am....I would use runtime.exec(), right? But does the runtime actually go to that directory or just run the exec?
    If there was a "name" such as c: in unix like windows it would be easier. But, I can not just say the name of the directory is / to get in there and check out the files. So, really what I want to do is if someone is not in the particular directory I want to be able to go to the root directory and check files there, then go to another directory and check the files there, etc.
    I have a hard time explaining things so hopefully someone will get me.
    Thanks.

    But the trouble I am running in to is that I want the
    root directory in Unix, which would be /. I can not
    not just put that as the directory, can i?You can if you spell it out:
    /export/home/thefunnyrootename
    ... or use:
    String sysprop = System.getProperty("whatever property");
    File f = new File(sysprop);... To determine which you want, SDK v1.3.1 docs for System.getProperty():
    getProperties
    public static Properties getProperties()
        Determines the current system properties.
        First, if there is a security manager, its checkPropertiesAccess
    method is called with no arguments. This may result in a security
    exception.
        The current set of system properties for use by the
    getProperty(String) method is returned as a Properties object.
    If there is no current set of system properties, a set of system
    properties is first created and initialized. This set of system
    properties always includes values for the following keys:
        Key Description of Associated Value
        java.version Java Runtime Environment version
        java.vendor Java Runtime Environment vendor
        java.vendor.url Java vendor URL
        java.home Java installation directory
        java.vm.specification.version Java Virtual Machine specification version
        java.vm.specification.vendor Java Virtual Machine specification vendor
        java.vm.specification.name Java Virtual Machine specification name
        java.vm.version Java Virtual Machine implementation version
        java.vm.vendor Java Virtual Machine implementation vendor
        java.vm.name Java Virtual Machine implementation name
        java.specification.version Java Runtime Environment specification version
        java.specification.vendor Java Runtime Environment specification vendor
        java.specification.name Java Runtime Environment specification name
        java.class.version Java class format version number
        java.class.path Java class path
        java.ext.dirs Path of extension directory or directories
        os.name Operating system name
        os.arch Operating system architecture
        os.version Operating system version
        file.separator File separator ("/" on UNIX)
        path.separator Path separator (":" on UNIX)
        line.separator Line separator ("\n" on UNIX)
        user.name User's account name
        user.home User's home directory
        user.dir User's current working directory
    Note that even if the security manager does not permit the getProperties
    operation, it may choose to permit the getProperty(String) operation.
    Returns:
    the system propertiesThrows:
    SecurityException - if a security manager exists and its
    checkPropertiesAccess method doesn't allow access to the system
    properties.See Also:
    setProperties(java.util.Properties), SecurityException,
    SecurityManager.checkPropertiesAccess(), Properties~Bill

  • Policy domain root for Activer directory

    I am setting up the access manager with active directory . But during web configuration ,it prompts for providing a policy domain root. I choose go ahead with default vlaue (i.e /). But it is returning me following error.
    "Error in setting Policy Domain Root."
    Please some one help out in resolving this issue.

    Hi Nataraj,
    I know what your problem is. Go to the computer running Active Directory, open "Open Active Directory Domains and Trusts" under Start -> Administrative tools. Right click on your domain shown and choose "Raise Domain to Functional level", you might need to this three to four times before this takes effect.
    Then on the same window, right click on "active directory domains and trusts" and choose "Raise Forest functional Level", you might need to do this three times as well.
    This will solve your problem, unfortunately you'll have to reinstall Access/Policy Manager. I have had this problem many times and this solved it. I am assuming you are using Windows 2003 Enterprise server.
    Rgds,
    Boland

  • Get installation directory programmatically

    is it possible to get user installation directory of jdk programmatically?
    i.e. j2se was installed to
    f:\mydir\jdk14
    how to get the directory in java program?
    java.home is run-time environment directory looks like c:\program file\..., not user installation directory i needed.
    thx

    The JDK is usually NOT installed in the same place as the JRE.We are obviously talking about different things.
    In my JDK C:\j2sdk1.4.2_05 there is a JRE C:\j2sdk1.4.2_05\jre
    They can be installed in different places but I assume you are talking about different installs in different places. i.e. the JDK and JRE have been installed seperately.
    I need to obtain user installation directory programmatically You can look at the PATH and the registry. However if the user installs more than one JDK, which copy are you going to chose. Most applications which need a seperate JDK search for the JDK when installed and then ask the user which JDK to use.
    - System.getProperties() will not get the directory - i have tested with all jdks and all windows OS.
    One thing you can do with ant is to write the directory used to build an application into the application for it to find. I would concider this bad practice and unreliable however.
    who can answer my Q?The reason the JDK is seperate from the JRE is so that once development has be done you can run the JRE and not need the development portions which come with the JDK. If you need still need components of the JDK, why don't you start the application in the JDK.

  • I used Iolo to "clean" my hard drive, and now I can't access some websites, including facebook. How can I fix this? I get what looks like a root directory.

    Since using Iolo yesterday, I can't bring up the full front page of some websites, including Bing. Bing is a grey, blank screen. Lumosity looks like part of a root directory. How can I fix this? I'm trying to use IE instead, and having problems with that, too, and I don't like it anyway.

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

Maybe you are looking for

  • Problem of using Run-chart in displaying result history of QM

    Hello all, I met a problem about the using of Run-chart in displaying result history of QM, normally, when you use this button to do a statistical chart for checking, the data would be displayed in the measure unit of Inspection Lot. What I want to k

  • Two itune accounts with two iphones but we want to share each other's music

    Hello, My husband and I both have Iphones and two separate itunes accounts.  Our PC's are set up on home sharing so the music we download is in our itunes library, however, I can't seem to move anything he's purchased on to my phone.  How can we do t

  • TS1436 Hi and Help.  I can't burn a CD on my I Mac.

    This is a new issue.  I have always been able to do it in the past.  Since updating to the new version of I-Tunes, I can't do it.  I am able to play a store bought CD and Video.  I am able to burn a disk with Photos on it, but I cannot burn a music C

  • Premiere Pro CC - How can I export custom metadata into Excel?

    I'm trying to export custom metadata from Premiere CC into Excel. I can create the custom metadata and I've been using the following workflow to get it to excel: File: Export: Batch List This exports a .csv file but the only metadata I can produce is

  • Self referencing alias of shared drive

    My Issue: I'm using an iMac with freshly installed OS X Mavericks. I can't access a shared drive from a remote MacMini anymore. When I click on the drive, I get a self reference and thus an infinite loop to that drive. How I got there: Like before in