Can't find properties file

Hi, guys. I've been working all day trying to get my little app to find a properties file that I have. It's in both my source directory, and in the classes directory. I try to get it like:
InputStream in = ClassLoader.getSystemResourceAsStream("user.properties");Since that file is where the .class file is, what am I missing when my code can't find that property file?
Thanks!
Jonathan

Is this a desktop or a Web app?
Web apps use a hierarchy of class loaders.
Try this and see if it works better:
            ClassLoader classLoader           = Class.forName(CLASS_NAME).getClassLoader();
            URL propertiesURL                       = classLoader.getResource(propertiesFileName);
            InputStream propertiesStream    = propertiesURL.openStream();
            Properties properties                     = new Properties();
            properties.load(propertiesStream);
            propertiesStream.close();Make sure the path to the .properties file is in your CLASSPATH, of course. AND import java.net.URL.

Similar Messages

  • 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

  • Tomcat can't find existing file

    Hello,
    unfortunately i keep getting the following error:
    Servlet /tomcat-docs threw load() exception
    javax.servlet.ServletException: Service not available (propertyFile not loadable:Can't find properties file /usr/share/tomcat4/webapps/tomcat-docs/../webapps/ROOT/conex/WEB-INF/properties/cp.xmlWhat annoys me about it is that the file cp.xml exists in the very directory. Any ideas how something like this can happen?

    The best way to do it is to use the methods of ServletContext.
    ServletContext.getRealPath("WEB-INF/properties/cp.xml")
    This method turns a website relative url into a real file location on the disk. It makes your web app independant of where it is deployed.
    The other useful method is ServletContext.getResourceAsStream("/pathtoresource") which returns an input stream to the resource. This call will succeed even if the application is in a WAR file, where the path returned by getRealPath() may not be as easily accessible.
    ServletContext application = getServletConfig().getServletContext();
    String filename = application.getRealPath("WEB-INF/properties/cp.xml")
    File inFile = new File (filename);Cheers,
    evnafets

  • I upgraded to Firefox 8. Now my home page says this: "Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox/omni.jar!/browserconfig.properties.

    This is what it says on my screen when I open Firefox:
    Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox/omni.jar!/browserconfig.properties.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • WLAN driver fails to install on G580 Windows 7 x64 with error "BCM4313: Can not find setup file"

    Summary:
    I have installed Windows 7 Ultimate x64 on my G580.  Everything is working fine except the WLAN driver fails to install with the error "BCM4313: Can not find setup file".
    Details:
    I bought lenovo G580 with Windows 8.  Since my parents are not comfortable with the learning curve of Win 8, I successfully downgraded to Windows 7 Ultimate x64.  Everything is working fine but my WLAN card is not recognized because of lack of driver.
    The lenovo parts look-up page says I have broadcom WLAN card - CBT BCM4313 MOW HMC WLAN
    I looked at lenovo driver downloads site and tried following driver files for Windows 7 and both of them failed to install with the following error.  I tried installing other WLAN drivers also but they won't even install as required hardward is not there.
    Error -  "BCM4313: Can not find setup file"
    Drivers Tried:
    - http://support.lenovo.com/en_US/downloads/detail.p​age?DocID=DS028105
    - http://support.lenovo.com/en_US/downloads/detail.p​age?DocID=DS028208
    Any help about how to get past this error will be appreciated.  The previous Widnows verison (Windows 8) is still on my hard-drive as windows.old folder.  Let me know if I can copy a specific file from there.
    Thank you.
    BJS
    Solved!
    Go to Solution.

    Download this driver bcm4313
    Start setup and extract the files.After that go to star menu/control panel/system/device manager.There you probably find out that network adapter driver is missing.Choose it and click with right mb for drop menu to show up.Select properties then Driver/Update Drivers...Select to load driver from computer hard drive and choose the path where extract files is.Default path is main partion C: and search for directory named Driver.
    And yes...you get "Can not find setup file" error but dont worry.Files needed to instal driver are extract fine.

  • Where can I find the file where the static mapping allocations of the DHCP server are stored?

    In our company we are using DHCP to assign static ip addresses to our clients.
    Now we are forced to change the ip address range. To prevent changing each allocation
    of mac-address to ip-address manually with the admin tool i would like to change the allocation
    in the file where the allocations are saved. The reason ist that i just have to use copy & paste for all
    the allocations.
    So how is the file named and where can I find the file where
    the static mapping allocations of the DHCP server are stored? Is it just an ASCII file?
    Must i note anything when i change the file manually?

    From man bootpd:
    BOOTP/DHCP STATIC BINDINGS
         Static IP address to ethernet address bindings are stored in the /etc/bootptab file and in Open Directory.  Bindings specified in the /etc/bootptab file take precedence over those in Open Directory.
         See bootptab(5) for more information about the /etc/bootptab file.
         For Open Directory, bootpd looks at the /Computers records for the following properties:
    /etc/bootptab is a standard text file, while the records in Open Directory can be manipulated either through the command line, or via Workgroup Manager.

  • Can't install AR 11.0.04, "Can't find specified file."

    Presently using Adobe Reader X 10.1.6 on Windows 7 64-bit and get an error messge when trying to install Adobe Reader 11.0.04: "Can't find specified file."  However, that file is not identified.  Help me to install the updated AR.

    Thank you for your hekp as I finally have been able to dl 11.0.04.  The dl was successful because following your suggestions I initially kept getting the same kind of error messages saying that I had to log on as an administrtor.  Well, permissions with Windows was never my strong spot.  Never really understood how to handle them.  However, as it was early in the morning and my mind was somewhat clear, I started fiddling around with "Taking Ownership" and Security within properties.  First, after Taking Ownership of just about anything having to do with Adobe, I still was getting error messages about logging on as an Administrator...but, I am the Administrator???  So, I then took a closer look at Properties>Security and saw that although Administrator was there, none of the control boxe were x'd out.  Taking a bold move, for me at least, I then did an editing and x'd in the control boxes for Administrator.  Smooth sailing from then on in as everything loaded as it should have.  I think I have finally learned how to "Log in as Administrator."  Nonetheless, if there is anything you can add to this saga, please do.

  • Help:Can not find the file in jar!

    Hello everyone:
    I build a project using Netbeans 5.0 and make a jar file with it...
    The code in the project as follows will throw an exception described that it can not find the file named datasource-config.xml
    String dataFilePath = getClass().getResource(dataFile).getPath();
    //System.out.println("filepath:"+dataFilePath);
    InputStream input = new FileInputStream(dataFilePath);
    when I run the project with the main() function as an entry it works perfectly and output:
    filepath:/C:/projects/java_project/search/build/classes/com/cn/wxjt/lucene/config/datasource-config.xml
    But when I compressed the project with jar and run it , it will show:
    filepath:file:/C:/projects/java_project/search/dist/search.jar!/com/cn/wxjt/lucene/config/datasource-config.xml
    there is a (!) between search.jar and /com/cn/wxjt...
    I dont know why I generate a ! symbol in the file path... Is it cause the exception->
    java.io.FileNotFoundException: file:\C:\projects\java_project\search\dist\search.jar!\com\cn\wxjt\lucene\config\datasource-config.xml
    If you have any idea, plz tell me.
    Thank you and best wishes to you !
    :)

    If the file you want to read is in your jar file, use
    getClass ().getResourceAsStream
    (relative_path_file_name)Hope that help,
    Jackhey jack i want to open the file as new File
    i m using this.getClass().getResource("resource/backend.xml");
    the resource is the directory inside the jar file.
    when i prints the url it shows:
    the jar file is in the WORK directory
    URL : jar:file:/home/neeraj/WORK/show.jar!/resource/backend.xml
    now when i creates new File using the url.getFile() method the file does not exist.
    although the same programs runs well when i uses the InputStream
    so plz tell me cant I create a new File from the above method????
    thanks in advance
    with regards
    neeraj

  • Move all my music to another folder but Itunes can't find the files!

    I have all my music on my desktop in small folders for each artist.
    But now i don't have room anymore, because i have to much music.
    So i want to move it all in to a folder called "Music". But when i do that
    Itunes can't find the files, and i have to search for each file, to find the new location instead of the desktop. How do i move my music more easily? So i don't have to synchronize it all in again, with the right album covers and that..
    Please, need some help here!

    You need to open your preferences file in iTunes and click on advance then select the location of where you put the folder.  http://support.apple.com/kb/HT4527

  • I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    I have problem with Itunes losing where podcasts and some purchased music is located. Don't know how Itunes losing the locations of the files and I can't find the files on my hard drive. What can I do to stop Itunes losing location and restore my files?

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • I cant access firefox, everytime i try i get that windows can't find the file, i tried redownloading it but it still gave me the same message?

    i cant access firefox, everytime i try i get that windows can't find the file, i tried downloading it again but it still gave me the same message. the problem has nothign to do with my internet because it wonks on internet explorer and everythign is fine, my computer just can't access firefox for some reason. i tried uninstallign ti adn then installing it again, but that didnt work, i tried installing a different version and it still didnt work.
    okay the exact message is" Windows cannot find 'C:\Program Files\Mozilla Forefox 4.0 Beta 1\firefox.exe'. make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.
    Nothing happens after i install is the "Launch Firefox now" checkbox set, the same message comes up.
    i usually start firefox from the shortcut i have on my desktop but when this happened i thought that the shortcut is the problem, but i went to the Mozilla firefox folder and tried it from there, but it didnt work. i also tried downloading different versions of firefox but that didnt work either.

    can you tell me the solution to "windows cant find firefox" error. thanks.

  • Had to uninstall Firefox, now I can't reinstall. Get error message "Can not find archive file." Please help!

    I believe I had some kind of virus attack. I got everything cleaned up. (I HOPE) In the process of cleaning the virus, I unintalled Firefox because it wouldn't open. Kept getting the error message that Firefox was already open and I had to close out of the sessions or restart the computer. After restarting the computer several times and not being able to find any open sessions in task manager, I uninstalled. When trying to reinstall, I get the error message "can not find archive file." I've tried downloading Firefox from cnet as well as the Mozilla site to no avail. Please help. I'm getting tired of using Chrome already!

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

  • Firefox can't find the file at (a location is specified) when either "Navigate previous" (and next) buttons are pressed in an HTML5 skin (but OK in IE/Chrome).

    I create HTML5 help projects from a package called MadCap Flare. It uses what they call an HTML5 'skin' that sets the style/layout of the page and also includes 'Navigate previous' and 'Navigate next' buttons. When viewing the help and pressing these navigate buttons in IE8 or Chrome 32 there is no problem, but in Firefox 27 I get the following: (typical error for pressing a button on any page)
    "File not found"
    "Firefox can't find the file at /C:/SVN/FlareEnglishOnLineHelp/Output/HTML5_Help_Modeller_Reference/4attrib/idh_jointinterface_element_meshes.htm?TocPath=Modeller Reference Manual|Chapter 5 : Model Attributes|Meshing|_____2."
    " Check the file name for capitalisation or other typing errors."
    " Check to see if the file was moved, renamed or deleted."
    - Because the files and buttons work in other browsers I'm wondering just what is going on here with Firefox>>>>

    I should correct that last entry and state that the | charactacters are generated automatically in the Toc-Path for each 'book' name in the online help, and are not something manually created, whereas the : characters have come from the TOC book topic names (which were manually entered names and are what we would ideally require). But, because 'previous' and 'next' topics within nested TOC books without colon (:) characters CAN be browsed successfully when just | characters are present in the Toc-Path, the limitation would appear to be solely due to the : characters.

  • My home page is google and it works but when I open a new tab it displays an error message :Firefox can't find the file at chrome://quick_start/content/index.ht

    I've made sure a dozen times that my home page is set correctly, and when I hit the home button next to the search bar it works and takes me right to google BUT whenever i open a new tab i get the error that my page cannot load and the web url that it keeps trying to remember is in the error message:
    Firefox can't find the file at chrome://quick_start/content/index.html.
    of course the last dot is not the url anymore but the end of the sentence for the error message, but i don't ever use chrome ever on my laptop only my cell so what is going on????? help fix god please!!!!!!

    Do you have the FastStart extension?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file loca

    My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file location to run the update in all of my iTunes files as well as when I've tried reinstalling it.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

Maybe you are looking for

  • Please help, Powerbook issues!

    Sorry if this is long. Hello everyone. I am having quite the time with my Powerbook. Here is a little background information. I purchased it in August of 2004 and I have Apple Care, so everything is under warranty. For the most part my laptop has bee

  • Salesforce and report parameters

    When I create a report using the Crystal Reports client I can set a parameter to use for the report, but when I upload the report to Salesforce I am stuck with whatever the last value I used in the client.  How can I prompt the user for a value from

  • Unable to open pdf with vers 9.0

    I have some pdfs that we are not able to open with Adobe Reader vers 9. The only previous version that I have been able to test them in was 6 and they open fine there. I believe that they are opening ok in other versions because we have some customer

  • HR_INFOTYPE_OPERATION - Need help w/Deleting infotype records

    Hello all, We have an issue where infotype records got created where the ENDDA is less than the BEGDA (ENDDA = 06/30/2006 and BEGDA = 07/01/2006).  We are trying to delete these using HR_INFOTYPE_OPERATION but we are getting message PG-009 (No data s

  • About local object

    Hi,   I don't know if here is the place correct to ask this but maybe someone can help me. Where can I see the local objects?? Because I save a program in local object but I need it to change the package but I can't.   Well I hope someone can help me