Where to put the properties file

I am a new user of NetBeans6.0, I am making a simple application for user registration. I have coded everything but when I run project I get error caused by the dao.properties file load problem.
I have put the dao.properties file inside the classes directory(where all java class files are build after running the project) of my web application directory( I didn't create this directory though, it is automatically created by IDE), I think there is a problem with its path.
where should I put the dao.properties file so that when I run the project the Tomcat automatically find it and also, what the settings I should do?
actually, I have referred to BalusC'd  DAO tutorial: the data layer but that comes in use when we are working off the IDEs, In my case since I am using Netbeans so it may be different from that one.
if someone already done that then please let me know

ok, but will it work if I upload the project in a remote host?
lets talk besides IDE, as in your DAO tutorial you have instructed to put the properties file somewhere in root of the classpaths. ok, it will work on a local computer cause there is classpath setting but since remote host doesn't know about that property file and we cant set classpath at remote host(I am not sure though if we can) then how will it work at remote host.
how the server at remote host comes to know about that property file?
In my case since I have made the project using IDE and everything regarding classpaths have been set automatically(IDE done itself), but at remote host these sort of settings are not done then how the project will run?
if I have described my problem incorrectly then please consider it as it is supposed to be.

Similar Messages

  • Where to put the .txt file in order to read it

    think ur prog can read the data.. but it said
    java:9: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
    FileInputStream sStream = new FileInputStream("data.txt");
    so where to paste the .txt file if i want to read it
    same folder with my .java file?

    u must put the .txt file in order to read it as an
    argument to java command at runtime this code may help
    u out
    import java.io.*;
    class Demofin     
    {public static void main(String[] args) throws
    IOException
         int i;
         FileInputStream fin;
              try
                   fin=new FileInputStream(args[0]);
              catch (FileNotFoundException e)
              {System.out.println(" file not found");
              return;
              catch (ArrayIndexOutOfBoundsException e)
                   System.out.println("usage demofin filename.txt");
                   return;
              do
              {i=fin.read();
              if(i!=-1)System.out.print((char) i);
              while (i!=-1);
                   fin.close();
    }Use tags..

  • Where to put the dll file

    hi everyone
    i have a dll file and i want to use it through a java file
    so i wrote a native method and load the directory when the dll is found
    but
    how to set up the library path in my in my environment

    i found the answer i don't have to set up any
    environment variable just put the dll file near the
    java file

  • Where to put the class file

    i am using tomcat 4.1.27 server and i created a UserData.java file as a bean; i have placed the class file in the WEB-INF/classes folder. still i get the following error:
    ==============================================================
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 21 in the jsp file: /ics334/Javanese/name7.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\ics334\Javanese\name7_jsp.java:60: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.name7_jsp
    UserData user = null;
    ^
    An error occurred at line: 21 in the jsp file: /ics334/Javanese/name7.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\ics334\Javanese\name7_jsp.java:62: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.name7_jsp
    user = (UserData) pageContext.getAttribute("user", PageContext.SESSION_SCOPE);
    ^
    An error occurred at line: 21 in the jsp file: /ics334/Javanese/name7.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\ics334\Javanese\name7_jsp.java:65: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.name7_jsp
    user = (UserData) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "UserData");
    ^
    3 errors
    Apache Tomcat/4.1.27
    ===============================================================
    the structure of the jsp file is as
    <%@ page contentType="text/html" %>
    <%@ page import="java.sql.*,java.util.*" %>
    <%@ page import ="javax.servlet.*"%>
    <%@ page import ="javax.servlet.http.*"%>
    <html dir="rtl">
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    </head>
    <body>
    <p dir="ltr">
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <font size="5">Your Name is :<%= user.getUsername() %> <BR></font>
    </p>
    </body>
    </html>
    can anyone help plz?

    I am also facing the same problem. Try placing ur
    class files in tomcat's /common/classes folder.
    Sometimes it works. How ever it did not work in my
    case. Hope it works in your!!This ain't a right way of doing it... when creating a web-app, the files should be contained in it.
    The problem is can be resolved by packaging the class in say beans. Then place that class in WEB_INF/classes/beans.
    Cheers!
    ***Annie***

  • Where should I put the configuration file?

    Hi
    I'm developping a web application using IBM's websphere as my application server. My application reads configuration information from a properties file.
    My question is: what's the right location to put the configuration file? Should I provide a fixed path, or should I just put in the webserver's execute directory?
    Thanks in advance
    Pedro

    I'd consider what the configuration file is cheifly
    tied to.
    If there are only a small number of parameters then
    put them into the web.xml as initial parameters and
    access then via servlet cotext.
    If they are tied to some class, then I'd put the
    properties file next to the relevant class file and
    use getClass().getResourceAsStream().
    If they relate to the web-app as a whole, I'd put
    them in the WEB-INF directory and access then using
    getServletContext().getResourceAsStream("WEB-INF/xxx.p
    roperties");The one thing you definitely shouldn't do is use an
    absolute file path.Thanks for the reply.
    Forgive my ignorance, but how can I access getServletContext from my web application?
    Thanks again!

  • Where to kept the txt file........

    hello friends
    i am using netBeans 4.0 for developing a demo
    application. Here is the directory structure created
    by netBeans for my project.
    Inventory (main folder)
    -------build (sub folder)     
    -------dist
    -------nbproject
    -------src
    -----------------Inventory (in the src folder      
              |
    Under Inventory folder (just above one), I am storing
    (rather netBeans) all my .java files.
    Now coming to the question, I am using a text file as a
    property file for the Project. I kept it with all other .java
    files but the following code of line is not reading from
    the line (this also happened with the images kept in
    "images" folder in the same Inventory folder)
         f = new FileReader("lookNfeel.txt");Please tell me where should I kept this file (and images
    folder too)
    have a nice day
    thnks in advance
    anandScreen

    hi there
    if full path of txt file given, then it works
    same with images under images folder
    ............If you're not going to be redeploying your app on different computers, possibly in different locations, then that's fine.
    A more general solution is to put the properties file on the classpath, and then use Class.getResource or getResourceAsStream to find it.
    Say you have the following structure
    C:\myprojects\proj1\foo\Bar.class
    C:\myprojects\proj1\foo\Baz.class
    C:\myprojects\proj1\config\config.propertiesAnd Bar and Baz are both in package proj1.foo
    Then you might run it like this, if Bar is your main class java -cp C:\myprojects proj1.foo.Bar You classpath is c:\myprojects. The packages in that classpath are proj1.foo and proj1.config.
    In your Java code, when you want to load the props file, you'd do something like this: package proj1.foo;
    import java.io.*;
    public class Bar {
        private static void loadConfig {
            InputStream in = Bar.class.getResourceAsStream("/proj1/config/config.properties");
            Properties props = new Properties();
            props.load(in);
            // etc.
    } You could also look into java.util.ResourceBundle. Its rules are more complex though, and probably more than you need here.

  • Where to retrieve the downloaded files?

    Hi All,
    I m E61i user. I have no ideas where to find the downloaded files? I m appreciate that someone from the forum help me on this matter.

    Hi deenesh,
    I assumed you are using iPlanet Application Server.You can put jsp file in
    ..war file and deployed it.
    just go thru fortune sample it will give you the better Idea.
    please get back to me if it you have any question.
    thanks
    Deepak
    deenesh wrote:
    hi everyone,
    when installing iplanet, i am not able to figure out where to put the jsp
    files such that the iplanet can recognise it. I know this may seem a sillty
    question, but i need the answer urgent.
    thanks in advance

  • Where do I put the .jar file for the database connection?

    I am trying to connect to an Oracle 11g database. I see under the coldfusion settings summary that the java version is 1.7.0_55. So I downloaded the ojdbc7.jar file from Abode.com. Now the question is where do I put it so that coldfusion can access it?
    Of course I need to set up the database connection (which I still don't have the connection string for), but I still need to know where to put the ojdbc.jar file.
    Thanks.

    jasonwryan wrote:What does the man page say?
           The  program  has builtin defaults and temperature thresholds but users
           can   specify   their   own    settings    in    configuration    files
           /etc/default/i8kmon  and  ~/.i8kmon.   The daemon defines 4 states with
           different fan speeds ({0 0}, {1 0}, {1 1}, {2 2}) and  for  each  state
           are  defined  the temperature thresholds which cause the switching to a
           higher or lower  state.  Furthermore  each  state  can  have  different
           thresholds  for operation on ac power or battery.  For example the fol‐
           lowing configuration:
    I've put the following file in /etc/default/i8kmon:
    # Run as daemon, override with --daemon option
    set config(daemon) 0
    # Automatic fan control, override with --auto option
    set config(auto) 1
    # Report status on stdout, override with --verbose option
    set config(verbose) 1
    # Status check timeout (seconds), override with --timeout option
    set config(timeout) 1
    # Temperature thresholds: {fan_speeds low_ac high_ac low_batt high_batt}
    set config(0) {{-1 0} -1 50 -1 50
    set config(1) {{-1 1} 50 70 50 70}
    set config(3) {{-1 2} 70 128 70 128}
    But it doesn't seem to do anything. I'm running a Dell Inspiron 3521 with no dedicated GPU, so it only has one fan. I was somehow able to get i8kmon to work in Ubuntu by putting this config in /etc/i8kmon, but can't get it to work in Arch. Putting it in /etc/i8kmon and /etc/default/i8kmon doesn't do anything.

  • Where does the properties file go?

    Hi Folks!
    I'm trying to load a system properties file (myproperties.txt) using the example in java.sun.com. I just want to know where the properties file goes.
    The example is as follows:
    =========================
    import java.io.FileInputStream;
    import java.util.Properties;
    public class PropertiesTest {
    public static void main(String[] args) throws Exception {
    // set up new properties object
         // from file "myProperties.txt"
    FileInputStream propFile = new FileInputStream("myProperties.txt");
    Properties p = new Properties(System.getProperties());
    p.load(propFile);
    // set the system properties
    System.setProperties(p);
         // display new properties
    System.getProperties().list(System.out);
    =======================
    Could someone tell me where the file should physically reside (C:\..\..\).
    Also, is it possible to get the path dynamically by using getRealPath() instead of hard coding the file path in the code..
    Thanks for your assistance!
    Dranim

    The properties file goes where you want it to go. Just make sure you give it the full path.
    To make it dynamic, just make it a parameter.
    java myProg "c:\\temp\\MyProp.txt"

  • Where to put the GIF/JPG files so they show up in Forms Developer

    Hi:
    This refers to Forms 10gR2; Forms Builder running on Windows XP......
    Where do I put the GIF and JPG files referenced by the "iconic filename" property so that they show up in Forms Builder? By placing them in the jar file, I can get them to appear at runtime, but NOT in development!
    I have tried putting the files in the same directory as the FMB, as well as in C:\DevSuiteHome_10g\forms\java (where the image jar file resides).
    In each case, I have included the path in the FORMS_PATH environment variables.
    Thanks

    Hi,
    For design time, you need to use the UI_ICON and UI_ICON_EXTENSION environment variables. Set them in the registry.
    UI_ICON=location where you have the image files.
    UI_ICON_EXTENSION=Extension of your image files (ICO / GIF / JPG)
    Edit :
    Refer : http://www.oracle.com/technology/products/forms/pdf/10g/frm10gnewfeatures.pdf
    Search for UI_ICON and UI_ICON_EXTENSION
    -Arun
    Edited by: Arunkumar Ramamoorthy on Jan 26, 2010 6:26 PM

  • Where to put the Transform.xsl File

    Good evening!
    I am trying to execute a bpel:doXslTransform(xslURI,$a) and i dont know where to put the transform.xsl file for this operation.
    Can anybody tell me?
    Greetz,
    RaRu

    It needs to be in the same folder as the .bpel process - the bpel folder of your project.
    Hope this helps,
    Shanmuhanathan Thiagaraja

  • I changed my iPhone lately but i can't restore my last backup since it keeps saying "itunes could not restore backup because the password was incorrect" but I don't know where to put the password to make it happen... Any suggestions?

    Hey guys,
    I just bought a new iPhone but i can't restore my backup files beacuse it keeps saying "itunes could not restore backup because the password was incorrect" but I really don't know where to put the password to restore it. I really have some files that are meaningful for me so I really need help. Any suggestions anyone?

    Select your iDevice in the iTunes.
    Choose the Summary screen (tab) and scroll to the bottom of the screen.
    Then un-select Encrypt iPhone backup.
    iTunes will then prompt you to “Enter the password to unlock your iPhone backup”, enter the password you set originally.

  • How to read the properties file available in Server File structure in webdy

    hi all,
    I have developed one webdynpro application. In this application i need to access mdm server to continue. For getting the connection i need to pass the IP addresses.
    Can i have code  how to read the properties file which is residing in the server file. with out included along with the application. keeping some where in the file structure in the server. I want to read that properties file by  maintain the iP addresses and users in  properties file based on the key i want to read like below.
    servername="abcServer"
    username="john"
    password="test123"
    Please send me the code how to read this properties file from the file structure and how to read this values by key  in webdynpro application
    Regards
    Vijay

    Hi Vijay,
    You can try this piece of code too:
    Properties props = new Properties();
    //try retrieve data from file
    //catch exception in case properties file does not exist
    try {
             props.load(new FileInputStream("c:\property\Test.properties")); //File location
             String serverName = props.getProperty("servername"); //Similarly, you can access the other properties
             if(serverName==null)
               //....do appropriate handling
         }     catch(IOException e)
                   e.printStackTrace();
    Regards,
    Alka.

  • Where to store mysap.properties file?

    Hello,
    I'm trying to test application Test User Management under SAP J2EE engine of SRM UM. When I run page:
    http://mysite:54000/logon/TestUM
    there is an message:
    Test is disabled, please specify UM_TESTUM=true
    I assume that this "UM_TESTUM=true" setting should be put in mysap.properties file. My question is where to store mysap.properties file?
    Somewhere here?
    c:\usr\sap\SRM2_UM\j2ee\j2ee_40\cluster\server\services\servlet_jsp\work\jspTemp\logon\
    Thanks
    m./

    Path for tat file is:
    c:\sapmarkets\properties\mySAP.properties
    BR
    m./

  • Where can i find .properties file for jco connection?

    For jco connection to SAP, we need .properties file. Is this file already contained in Exchange Profile or somewhere??
    If yes, where can i find .properties file for jco connection or what is the path to this file?
    OR, do we have to create manually??
    Any help is appreciated.
    Thanks.
    Karma

    Hi Karma,
    Please take a look at these..
    Where to set up the JCO connection?
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/42e13d82fcfb34e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_webas620/helpdata/en/bc/42e13d82fcfb34e10000000a114084/content.htm
    cheers,
    Prashanth

Maybe you are looking for

  • [Solved] Screen goes black when I run "xrandr" with displayport connec

    I am running Arch on a Dell Latitude E6500 with Xorg, nouveau, and Gnome 3. The graphics chipset is identified by lspci as "01:00.0 VGA compatible controller: NVIDIA Corporation G98M [Quadro NVS 160M] (rev a1)".  So far, everything has gone swimmingl

  • WDS Set up - Help Needed! Airport Extreme with one Relay and one remote

    Hi Guys, I need a bit of help. I am feeling quite stupid and frustrated. I am having some difficulty with setting up a WDS network with: Base station: Airport extreme (current version) Relay: Airport Express (current version) Remote: Airport Express

  • Itune video is not smooth on my computer.

    How can I improve video playback on my itunes? For some reason, when im watching videos, it skips frames and jerks. Do I need to install something?

  • Lost disk space after Avast anti-virus scan

    I used the free Avast anti-virus software to scan my MacBook Air running Mavericks and after the scan about 30 GB of disk space seems to have vanished according to software like Freespace but not according to the Finder's "Get Info" function.  Where

  • Video podcasts vs. Audio

    I've noticed that when a video podcast finishes, I'm dumped to the podcast listing that I played it from. When an audio podcast finishes, I'm dumped to the top menu. Why?