Problem reading custom property file from custom event handler.

Hi,
My custom event handler needs some bits of information that I have set up in a property file. However, when the event handler runs it throws a FileNotFound exception - actually its because permission was denied.
I have added the code System.getProperty("user.name") to find out the actual user that the event handler is running as. It reports that "oracle" is the user.
That's great. However, the permissions on the file will allow oracle to read/write the file. If I log onto the server where OCDB runs (as oracle), I can vi the file.
The file is owned by another user, but the "oracle" is a member of the group that has read/write (we're running on a unix box). The file is not 777.
The event handler is actually calling a static utility method that returns the Properties. This utility is used elsewhere in other custom apps in conjunction with OCDB (on the same server). It works there, so the utility is functioning correctly.
Is there something going on that I'm missing? Like somehow the event handler is acually runn as somebody else?
Here is the node log.
2007/07/17 12:52:16 [oracle.ifs] [37] 434364 system FINE: Error /opt/csc/sfi/configuration/sfi.properties (Permission
denied) Additional INFO: java.io.FileNotFoundException: /opt/csc/sfi/configuration/sfi.properties (Permission denied)
Thanks in advance for the help.
Winston

Matt,
Sorry to have wasted your time. It was a server reboot issue. The ocdb server hasn't been restarted since early July. We added the users and groups late last week. Although we tested on line, the server wasn't quite up to speed with the new changes.
We bounced the server and all is well.
Thanks
Winston

Similar Messages

  • Error while reading a property file from a war.

    Hi,
    I am trying to read a property file which is available in the properties folder.
    The piece of code that does this read is as follows.
    InputStream is = ClassLoader.getSystemResourceAsStream("codemap.properties");
    System.out.println("Reading file:"+is);
    properties.load(is);
    The "codemap.properties" file is available in the properties folder.
    Following is my directory structure in the war file
    sample.war
    |
    |
    WEB-INF
    |
    |
    classes
    |
    |
    properties
    |
    |______ codemap.properties
    Inside the war file I have WEB-INF and properties folder.
    Inside WEB-INF i have the classes folder which has the classes
    Inside the properties folder I have the codemap.properties file.
    I am using Jboss. In the class path I have ./properties
    I have also added this classpath in the manifest file.
    Problem: The piece of code that I have written to read the property file is not able to locate the file and this it returns null.
    I am not sure what i am missing here.
    If anyone there have any solutions please let me know.
    Thanks in Advance
    Balaji.

    I think you've to change this line
    InputStream is = ClassLoader.getSystemResourceAsStream("codemap.properties");with this.
    InputStream is = ClassLoader.getSystemResourceAsStream("properties/codemap.properties");it is unable to find the path you specified. by default it'll check the WEB-INF directory. so you've to give the relative path to it.
    Diablo

  • Problems reading generated pdf-files

    Hi all,
    I have problems reading generated pdf-files from
    Report Builder 6.0.8.11.3
    An error-message occurs when opening the pdf with
    Adobe Acrobat 5.0.1:
    ... problem 110 and after moving in an empty pdf-document
    the messages:
    - too few operands
    - an unrecognized token
    I think the solution must be very simple, but the docu and
    other info resources provide nothing aboutthis issue.
    Greetings,
    Bernhard

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by the oracle reports team:
    hello,
    there are no known problems with reading reports PDFs with later Acrobat Readers. maybe your file is somehow corrupt.
    regards,
    the oracle reports team<HR></BLOCKQUOTE>
    I had to install a local printer, the network printer is not appropriate here. After that, everything is fine :-)),
    Greetings,
    Bernhard
    null

  • Problem in reading an Image file from a Output Stream.

    I am having problem reading a JPEG file. Actually i am sending JPEG file using UDP from the client. I am using this code to convert to a byte array to transmit the file:
    DataInputStream inStream = new DataInputStream(new FileInputStream("src/Bgamex.jpg"));
    String str1 = inStream.toString();
    byte[] bindata = new byte[65500];
    bindata = str1.getBytes();
    On the server side, I am using these lines to convert the bytes to a file again but it seems to be that its not working. Its making file but with a bigger size & like garbage in it, showing nothing:
    byte[] buf = new byte[65500];
    // receive request
    DatagramPacket packet = new DatagramPacket(buf, buf.length);
    socket.receive(packet);
    buf = packet.getData();
    java.io.OutputStream fos = new java.io.FileOutputStream("Bga.jpg");
    fos.write(buf);
    Could somebody lemme know the problem in converting the file.
    Thanx.

    I propose you to perform this simple test to see by yourself:     final String BIN_FILENAME = "somebytes.bin";
        byte[] bin = {5, 4, 3, 2, 1};
        FileOutputStream out = new FileOutputStream(BIN_FILENAME);
        out.write(bin);
        out.flush();
        out.close();
        byte[] bindata;
        DataInputStream in1 = new DataInputStream(new FileInputStream(BIN_FILENAME));
        String str = in1.toString();
        in1.close();
        bindata = str.getBytes();   
        System.out.print("Bytes read with in1>");
        for (int i=0; i<bindata.length; i++) System.out.print(bindata);
    System.out.println();
    FileInputStream in2 = new FileInputStream(BIN_FILENAME);
    bindata = new byte[65505];
    int bread = in2.read(bindata, 0, in2.available());
    in2.close();
    System.out.print("Bytes read with in2>");
    for (int i=0; i<bread; i++) System.out.print(bindata[i]);
    System.out.println();

  • Read an EXCEL file from application server

    Hi all
    I have to read an excel file from applicatin sever and update my custom tablels.
    The problem is when the file is uploaded into the application server .
    the fields it has are
    name age gender
    xyz    67  m.
    when seeing the file using al11 tcode :
    its showing the following:
    ###&#2161;##################>#######################################################################################################################
    #################################################################O#b#j#I#n#f#o################################################################
    How do i read this and put in my internal table
    Pleaes help.
    Thanks and Regards,

    Hi,
    I am using ECC6.0.
    I think the EXCEL file is stored in compressed format to save space.
    Please let me know how to decompress etc.
    I tried using the function moduel
    text_convert_xls_to_sap.
    How do I pass the parameter to I_filename.
    Regards,

  • Reading an xml file from a jar file

    Short question:
    Is it possible to read an xml file from a jar file when the dtd is
    placed inside the jar file? I am using jdom (SAXBuilder) and the default
    sax parser which comes with it.
    Long Question:
    I am trying to create an enterprise archive file on Weblogic 6.1. We
    have a framework that is similar to the struts framework which uses it's
    own configuration files
    I could place the dtd files outside the jar ear file and specify the
    absolute path in an environment variable in web.xml which is
    configurable through the admin console.
    But I want to avoid this step and specify a relative path within the jar
    file.
    I have tried to use a class which implements the entityresolver as well
    as try to extend the saxparser and set the entity resolver within this
    class explicitly, but I always seem to sun into problems like:
    The setEntityresolver method does not get called or there is a
    classloader problem. i.e. JDOM complains that it cannot load My custom
    parser which is part of the application
    Vijay

    Please contact the main BEA Support team [email protected]
    They will need to check with product support to determine
    the interoperatablity of Weblogic Server with these other
    products.

  • Help reading a .txt file from the hard drive....

    Hi guys,
    Ok... I need to know how to read a .txt file from the hard drive... I have an example on how to read from a disk, but I don't have a disk drive. I could be confusing terminology, but I don't think I am. Here is the code I have for reading from a disk.. please let me know how I should change it to read from a hard drive.
    Also, when the error pops up, it says that it can't read another .txt file that is not specified in the code... any ideas how that is occuring? Please advise.
    import java.io.*;
    public class TEST {
    public static void main(String args[]) throws Exception{
    FileReader fr = new FileReader("customer.txt");
    BufferedReader bfr = new BufferedReader (fr);
    String s;
    while ((s=bfr.readLine())!= null){
    System.out.println (s);
    fr.close();
    }

    Ok... I need to know how to read a .txt file from the
    hard drive... I have an example on how to read from a
    disk, but I don't have a disk drive. I could be
    confusing terminology, but I don't think I am. Here
    is the code I have for reading from a disk.. please
    let me know how I should change it to read from a
    hard drive.The code will be the same, regardless of where the file is located. It's just the filename that will be different.
    Also, when the error pops up, it says that it can't
    read another .txt file that is not specified in the
    code... any ideas how that is occuring? Please
    advise.Probably becuase the class file (compiled version of the source code) is a different version to the source code, i.e. the source code hasn't been recompiled since the source code was changed.
    How does this relate to EJBs?

  • Loading property files from a class and not a servlet...

    Hi, I was wondering if anyone has a good solution for loading property files from a class instead of a servlet. I would like to load the property file similarly to how it is done from HttpServlet.
    Here is the large picture. I have a tag library that calls a class which needs to access a database. The class needs to know what DB to access so it needs to look at some property file. The problem is that I don't want to hardcode the properties or the path of where the property file exists. I hope this all makes sense.
    Thanks.
    -PV

    I use the getResource method in the java.lang.Class class. Read about this method in the api.
    Anyways this is roughly how it's : you must put your properties file in the classpath. Then in your class :
    Properties prop = new Properties();
    URL url = this.getClass().getResource("/config/db.properties");
    prop.load(url.openStream());In this case, you must put the "config" (where you've written your db.properties file) directory's parent in the classpath.

  • In Vista,  Applet isn�t able to read the property files

    I�m working on internationalization; the Applet which I�m using wasn�t able to read the property files properly in windows Vista machine. But if I create a jar which contains all the classes and property files, Applet works fine.
    This problem is only in Vista machine ,In XP the JVM is smart enough to read plain .property files and its works well without creating the jar
    Is that related to any security enhancemence of vista over XP?
    Below is a link about The Java Security Model break on Windows Vista
    http://bugs.sun.com/view_bug.do?bug_id=6548078
    I tried a simple ResourceBundle.getBundle() in my Applet in different ways but nothing work fine for me. It isn�t an issue related to path, I guess because I tried several ways like.
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle",currentLocale);
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle",currentLocale);The exception got in java console is
    CONFIG: [2008-05-13 15:54:57.909]:(com.satm.insite.InsiteApplet$2@1696e4c):InisiteApplet: Exception:  java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
    java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
                at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
                at java.util.ResourceBundle.getBundleImpl(Unknown Source)
                at java.util.ResourceBundle.getBundle(Unknown Source)
                at com.satm.insite.InsiteApplet.displayValue(InsiteApplet.java:261)
                at com.satm.insite.InsiteApplet.callme(InsiteApplet.java:296)
                at com.satm.insite.InsiteApplet.initialize(InsiteApplet.java:327)
                at com.satm.insite.InsiteApplet$2.run(InsiteApplet.java:235)
                at com.satm.tools.languageTools.ThreadPool$ExceptionCatchingThread.run(ThreadPool.java:226)Is there any way to make it work in Windows Vista machine�? This could be a great help for me.
    Thanks
    Robert

    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=5295743&messageID=10250558#10250558
    http://forum.java.sun.com/thread.jspa?threadID=5295742&messageID=10250556#10250556

  • Reading a text file from a URL

    I am having problems trying to read a text file from a URL.
    This is the code i have been using:
    package Java;
    import java.net.*;
    import java.io.*;
    public class Main_1 {
    public static void main(String[] args) throws Exception {
         URL myAddress = new URL("http://www.geocities.com/simonrobinson1/java/farrago.txt");
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        myAddress.openStream()));
         String inputLine;
         while ((inputLine = in.readLine()) != null)
         System.out.println(inputLine);
         in.close();
    but it returns an error saying:
    java.net.NoRouteToHostException: Operation timed out: no further information
    at java.net.PlainSocketImpl.socketConnect(Native Method) .....etc etc.
    Is this just a problem due to my network or is there something wrong with my code ????

    Altho you can access the file by typing the URL in a browser, geocities being a free web-hosting service don't like you to access the materials without seeing their ads. You have to find a way to trick it into thinking that you are indeed coming in from a web browser even tho you aren't.
    V.V.

  • Reading a Compressed File from a ZIP File, which is an entry of ZIP File

    Hello, Experts,
    Would it be possible somebody to help me with code example for the following problem?
    I want to read a compressed file from a ZIP file, which is an entry of ZIP File, without extacting/writing files on file system. Is this possible?
    Lets say we have a ZipFile1. There is ZipFile2 inside ZipFile1. And inside ZipFile2 is FileA. The scenario is reading FileA without extracting on file system.
    Thank you in advance for your help.
    Cheers
    RADY

    The classes you want to be using are java.util.zip.ZipInputStream and and ZipEntry from the same package. Construct the ZipInputStream with the input you have for the outer zip. Loop with ZipInputStream.getNextEntry until you find the inner zip you're looking for - that method returns a ZipEntry, and you get the name of the zip entry with ZipEntry.getName. Read the ZipInputStream from that point into some buffer, and read that buffer into a new ZipInputStream - rinse and repeat until you have the contents of the file in the zip in the zip...

  • Reading a CSV file from server

    Hi All,
    I am reading a CSV file from server and my internal table has only one field with lenght 200. In the input CSV file there are more than one column and while splitting the file my internal table should have same number of rows as columns of the input record.
    But when i do that the last field in the internal table is appened with #.
    Can somebody tell me the solution for this.
    U can see the my code below.
    data: begin of itab_infile occurs 0,
             input(3000),
          end of itab_infile.
    data: begin of itab_rec occurs 0,
             record(200),
          end of itab_rec.
    data: c_comma(1) value ',',
            open dataset f_name1 for input in text mode encoding default.
            if sy-subrc <> 0.
              write: /, 'FILE NOT FOUND'.
              exit.
            endif.
    do
      read dataset p_ipath into waf_infile.
      split itab_infile-input at c_sep into table itab_rec.
    enddo.
    Thanks in advance.
    Sunil

    Sunil,
    You go not mention the platform on which the CSV file was created and the platform on which it is read.
    A common problem with CSV files created on MS/Windows platforms and read on unix is the end-of-record (EOR) characters.
    MS/Windows usings <CR><LF> as the EOR
    Unix using either <CR> or <LF>
    If on unix open the file using vi in a telnet session to confirm the EOR type.
    The fix options.
    1) Before opening the opening the file in your ABAP program run the unix command dos2unix.
    2) Transfer the file from the MS/Windows platform to unix using FTP using ascii not bin.  This does the dos2unix conversion on the fly.
    3) Install SAMBA and share the load directory to the windows platforms.  SAMBA also handles the dos2unix and unix2dos conversions on the fly.
    Hope this helps
    David Cooper

  • Can I change the file path that itunes reads my music files from? 65000 files trying to be transferrd from external to internal HD. I dont want itunes to manage my collection, just read it. thanks

    Can I change the file path that itunes reads my music files from?
    I have about 65000 music files that i have transferrd from my external to a new laptop internal HD.
    I have organised the folders myself as I use a PC and do not want itunes to organise the folders because when I'm searching through music on windows it is sorted out by artists/albums with 'the...(eg  The Beatles)' under 'T' instead of 'B'.
    Long story short.... Is there any way that I can keep my itunes library as it is on the external HD and copy it to the new laptops C drive, keep all the info (playlists etc) and still have the same folder structure as on the external HD?
    Or, is there any way of making windows sort things in alphabetical order like it is in itunes (eliminating the 'the' issue)?

    The files that weren't inside the media folder on the original machine need to be copied over to exactly the same paths as they had on the source machine. See this thread for an ongoing discussion of a similar problem. See also this post on migrating the iTunes library.
    tt2

  • Read a property file and store it in a hashmap

    Hi,
    I have tried to read a property file and store it in a hashmap. The property-names should be stored in keys and the property-values (after = symbol) in values of the hashmap. any ideas? Is it possible to do this?

    mandy2001ir wrote:
    yes, but I need the hashmap for another reason. Actually I'm trying to use the properties file to have a dynamic hachmap. I don't want to change the code anytime I want to put a value in the hashmap. therefor I write the "keys" and "values" in a property file and change the property file. That's the reasn why we have property files, isn't it?What's a "dynamic hashmap"? There's no other kind! Whenever someone starts bandying around the word "dynamic" in contexts like this, it usually means there's a simple solution to their problem, that they haven't yet considered, or mistakenly don't believe is applicable to them, because of this "unique" need for something "dynamic". Trust me, you just need to load the file using a Properties object, and you're done. Properties extends Hashtable, which is virtually the same thing as a HashMap. Properties does exactly what you want it to. it's the very reason the class exists
    Have you even looked at the javadoc for java.util.Properties yet? I'm betting not, because if you had, you'd know exactly what I meant. And since you haven't, I'm at a bit of a loss as to how you can so easily dismiss the class as useless, despite existing to do exactly what you need

  • How to Read a CAB File from JAVA?

    Hi,
    Anyone knows how to read a CAB File from java. I need to read a property file of txt file that is packaged in CAB file & then based on that, I have to do processing. Is there anyway to do it.
    I had tried using java.util.zip.ZipFile Class, but it does work for JAR, but not for CAB.
    siva.

    Perhaps there's something in the Cabinet SDK that will help:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncabsdk/html/cabdl.asp

Maybe you are looking for