• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 730
  • Last Modified:

java execution path

if i have a java class configured to be accessed (via cfobject) and it uses a .property file or writes to a log, or needs any access to the file system, where is the default location or current directory?
0
peteodonnell
Asked:
peteodonnell
  • 3
  • 3
1 Solution
 
cheekycjCommented:
It should be based on the Java File (if its a servlet, then the web app location, if its a standard java class then wherever that it is).  Irrelevant of CF.

CJ
0
 
peteodonnellAuthor Commented:
out of curiousity, i wrote a small java class which creates a file and writes a line to it.  i then have a simple template which creates this class as a cfobject.  on my local machine (iis), the file is created in C:\WINNT\system32.  ???  

why?  where is this configured?  on our testing server, i am unable to find the log file and my java class is unable (i believe) to find its .properties file.
0
 
peteodonnellAuthor Commented:
out of curiousity, i wrote a small java class which creates a file and writes a line to it.  i then have a simple template which creates this class as a cfobject.  on my local machine (iis), the file is created in C:\WINNT\system32.  ???  

why?  where is this configured?  on our testing server, i am unable to find the log file and my java class is unable (i believe) to find its .properties file.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
cheekycjCommented:
When writing log files (esp in NT environment) you should use absolute paths.

I am not sure why it is being written to the system32 dir.

As far as the properties file is, you should again provide the full path to where it is located when you are reading from it.

To make maintenance easier, I would store the log file location in the Properties file too.

Are you using your own logging code or using a logging API like log4j?

CJ
0
 
peteodonnellAuthor Commented:
...just my own logging class.  it's very simple, uses a printwriter to write to the same .log file and for now just writes to the current directory (whereever that is)
0
 
cheekycjCommented:
IMHO, I think using absolute paths will be better than trying to figure out the configuration issue.  Absolute paths are usually recommended for files anyways.

CJ
0
 
mrichmonCommented:
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation in the Cleanup topic area:

Accept cheekycj

Please leave any comments here within the next four days.

mrichmon
EE Cleanup Volunteer
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now