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

Similar Messages

  • TS4036 Can't find existed files at numbers and pages apps

    Hello! I wake up today, and i can't find any file at my iPadmini at numbers and pages apps. But yesterday they were existed. Please back my files .Best regards Dmitry Kartashov..

    Try looking for your files with Spotlight Search
    1. From any Home screen page of iPad, drag your finger down anywhere on the center of Home screen.
    2. Spotlight search will now appear and you can search for apps, texts, or any other content you'd like just as you did on previous versions of iOS.

  • ITunes can't find existing files after upgrading HDD

    What the subject says - I have a 2008 Mac Pro & iTunes 10.6.3. I just upgraded the HDD where iTunes lives, by copying the entire drive to the new one, then installing the new one in the same bay as the old one. Whenever I open iTunes, a few of my +/- 6K tracks show the (?). This happens to different tracks each time I open iTunes.
    It's a pita to re-locate these every time I access iTunes. Is there any way to correct this problem without trashing all my playlists, album art, ratings, etc?
    Pls help! It's taken a long time to build this library and I'd rather not have to start all over. I still need to edit then add about 40 LP vinyl albums to the library, and I don't want to continue adding them until this problem is solved.

    Sorry. Found the answer myself. DUH! I needed to tell iTunes preferences that the iTunes folder was on the NEW HDD rather than the old one.

  • Have been using successfully Acrobat 8 Standard, version 8.3.1 for years.  Suddenly can not digitally sign anything because software can not find "existing digital ID file?

    Have been using successfully Acrobat 8 Standard, version 8.3.1 for years.  Suddenly can not digitally sign anything because software can not find "existing digital ID file?

    Are you still using Acrobat 8? If not read further.
    All Acrobat versions prior to 11.0.07 had a security flaw that they allows signing with certificates that had "Extended Key Usage" (EKU) restricted to certain certificate uses and those did not include document signing. Most frequently those were certificates with "Client Auth" or "Server Auth" in EKU. Acrobat/Reader 11.0.07 fixed this problem, which also means that while previous versions accepted such certificates for signing 11.0.07 and later do not.

  • TOMCAT CAN�T FIND BEAN CLASSE

    Hello, i am from Argentina. i need URGENT help with tomcat, because i am developing my final thesis.
    I have all my sources in
    C:\jakarta-tomcat-5.0.16\webapps\tesis
    C:\jakarta-tomcat-5.0.16\webapps\tesis\ (archivos jsp)
    C:\jakarta-tomcat-5.0.16\webapps\tesis\lib
    C:\jakarta-tomcat-5.0.16\webapps\tesis\web-inf\classes\edu\tesis\beans
    C:\jakarta-tomcat-5.0.16\webapps\tesis\web-inf\classes\edu\tesis\queries
    C:\jakarta-tomcat-5.0.16\webapps\tesis\web-inf\classes\fede\servlets
    my problem is that when i execute the login.jsp through the browser in this way
    http://localhost:8080/tesis/login.jsp
    tomcat can�t find the edu.tesis.beans package
    In compiled jsp class i can see this
    package org.apache.jsp;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import edu.tesis.beans.*;
    so, the problem is that tomcat set package org.apache.jsp; to my jsp, so it can�t find edu.tesis.beans package.
    This is my context path that is in $CATALINA_HOME/conf/server.xml file
    <Context path="/tesis" docBase="C:\tomcat\webapps\tesis"
    debug="9"
    reloadable="true"
    crossContext="true"/>
    This is an extraction of my jsp file
    <html>
    <head>
    <%@page import="edu.tesis.beans.*"%>
    </head>
    <body>
    <jsp:useBean id="universidad" class="edu.tesis.beans.Universidad" scope="request" />
    <form action="servlets/fede.servlets.ServletMaxwell" method="post"><BR><BR><BR><BR>
    PLEASE, I NEED AN URGENT HELP!!!!
    THANKS,
    FEDERICO

    Tampoco te preocupes porque Tomcat cambie el paquete de las p�ginas jsp. Eso es un comportamiento normal. Adem�s nota que el paquete de tu tesis es importado en la clase generada a partir del jsp, o sea que deberia encontrarla si est� en el lugar correcto.
    Otra cosa que veo extra�a en tu estructura de directorios es que existe un directorio "lib" por fuera de WEB-INF. Si este contiene beans en forma de paquetes jar, deberia estar dentro de WEB-INF

  • 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

  • Can't find audio file

    Hello-
    Using Logic 8 here on OS 10.5.8. I'm working on one project on two computers (at work during the day, and at home, during the night). While working I'm adding audio files to the project (audio files are being copied into the audi file folder for the project). However, when I move the project (with the entire folder, I mean copy the entire project folder including audiofiles to the other computer), when I open the project up on the new computer, I always get an error message saying that it can't find the new audio I had added while working on the other computer. The problem is, it changes the name of the files it wants... what happens is while working on computer 1 I add a file called "car" to the arrange and the file car is in the audio folder. Everything seems fine. However when I open the project up on the new computer (having copied the new "car" file as well) when it opens it says that it can't find the file called "car#F2EAE"... a file which I cannot find existing ANYWHERE on either computer (computer 1 or 2)... when I try to manually link the file "car" to "car#F2EAE" I get different results, usually something is changed, or I get an "invalid region" error and the audio file wont link. Does anybody have any idea what this is? I mean if I did something like timestrech the "car" file and it would create a new file then I could understand that, but still I copy ALL of the files that Logic is creating... it doesn't seem to be throwing any files anywhere else... I really don't understand. Any ideas why this is? The only big difference I can see is that the work computer is power PC imac and my home is an Intel Mac Pro... but still they run the same versions of the OS and Logic.

    You have fallen victim to the atavism of Logic: it cannot handle filenames longer than 31 characters, it will rename those files in the style of your example. I bet the file was named carspeedingdownemptyhighwayandbraking.wav or something like that...
    Sadly, the only way to avoid it is to keep filenames shorter than 31 characters.
    There have been quite a lot of rants about this. And rightly so. It is a major omission that this restriction from the days of 40MB harddisks is still there.
    regards, Erik.

  • 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

  • I just got a new MacBook Pro, and I tried to bring across my files from my last mac using time machine. After it was done copying I can't find my files anywhere but the space (about 130gb) has been used on my hard drive. Help please!!

    I just got a new MacBook Pro, and I tried to bring across my files from my last mac using time machine. After it was done copying I can't find my files anywhere but the space (about 130gb) has been used on my hard drive. Does anyone know how I can get to them? I did change my user name from 'user' while it was copying, could this have something to do with it?

    You don't want to do that by copying.
    Your best bet, by far, is to use Setup Assistant.  If your Mac is running Snow Leopard, see Using Setup Assistant on Snow Leopard or Leopard.
    If it came with Lion, it's a bit different: Using Setup Assistant on Lion

Maybe you are looking for

  • Tab pages in oracle forms

    hi , I have two different Content Canvases in oracle form 6i and my requirement is such that i need to have these two content canvases in tab canvas pages. can Any one please tell me how i have to join these two content canvases in two tab pages. sin

  • Trade in scenario during PO

    Dear Gurus, Please help me on the below situation. User wants to have a scenario of trade in an old material to procure a new material. Example: Item A - old ($200 - current price). Item B - new ($5000 - current price). When doing PO, user wants to b

  • Omniportler HTML Layout - How do I pass a parameter to another page?

    How do I pass a parameter to another page from an HTML Layout like I can with the Tabular layout?

  • Live alpha channel VP6

    I need to send a live streaming to Adobe Flash Media Server  encoded with on2 VP6  8 bit alpha cannel (chroma key) so all clients see only the speaker with no background. what hardware or software support realtime encode VP6 alpha channel  ? thanks

  • Export and Import functionality in WebDynpro ALV

    Hi Experts,            I have done a webdynpro alv application and it is displaying the data as i wanted. However i have a requirement to get the alv displayed data in an excel sheet( which works with the export button on alv) and update that excel s