Solved

java execution path

Posted on 2002-04-16
8
725 Views
Last Modified: 2013-12-24
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
Comment
Question by:peteodonnell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6945397
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
 
LVL 2

Author Comment

by:peteodonnell
ID: 6945493
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
 
LVL 2

Author Comment

by:peteodonnell
ID: 6945504
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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 19

Accepted Solution

by:
cheekycj earned 100 total points
ID: 6945505
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
 
LVL 2

Author Comment

by:peteodonnell
ID: 6945736
...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
 
LVL 19

Expert Comment

by:cheekycj
ID: 6948550
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
 
LVL 35

Expert Comment

by:mrichmon
ID: 10784715
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
What You Need to Know when Searching for a Webhost Provider
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question