FILENOTFOUNDEXCEPTION while reading property files in Tomcat 6------Help me

Hi All
I am planning to migrate my web application from iplanet 4.1 to tomcat 6. In this process I need to read the properties files initially.
for eg: i got the property files in a iPlanet:
Config directory---
abc.properties.---
abc.log--
In tomcat I configured them in web.xml saying that.
<servlet>
<servlet-name>ABC</servlet-name>
<servlet-class>com.ijk.abc</servlet-class>
<init-param>
<param-name>Loan</param-name>
<param-value>/WEB-INF/config</param-value>
</init-param>
<init-param>
<param-name>loan.props</param-name>
<param-value>/WEB-INF/config/abc.props</param-value>
</init-param>
<init-param>
<param-name>loan.log</param-name>
<param-value>/WEB-INF/config/abc.log</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ABC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
I need to read initially all the property files and then proceed.
While configuring in this way, it am getting error saying that
abc.props or abc.log..............(FILE NOT FOUND EXCEPTION)
Can anyone suggest me how to configure them.
Thanks in Advance.

Thanks for your response, Actually we dont have the source code for that because it is very old code, but i m using decompiler in which i can get some informtaion.
OS used for iPlanet is Unix but now I need to deploy this application in tomcat in windows server 2003.
Servlet clss:
SERVLET CLASS:
Class com.ijk.abc implements extends HttpServlet  implements PropertyKeys
private IClickManager m_im;
public void init(ServletConfig paramServletConfig)
    throws ServletException
    Utils.info("Servlet initialization");
    try {
      super.init(paramServletConfig);
      Utils.info("ServerInfo: " + getServletContext().getServerInfo());
      PGroup localPGroup = this.m_im.claimPG();
      Utils.trace("Got " + localProcessorGroup + " for initialization");
      this.m_im.gatherProperties(localProcessorGroup);-----------this is where it is calling the property files.
      this.m_im.freePG(localPGroup);
      Utils.trace("Released " + localPGroup + " for new Properties");
      localPGroup = this.m_im.claimPG();
      Utils.trace("Got " + localPGroup + " for new Properties");
      try
        ConHandler localDBHandler = (ConHandler)localPGroup.getDBHandler("config.dbhandler");
        this.m_im.setNumPGs(localDBHandler.getNumPGroups());
      catch (Exception localException1) {
        Utils.info("NON FATAL ERROR: failed to set number of PGs", localException1);
      try
        Session.createAndStartSessionTask(localPGroup);
        localPGroup.resumeAllTasks();
      catch (Exception localException2) {
        Utils.info("NON FATAL ERROR: failed to start tasks", localException2);
      this.m_im.freePG(localPGroup);
      Utils.trace("Released " + localPGroup + " for initialization");
      Utils.info("Servlet initialization finished");
    catch (FatalServletError localFatalServletError) {
      Utils.error("FatalServletError: ", localFatalServletError);
      throw new UnavailableException(this, localFatalServletError.toString());
    catch (Error localError) {
      Utils.error("Error: ", localError);
      throw localError;
==========================================================
public void gatherProperties(ProcessorGroup paramProcessorGroup)
    Object localObject;
    this.m_props.clear();
    String str1 = this.m_servlet.getInitParameter("loan.dir");
    if (str1 == null) {
      str1 = System.getProperty("server.root", System.getProperty("user.dir", "."));
    this.m_props.put("loan.dir", str1);
    String str2 = this.m_servlet.getInitParameter("abc.log");
    setLogFile(str2);
    try
      String str3 = this.m_servlet.getInitParameter("abc.props");
      if (str3 == null)
        str3 = "abc.props";
      localObject = str1 + File.separator + str3;
      Utils.info("Reading properties from file: " + ((String)localObject));
      Utils.loadProperties(this.m_props, new BufferedInputStream(new FileInputStream((String)localObject)));
    catch (IOException localIOException) {
      Utils.info("NON FATAL WARNING: Could not read props file", localIOException);--while running i m getting this error
    Utils.info("Reading properties from Servlet Parameters");
    Enumeration localEnumeration = this.m_servlet.getInitParameterNames();
    while (localEnumeration.hasMoreElements()) {
      localObject = (String)localEnumeration.nextElement();
      this.m_props.put(localObject, this.m_servlet.getInitParameter((String)localObject));
    Utils.info("Reading properties from DB");
    try {
      localObject = (ConDBHandler)paramProcessorGroup.getDBHandler("config.dbhandler");
      String str5 = ((ConDBHandler)localObject).getPropertiesFile();
      Utils.loadProperties(this.m_props, new ByteArrayInputStream(str5.getBytes()));
    catch (Exception localException) {
      Utils.info("NON FATAL WARNING: Could not read props file", localIOException);--while running i m getting this error
    String str4 = this.m_props.getProperty("smtp.host");
    if (str4 != null) MailUtils.setSMTPHost(str4.trim());
    if (str2 == null) {
      str2 = this.m_props.getProperty("abc.log");
      setLogFile(str2);
     runInitializers(paramPGroup);
    Utils.info("New Properties:", this.m_props);
    this.m_rroots = StringUtils.getPathsFromList(this.m_props.getProperty("resource.path", "/com/loan/resources/:/"));
    clearAllPGs();
=================================================================
the above is the servlet class and the method which is using to read the property files from root directory in Unix.
ie../opt/mywebapp/loan/abc.props,abc.log
loan is the directory in which two property files are placed.
i just want to where to place property files in tomcat so that its going to read the property files.
Right now, i placing it in the WEBAPPS/MYWEBAPPLICATION/WEB-INF/LOAN/abc.props,abc.logs.
Its giving me errors such as FILENOTFOUNDEXCEPTION or cannot read the property files.
The main problem is ...I donot have the complete source code. while decompiling i m not able view complete source code.
Please help me regarding this.........
Thanks in advance.

Similar Messages

  • Error while reading wsdl file

    I created and deployed a BPEL process with a JMS adapter and DB adapter.
    I have tested this and it works fine.
    After a few days, I try to open the project and the BPEL process, and click on the DB
    adapter and it throws an exception on the designer :
    "Error while reading wsdl file ... (wsdl file name) NULL Exception"
    This is hard to debug as the exception does not provide any info, NULL.
    This has happened several times for my project. The next time the JMS adapter hit the
    same exception while opening on designer. This one I notice happened after I imported
    a new schema file (xsd) into the BPEL process.
    Only way around that I have for this currently is to delete and recreate the adapters, which as time
    consuming as I have to re-create and re-assign a lot of the activities.
    Has anyone encountered this and is there a way to fix this without deleting/recreating the adapters ?
    Thanks.

    I experienced the same issue and found the cause and a workaround;
    "Error while reading wsdl file …. Exception: null"
    http://www.petervannes.nl/files/b7c08911ce3cde3677e2182bbc5f032a-47.php
    Edited by: 944333 on Jul 3, 2012 10:24 PM

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts
    I am facing a problem while  reading XML file from Aplication server  using open data set.
    OPEN DATASET v_dsn IN BINARY MODE FOR INPUT.
    IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      READ DATASET v_dsn INTO v_rec.
    WHILE sy-subrc <> 0.
      ENDWHILE.
      CLOSE DATASET v_dsn.
    The XML file contains the details from an IDOC number  ,  the expected output  is XML file giving  all the segments details in a single page and send the user in lotus note as an attachment, But in the  present  output  after opening the attachment  i am getting a single XML file  which contains most of the segments ,but in the bottom part it is giving  the below error .
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/SHPORD_0080005842.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    for all the xml  its giving the error in bottom part ,  but once we open the source code and  if we saved  in system without changing anything the file giving the xml file without any error in that .
    could any one can help to solve this issue .

    Hi Oliver
    Thanx for your reply.
    see the latest output
    - <E1EDT13 SEGMENT="1">
      <QUALF>003</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803</NTEND>
      <NTENZ>000000</NTENZ>
      <ISDD>00000000</ISDD>
      <ISDZ>000000</ISDZ>
      <IEDD>00000000</IEDD>
      <IEDZ>000000</IEDZ>
      </E1EDT13>
    - <E1EDT13 SEGMENT="1">
      <QUALF>001</QUALF>
      <NTANF>20110803</NTANF>
      <NTANZ>080000</NTANZ>
      <NTEND>20110803<The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'file:///C:/TEMP/notesD52F4D/~1922011.xml'.
    /SPAN></NTEND>
      <NTENZ>000000</NTENZ>
    E1EDT13 with QUALF>003 and  <E1EDT13 SEGMENT="1">
    with   <QUALF>001 having almost same segment data . but  E1EDT13 with QUALF>003  is populating all segment data
    properly ,but E1EDT13 with QUALF>001  is giving in between.

  • Ignoring last 2 lines while reading the file

    Hi All,
    I have a file structure as mentioned below :
    ab
    ab
    ab
    ab
    =======
    =
    While reading a file , i need to ignore the last 2 lines . How to achieve this using FCC parameters.
    Regards
    Vinay P.

    Hi,
    I am not aware of any parameters in FCC to ignore last lines but work around can be :
    You may create one structure to read last 2 lines if depending on file structure and ignore it in mapping (map all records except this structure).
    Regards,
    Beena.

  • Got problem in tomcat while read xml file..

    hi' i just wondering, why i always got his exception, i just want to read this file
    java.io.FileNotFoundException: C:\Program Files\netbeans-5.5\enterprise3\apache-tomcat-5.5.17\bin\dbconfig.xml (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)......How to read dbconfig.xml??
    Right now i put dbconfig.xml in /webapps/myapp/web-inf/classes/dbconfig.xml. but i always got that exception, why??
    if i put my dbconfig.xml in apache-tomcat-5.5.17\bin directory (see exception...), i got no exception.
    So, is there anyway to read dbconfig.xml while i put it in /webapps/myapp/web-inf/classes/ directory?
    This is my code :
    public UserWrapper(){
            builder = new SAXBuilder();
            try {
                doc = builder.build(new File("dbconfig.xml"));
                rootElement = doc.getRootElement();
                System.out.println(rootElement.getChildText("db-driver"));
            } catch (JDOMException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace(); 
        }   Thanks a lot..

    The JVM looks for files relative to the pwd or directory in which it was started. For Tomcat it is the bin directory. That is why it can find dbconfig.xml in the bin directory but not the classes directory.
    You have two choices.
    1; give the path to the file inth eclasses directory. You can use the ServletContext getRealPath method to build this path.
    2: Since the file is in the classpath you can use the Class getResourceAsStream method to get an InputStream to the file. Then see if the SAXBuilder class has an api that takes an InputStream.

  • Error while reading CPS file in jar

    Hi,
    I am getting error :-
    Error while initializing CAZM Factory : CardAuthorizationManagerFactory : getFactory : in one of my class in WSAD
    Root cause i guess its not reading CPS file which is there in one of the jar file.
    Please help me to get solution.
    Regards,
    Divya

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error Reading Property File in Portal Component

    Hello,
    I have created a portal component that calls an api that is located in a jar file.  The documentation on the Portal Component Structure specifies putting the jar file in the PORTAL-INF/lib directory, which I have done.  The problem is, my jar file reads a property file using ResourceBundle, but it doesn't find the property file.  I have placed the property file in the jar file, and throughout the portal component structure, but it just can't find it.  Has anyone else done something similar?  If so, where did you put your property file(s) for external jars that are used in the portal component.
    EP6 SP2 Patch27
    thanks,
    Keith

    Hi,
    I had similar issues and moved the property files to PORTAL-INF/classes.
    Best Regards
    Frank

  • Problem while reading the file from FTP server

    Hi Friends,
    I have a problem while fetching files from FTP server.
    I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
    but I cant able to pick the files from FTP server.
    anyone have faced similar issues kindly let me know.
    Thanks
    Gowrishankar

    Hi,
    try this way..
    for reading the file using FTP you need to use different unix command ..
    Prabhuda

  • Problem While reading a file in text mode from Unix in ECC 5.0

    Hi Experts,
    I am working on Unicode Upgrade project of ECC5.0.
    Here i got a problem with reading a file format which it does successfully in 4.6 and not in ECC5.0
    My file format was as follows:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    It was successfully converting corresponding field values in 4.6:
    *4
    00000186
    2004
    06
    03
    00000010
    25
    0
    4
    0
    54.75
    0
    54.75
    0.00
    While i am getting some problem in ECC5.0 during conversion of the above line:
    *4 000001862004060300000010###/#######L##########G/##########G/########
    it was consider in the same # values.
    I have used the following statement to open and read dataset.
    OPEN DATASET i_dsn IN LEGACY TEXT MODE FOR INPUT.
    READ DATASET i_dsn INTO pos_rec.
    Thanks for your help.
    Regards,
    Gopinath Addepalli.

    Hi
          You might be facing this problem because of uni code. So while opening or reading the file, there is a statement call ENCODING. Use that option and keep the code page which you want. Then the problem may be solved.
    Thanks & Regards.
    Harish.

  • Error while reading a file from server

    Mine is 9i database and 11.5.10.2 oracle apps server
    I am trying to read PDF file from server, I used the below code
    l_bfile:=bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out');
    if DBMS_LOB.FILEEXISTS(l_bfile) = 1 then
    dbms_output.put_line( 'Exists!');
    dbms_output.put_line(dbms_lob.getlength(l_bfile));
    else
    dbms_output.put_line( 'Not Exists!');
    end if;
    i used forward slashes (/) instead of backward slashes (\) too and i also made dbms_output.put_line(to_char(dbms_lob.getlength(l_bfile)));
    while using dbms_log package , i got the below error .I am bit worried since I have created directory and gave sufficicent priviliges too.
    Error report:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01460: unimplemented or unreasonable conversion requested
    ORA-06512: at "SYS.DBMS_LOB", line 485
    ORA-06512: at line 24
    I am sure bfilename('\u05\app\applmgr\11i\oraclecomn\admin\out\jamuna_server','o7742576.out') is give BFILE which is empty.
    Can you please suggest me what I can do to move further? what kind of priviliges it requires to point and read the file from server?
    Please help me in this.
    Thanks in advance

    I suspect you are not using a directory object is the problem.
    Here is the formal description of bfilename
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/functions12a.htm#SQLRF00610
    Sybrand Bakker
    Senior Oracle DBA

  • Error While Reading a file Dynamicall​y in CRIO - 9073

    Hello all,
              I am using CRIO - 9073, here i transferred a file (With size of 5mb) through FTP from my PC..... and then i am trying to read it Dynamically, but while i am reading this file and updating, my CRIO going to stop mode...... So i can't workout more... Give a fine reply all...
    Regards
    Pandithan.

    What code for path building do you have running on the CRIO?
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Facing issue while reading XML file 'LPX-00217: '

    Hi Gurus,
    I am facing one issue while reading the xml file in the one my 11g database instance. The same file if I ran in another instance then it is working fine for me.
    I presume it will be related to NLS character. Please help me in finding out character set.
    And the issue where I am getting instance character set is 'US7ASCII', and I am not getting this issue in another instance where the character set is 'UTF8'.
    And here is the issue I am getting when I was trying to load that file.
    Error Occurred :=ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML
    processing
    LPX-00217: invalid character 150 (U+0096)
    Error at line 1
    Pls help me in debugging this issue.
    Regards,
    Nagendra
    Edited by: 838961 on Jul 12, 2011 9:32 PM

    Hi,
    Pls help me in debugging this issue.There's not much to debug actually.
    The US7ASCII charset stores 7-bit characters, but you're trying to insert a value out of range (150). So that's expected behaviour.
    There were some "tricks" to allow that on some versions, using NLS settings, but it's definitely not the clean way to do it so I won't develop.
    The best thing you have to do is to migrate to character set AL32UTF8, which is fully compliant with XML.

  • Path problem while refering the file in tomcat

    In the jsp file i am going to update one property file which resides in the same folder using file output stream.
    it gives path problem.how can refer the path of that file

    try using getServletContext().getRealPath(java.lang.String path)..You can check out the API for more detail regarding this method.

  • Not recognizing # while reading the file from application server

    Hi
    I am reading a file from application server. While reading into internal table with read statement the last field in each record is filling with hash symbol in the last digit. If I write any if condition with HASH symbol its not going inside the if condition, means its not recognizing as hash may be its internally treating as some other. I need to remove the hash from that field. How I can do that.
    Thanks,
    kishore

    I faced exact situation. Yes, internally its treated as some other special character. What i did was, becuase hash symbol was always coming at the end...i created a dummy field in my internal table so that it will not interfere with my actual data. When i see the data in my internal table, the hash always falls in the last field (dummy) which i will ignore. I could not get solution to remove this hash so i adopted this approach and it worked!!
    Hope it helps,
    SKJ

  • Mutex shared lock while reading/writing files

    Hi,
    My application is a single threaded application. And I am trying to do the read/write file operation.  But there is a chance that other process may read/write the same file while i am using. So before reading or writing the file, i want to mutex shared
    lock.
    So can please some one tell me how to prevent this situation. Is there some sample code. I checked in net, how to use mutex shared lock, i got some example, but every where before using the mutex loxk, a thread needs to be created. Since my application is
    a single threaded, so i dont want to create a new thread.
    So please help me, how to prevent/stop other process to access the same file while my application is using.
    THanks a lot in advance.

    That's not something that a mutex can help with. Other processes won't know about your mutex and even if they know that's overkill. Normally you simply open that file without allowing read/write sharing - in the case of CreateFile that in general means that
    you pass 0 for the dwShareMode parameter.
    If you use the C runtime functions then you can use fopen_s instead of fopen as it automatically disallows sharing if you open the file for write (if you open for read when it allows shared read which is the normal thing to do).

Maybe you are looking for