What is the current directory when running Tomcat

Hi,
In one of my classes I try to open a file for reading. I did this with:
FileReader fr = new FileReader("files/httpd.conf");
When I try to run the project, it can't find the file. I tried every possible place in my webapps directory and when I insert some code to take a look at his current path, i get an index which really isn't in webapps.
Can somebody please tell me where to put my files when i try to open them using files/httpd.conf
Much thanks,
Hugo Hendriks

I'm still getting a servlet error because he can't find the file. My directory structure is like:
webapps/act/ = all my html and jsp files
webapps/act/files = all my data files
webapps/act/WEB-INF/classes/apacheconfigurator = all my class files
my call in the class looks like this:
//Declareren van de input file
FileReader fr = new FileReader("../webapps/act/files/httpd.conf");
BufferedReader br = new BufferedReader(fr);
//Declareren van de temp output file
FileWriter fw = new FileWriter("../webapps/act/files/httpd.temp");
PrintWriter pw = new PrintWriter(fw);

Similar Messages

  • What is Weblogic current directory?

    I have multiple clusters and servers created on a Weblogic instance.
    What is the current directory, e.g. if I read/write a file from servlet without specify the directory? ldealy, the directory is neutral to clusters/servers.
    Thanks

    Hi,
    Please place your Properties file *(Or Whatever file you want to read...)* inside the *<DOMAIN_ROOT>* Directory for Example Location: "user_projects/domains/mydomain" directory
    After Placing any Property file inside the "domain root" directory can be read without restarting the Server...
    below is a simple example for the same.......
    *"a.properties"*
    city=NewYour
    country=America
    *"index.jsp"*
    <%@ page import="java.util.*" %>
    <html>
    <head>
    <title>Hi It's Wroking</title>
    </head>
    <body bgcolor="maroon" text="white">
    <center>
    <%
    InputStream is=new FileInputStream("./a.properties"); // No need to specify the File Path now
    Properties prop=new Properties();
    prop.load(is);
    out.println("City: "+prop.getProperty("city"));
    out.println("Country: "+prop.getProperty("country"));
    %>
    </center>
    </body>
    </html>
    Like this you need not to redeploy your Application...If you want to make any changes in the property file ...Just eidt it...and the Properties files changes will be dynamically picked up by the application,
    Thanks
    Jay SenSharma
    http://weblogic-wonders.com (Wonders Are Here)

  • How to now the Current Directory

    Hi everyone, i have a little problem, i dont'n know how to get the name of the current directory where i have the .jar file of my applet, and i need to know which is this directory to do something on it.
    How could i know the current directory?...
    Thanks.

    Hi.
    You can not get the current directory: applets can not access the hard drive. Instead you can get the code location, which will given the current directory if running locally.
    Try this: within the applet do : getCodeBase(). This will give you an URL to the code of the Applet, that is the JAR file.
    Hope this helps,
    Nuno

  • Running a java program in a directory other than the current directory

    How do I run a java program that's located in a directory other than the current directory?
    There is a file Test.java in /dir1/subdir1. If my current directory is anywhere other than that directory, say /dir2/subdir2, I can compile Test.java by using:
    javac -classpath /dir1/subdir1 /dir1/subdir1/Test.java
    But when I try to run it with:
    java -classpath /dir1/subdir1 /dir1/subdir1/Test
    I get a java.lang.NoClassDefFoundError: \dir1\subdir1\Test
    Any thoughts?

    You need to specify just the name of the class you want to run. So java -classpath /dir1/subdir1 Test

  • What is the best practice for running a long report/query against an active database?

    We are using SQL Server 2012 EE but currently do not have the option to run queries on a R/O mirror though that is my long term goal. I am concerned I may still run into the below issue in that scenario as well since the mirror would also be updating data I
    am querying.
    I have a view that joins across several tables from two databases and is used by an invoicing program on existing data. Three of these tables are also actively updated by ongoing transactions. Running a report that used this view did not use to be a problem
    but now our database is getting larger and we have run into some timeout problems for the live transactions coming in.
    First the report query was timing out so I set command timeout to 0 and reran the query which pegged all 4 CPUs 100% for 90 minutes and so I finally killed it. Strangely there were no problems with active transactions during that time so I'm wondering if the
    query was really running doing anything useful or somehow spinning and waiting. I reviewed the view and found a field I was joining on that was not indexed so created an index on that field, reran the report, which then finished in three minutes and all the
    CPUs were busy but not at all pegged out. Same data queried both times. I figured problem solved. Of course later, my boss ran a similar invoice report, with the same amount of data, and our live transactions started timing out 100% while his query was running.
    I did not get a chance to see the CPU usage during that time.
    I looked at the execution plan of the underlying view and added the suggested index but that did not help. When I run the just the view at SQL Server it does not seem to cause any problems and finished in a couple seconds. Perhaps something else going on in
    the reporting tool using the view.
    My main question is - Given I have to use the live and active database, what is the proper way to run a long R/O query/report so that active transactions can still continue to update
    tables that I am querying? sp_who2 did show transactions being blocked so I guess a long query accessing the tables blocks live transactions accessing those same tables, but certainly I'm not the only one doing this. I
    am considering adding "with (nolock)" but am hoping there is a better standard practice as that clause can return dirty data and I understand why. Thx, Dave
    Thanks, Dave
    Dave

    Hello
    You can change the DB isolation level to Read uncommitted
    http://technet.microsoft.com/en-us/library/ms378149(v=sql.110).aspx
    or use WITH (NOLOCK)
    I do use NOLOCK option for the dirty reads to avoid locks on the tables
    Javier Villegas |
    @javier_vill | http://sql-javier-villegas.blogspot.com/
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

  • Acrobat Pro "save as" function in the file menu does not show the current directory of the file

    I have installed CC but Acrobat Pro gives me headaches.
    The "save as" function in the file menu does not show the current directory of the file but something I have worked on in the past.
    It forces me to navigates through my hard disk for this very straightforward thing in normal conditions. I precise: Acrobat is the only software reacting like that.
    I use Windows7 professional 64bits.

    I use what seems to be the latest version available on the Cloud:
    To illustrate my point, I open a directory with explorer and double-click on the only PDF in there:
    So here it is, open:
    When I do a "Save as", it takes me to a totally different place on the disk!
    Very annoying...
    Thanks for your time!
    JJ

  • What's the best Mac for running Final Cut Pro X?

    Title says it all. What's the best Mac for running Final Cut Pro X? I'm not looking to make a feature length hollywood film. But I'd like to be able to edit video without lag.

    Yes. Begin with the fastest processor / graphics card / and as much RAM as you can afford. (As all three will become obsolete over time.)
    I started from scratch. I have a 27-inch iMac with a 3.4 G Intel Core i7. (currently the fastest processor for an iMac) I also ordered the best graphics card--AMD Ratheon HD. I ordered 16G of RAM, but recently added more RAM to equal 24G. (OWC makes good after-market RAM for iMACs.)
    Last, I ordered a flash drive / SATA hard drive combo.  (250G on flash / ITB on SATA). The OS and all of my applications run off the flash drive. (for fast start up!)
    I put all of my media and FCP projects onto the SATA hard drive.
    Now, I had the option to order a 2TB SATA. But, I realized I can always buy more external storage as I edit more and more projects. ALSO! FCPX is GREAT when it comes to editing projects on external drives! I can segregate an entire project and its media files onto a removeable drive. I simply launch FCPX, plug in the drive and--poof!--I'm ready to edit. It sees the project and the media right away. When I'm done editing, I can then send this drive to another editor (also using FCPX) or attach it to my MacBook if I want to edit the same project in the field.
    This has worked for me. I wish you luck.

  • How to get the Current Directory

    Hi,
    I need to tell the system to read a file in my current directory. How do I tell the system what the current Directory Path is
    Thankx in advance...

    It depends on the current working directory from which you start your JVM.
    From DOS or UNIX shell this is the directory where you have come by "cd".
    On Windows you can do the same from Explorer or other file managers: the directory where you are when starting JVM.exe.
    If you define shortcuts - e.g. on the desktop -, you specify it there as the "working directory".
    You can retrieve this directory by
    System.getProperty( "user.dir" )
    Now with File classes:
    Each file name without path will be interpreted as being in this directory.
    Absolute paths are clear.
    But you can't mix this:
    If you specify "test/debug.ini" or "test\\debug.ini" from debug directory: false!
    If you specify "../debug.ini" or "..\\debug.ini" from debug/test directory: false!
    Do it this way:
    Start from debug directory.
    So you can access file debug/test/debug.ini as
    System.getProperty( "user.dir" ) + "/test/debug.ini"
    Works?

  • Getting the below error when running the Baseline.grf for the first time

    I am getting the below error when running the Baseline.grf for the first time.
    Appreciate your support in resolving it.
    Error below:
    INFO [main] - *** CloverETL framework/transformation graph, (c) 2002-2012 Javlin a.s, released under GNU Lesser General Public License ***
    INFO [main] - Running with CloverETL library version 3.2.1 build#63 compiled 04/01/2012 12:53:21
    INFO [main] - Running on 4 CPU(s), OS Windows 7, architecture amd64, Java version 1.6.0_20, max available memory for JVM 901120 KB
    INFO [main] - Loading default properties from: defaultProperties
    INFO [main] - Graph definition file: graph/Baseline.grf
    INFO [main] - Graph revision: 1.114 Modified by: mkressirer Modified: Thu Apr 12 13:27:18 EDT 2012
    INFO [main] - Checking graph configuration...
    INFO [main] - Graph configuration is valid.
    INFO [main] - Graph initialization (Baseline)
    INFO [main] - [Clover] Initializing phase: 0
    INFO [main] - [Clover] phase: 0 initialized successfully.
    INFO [main] - register MBean with name:org.jetel.graph.runtime:type=CLOVERJMX_1306871483270_0
    INFO [WatchDog] - Starting up all nodes in phase [0]
    INFO [WatchDog] - Successfully started all nodes in phase!
    INFO [RUN_GRAPH1_0] - Running graph ./graph/InitDataStore.grf in the same instance.
    INFO [RUN_GRAPH1_0] - Checking graph configuration...
    INFO [RUN_GRAPH1_0] - Graph configuration is valid.
    INFO [RUN_GRAPH1_0] - Graph initialization (InitDataStore)
    INFO [RUN_GRAPH1_0] - [Clover] Initializing phase: 0
    WARN [RUN_GRAPH1_0] - WS messenger cleanup failed.
    java.lang.NullPointerException
         at org.apache.axis2.client.Stub.cleanup(Stub.java:134)
         at com.opensys.cloveretl.component.WebServiceClient.free(Unknown Source)
         at org.jetel.graph.Phase.free(Phase.java:487)
         at org.jetel.graph.TransformationGraph.freeResources(TransformationGraph.java:681)
         at org.jetel.graph.TransformationGraph.free(TransformationGraph.java:955)
         at org.jetel.graph.runtime.PrimitiveAuthorityProxy.executeGraph(PrimitiveAuthorityProxy.java:149)
         at org.jetel.component.RunGraph.runGraphThisInstance(RunGraph.java:511)
         at org.jetel.component.RunGraph.runSingleGraph(RunGraph.java:409)
         at org.jetel.component.RunGraph.execute(RunGraph.java:302)
         at org.jetel.graph.Node.run(Node.java:414)
         at java.lang.Thread.run(Thread.java:619)
    WARN [RUN_GRAPH1_0] - Some graphs wasn't executed (because graph "./graph/InitDataStore.grf" finished with error).
    WARN [RUN_GRAPH1_0] - Some graph(s) finished with error.
    ERROR [WatchDog] - Graph execution finished with error
    ERROR [WatchDog] - Node RUN_GRAPH1 finished with status: ERROR caused by: Graph './graph/InitDataStore.grf' failed!
    ERROR [WatchDog] - Node RUN_GRAPH1 error details:
    org.jetel.exception.JetelException: Graph './graph/InitDataStore.grf' failed!
         at org.jetel.component.RunGraph.execute(RunGraph.java:324)
         at org.jetel.graph.Node.run(Node.java:414)
         at java.lang.Thread.run(Thread.java:619)
    INFO [WatchDog] - [Clover] Post-execute phase finalization: 0
    INFO [WatchDog] - [Clover] phase: 0 post-execute finalization successfully.
    INFO [WatchDog] - Execution of phase [0] finished with error - elapsed time(sec): 2
    ERROR [WatchDog] - !!! Phase finished with error - stopping graph run !!!
    INFO [WatchDog] - -----------------------** Summary of Phases execution **---------------------
    INFO [WatchDog] - Phase# Finished Status RunTime(sec) MemoryAllocation(KB)
    INFO [WatchDog] - 0 ERROR 2 20132
    INFO [WatchDog] - ------------------------------** End of Summary **---------------------------
    WARN [exNode_0_1306871483270_RUN_GRAPH1] - Attempt to unregister non-registered thread in the ContextProvider.
    ./graph/InitDataStore.grf: Execution of graph failed! Error during graph initialization: Phase 0 can't be initilized.
    INFO [WatchDog] - WatchDog thread finished - total execution time: 2 (sec)
    INFO [main] - Freeing graph resources.
    ERROR [main] - Execution of graph failed !

    It can't find an Endeca specific class when running via the clover command line utility. Thus, the classpath being set in that shell script is not incorporating the .jar files where the endeca-specific classes are packaged. I would start by adding an line to see what your classpath is set to. There are actually already some lines of shell script in clover that you can uncomment to see what .jars are getting loaded:
    #echo $CLOVER_LIB/*
    for i in $CLOVER_LIB/*.jar $CLOVER_LIB/*.zip; do
         LOCAL_CLASSPATH="$LOCAL_CLASSPATH:$i"
    done;
    #for i in `ls $CLOVER_LIB/*.jar`; do
    #echo $i
    #done;
    You could also echo LOCAL_CLASSPATH to see what is getting set there. At the end of the day, you will need the endeca-specific jars to load which can be found here: /Endeca/Discovery/2.3.0/Integrator/plugins/com.endeca.latitude_1.0.0/*
    HTH,
    Dan
    http://branchbird.com

  • Hard drive is missing. I can boot from the cd but when running the disk utility, no hard drive shows up.

    Hard drive is missing. I can boot from the cd but when running the disk utility, no hard drive shows up.
    This is a problem that suddenly appeared.

    Please post a screenshot of Disk Utility that shows what you mean. Be careful not to include any private information.
    Start a reply to this message. Click the camera icon in the toolbar of the editing window and select the image file to upload it. You can also include text in the reply.

  • What is the current firmware for iphone 3g?

    What is the current firmware for iphone 3g?

    Dear Genes....    wjosten   /   Templeton Peck,
                             My iPhone 3G is on iOS 4.0.(8A293) and with Firmware  05.13.04. Since few days when I shifted  to New operator VODAFONE, I am troubling with "NO SERVICE" most of the time, but when I checked my SIM in another Mobile, it is working fine. So please tell me which iOS do i need to switch to and what will be my Firmware. As I own iPhone 3G, moving to iOS 4.2.1 is very slow.
    Please do suggest. Itz a lil Urgent.
    Looking Ahead to hear from you.
    Thanks in Advance....

  • What is the current best possible Qosmio I can buy?

    Hi, only just joined the forum, i run a large pc/laptop/gps reail repair outlet in es***, uk, I'm (for my sins) a microsoft ex employee and left 13 yrs ago to go it alone.
    I have become something of a Qosmio Addict, now owning 8, my latest aquisition a Brand New F-10-124 from e-bay for next to nothing.
    Just thought I'd say Hi and ask what is the current best possible Qosmio I can buy, because no 9 is coming!
    Paul
    Message was edited by: techstore

    Hi
    Well, at this time the Qosmio G30 and F30 are the newest Qosmio units at the market.
    If you want to know more details about the Toshiba notebooks and especially about the Qosmio so please check the Toshiba website:
    http://eu.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/model_index_page.jsp?service=EU&ID=96787
    http://eu.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/notebooks_desktops_servers_family_page.jsp?service =EU
    bye

  • What is the "Host Directory"

    What is the "Host Directory"?

    The above is correct for most Apache/Linux servers. When you are in Dreamweaver and setting up your site to use FTP, the host directory is /public_html/ and you are all set.
    It is the "root" of your host, the subdirectory on the server from which an Apache or IIS server is directed to draw the initial or start page of a website from, usually "index.html," "index.htm, "index.php," "index.asp," or "index.cf" Your hosting provider will be able to tell you this.

  • Mesage "A client copy run is currently active" when running SCC1

    Hello
    I get a mesage "A client copy run is currently active" when running SCC1. So I can not transport tr. req from source client.
    Last client copy was 2 years ago
    Please for help

    Check SCC3 for CC traces, you'll see what is going wrong there.
    regards
    Juan

  • What is the current Rev for the 12in?

    Just curious about the current 12inch Powerbooks. How many revisions have they had? What is the current revision?
    thanks again!!

    Hi Michael,
    The whole Rev A, B, C etc etc business thingy is something that was labelled by us users and I'm just as guilty as anyone else in using them. Apple do not label them with rev. letters.
    With regards to your question, there were 4 revisions of the 12" PowerBook:
    1. PowerBook G4 (12" 867MHz) - Introduced Jan 2003, Discontinued Sep 2003 - This we labelled as Rev A
    2. PowerBook G4 (12" DVI, 1GHz) - Introduced Sep 2003, Discontinued April 2004 -This we labelled Rev B
    3. PowerBook G4 (12" 1.33GHz) - Introduced April 2004, Discontinued Jan 2005 - This we labelled Rev C
    4. PowerBook G4 (12" 1.5GHz) - Current model, introduced Jan 2005 - This we labelled Rev D
    So the answer would be Rev D
    I supposed the next 12" model if/when introduced will be a 12" MacBook Pro and true to form we will label that as Rev. A

Maybe you are looking for

  • Line Chart From SQL in 10g

    I need to have a Line Chart from SQL in Oracle 10g Grid Control for the below Scenario I had total counts for Messages stuck in the Oracle queue table using one UDM alert and i have total counts for messages stuck more than 15 min using another UDM a

  • Switch for Distribution Layer

    I need your expert opinions for selecting a switch for distribution Layer My requirement is 24Gig ports @ dist layer which will connect to 3750?s for server farm. I don?t want to negotiate with the bandwidth. Which switch will be best for this scenar

  • PL/SQL Function Help (

    Does anyone know how to pass a table name to a function as a variable so that the function can act dynamically on that table? Here is an example of a very simple function that I can not seem to get to work. create or replace function DATE_TIME_CHECK

  • CAN MAKE IMAGE FROM ITS PART IN A LIBRARY

    AS PART OF MY PROJECT I WANT TO MAKE A IMAGE FROM SMALL PARTS BY PARTS OF IMAGE. I HAVE ATTACHED LIBRARY FILE WITH SMALL PARTS OF IMAGE AND FULL IMAGE WHICH WANT TO MAKE FROM ABOVE PARTS OF IMAGAES. IFA NY ONE CAN HELP ME ITS REALLY HELPFUL... AN ADV

  • How to use Special value set with Column clause to display addtional column

    hi can anyone tell me How to use Special value set with Column clause to display addtional column how can i use FND POPID and with COLUMN clause ?