Solved

java execution path

Posted on 2002-04-16
8
726 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
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

726 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