This discussion is archived
3 Replies Latest reply: Feb 20, 2011 8:49 PM by handat RSS

Glassfish Working Directory

tdio Newbie
Currently Being Moderated
I've noticed that Glassfish's working directory is located at /domain_dir/domain/config. Is there anyway to change the working directory location?
  • 1. Re: Glassfish Working Directory
    handat Expert
    Currently Being Moderated
    What do you mean by working directory? The directory you mentioned is the instance configuration directory where logically all the configurations are stored at, but temporary files or compiled files don't go there.
  • 2. Re: Glassfish Working Directory
    tdio Newbie
    Currently Being Moderated
    What I mean by working directory is inside your program when your reference a file by relative path ./app/myapp/config in Weblogic that would translate in to absolute path of /domaindir/domain/app/myapp/config but in Glassfish it is /domaindir/domain/config/app/myapp/config
  • 3. Re: Glassfish Working Directory
    handat Expert
    Currently Being Moderated
    Using a relative PATH like what you were doing is not recommended because as you have seen, the result will vary between application servers.

    To get the location you want, you can use the following variable from the system and prepend it to your file path:

    "com.sun.aas.instanceRoot"

    If you really want to change the default, you can set the system variable for "user.dir"

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points