How does Oracle handle resource files?

Good day everyone,
I have a Java code that opens a text file. When I load this code into Oracle using loadjava, I also load in the text file as a resource file. When I run the code on Oracle (after publishing all necessary Java code), I get a NullPointerException, because it can't find the text file when I try to open it. I get no resolve errors when I user loadjava.
How can Java inside Oracle open external text files?
Thanks in advance for your help,
Gary

I think you should rewrite your code using the following.
FileWriter fw = new FileWriter(getServletContext().getRealPath("/testfile.txt"));
FileReader fr = new FileReader(getServletContext().getRealPath("/testfile.txt"));It works for me.

Similar Messages

  • [solved] How does Pacman handle config files?

    Hi,
    I've read that Pacman handles config files by comparing their hashes in 3 different statuses.
    (which are in current status, new status, and original status)
    The current config file's hash is easily obtained, and so does the new ones'.
    But how does Pacman get the original one's hash?
    Can someone tell me, please?
    Thank you, and happy new year,
    bsdson
    Last edited by bsdson.tw (2008-12-26 07:37:41)

    It is stored in the pacman database.  e.g. look at /var/lib/pacman/local/pacman-3.2.1-2/files

  • How does Photostream handle duplicate file names?

    My sister has an iPhone and an iPad, and takes photos with both. Her husband has an iPhone, and also takes photos. They have a PC. Photostream is enabled on all of these devices.
    Now, since all three devices use a simple sequential file numbering system (IMG_XXXX), they will produce duplicate file names.
    This, of course, becomes an issue when you consolidate the photos taken by multiple iOS devices in one folder as is done by Photostream on PC.
    Which brings me to my question: How does Photostream (on PC) handle duplicate file names? Does it simply overwrite, keeping the one with the latest date, or what? Does it inform the user in any way?
    Oddly, I have seen little discussion on this. It really seems like Photostream is pointless

    FOLLOWUP. Below, is a clearer explanation of my concern/question.
    My sister has an iPhone and an iPad, and takes photos with both. Her husband has an iPhone, and also takes photos. Photostream is enabled on three devices. They have a PC. iCloud Control Panel for Windows is installed, and Photostream is enabled.
    Now, since iOS devices use a simple sequential file numbering system (IMG_XXXX.JPG), when you consolidate these images into one folder as is done by Photostream on PC, you will sooner or later encounter two (or more) different photos that have the same file name. Different photos with the same file names can/will happen when you consolidate images taken with different iOS devices into the same folder.
    Which brings me to my question:
    How does Photostream (on PC) handle duplicate file names that are not duplicate images?
    Q: Does it simply overwrite, perhaps keeping the one with the latest date taken? In this case Photostream will not contain all of the photos it should.
    Q: Or, does it do something to create a unique filename when it encounters a duplicate file name? For example: IMG_0001, IMG_0001(1), IMG_0001(2)
    Oddly, I have seen no discussion on this. I hope someone can help me understand how Photostream handles this so we can decide how best to use Photostream, or if it is a feature we want to disable.
    Thank you,
    Lilla

  • How does Tomcat handle data files?

    Hello,
    To test something, i wrote a small test.jsp file, to figure out how tomcat handles data files. The content looks like this:
    <html>
    <head>
    <title>test</title>
    </head>
    <body>
    <%@ page import="java.io.*"%>
    <%
              String Line;
              try
                   FileWriter fw = new FileWriter("http://localhost:8080/act/testfile.dat");
         PrintWriter pw = new PrintWriter(fw);
                   pw.write("yeah baby yeah");
                   pw.close();
                   FileReader fr = new FileReader("http://localhost:8080/act/testfile.dat");
         BufferedReader br = new BufferedReader(fr);
                   Line = br.readLine();
                   br.close();
              catch (Exception e)
                   Line = "OEPS : " + e.getMessage();
    %><%=Line%>
    </body>
    </html>
    This give me an error.
    When i chance the path of the Filewriter adn filereader to: c:/testfile.dat
    it works.
    Can anyone explain this to me...
    many thanks
    Hugo Hendriks

    I think you should rewrite your code using the following.
    FileWriter fw = new FileWriter(getServletContext().getRealPath("/testfile.txt"));
    FileReader fr = new FileReader(getServletContext().getRealPath("/testfile.txt"));It works for me.

  • How does iWeb handle packaged files. (Like Keynote files)

    I'm going to be changing this site soon, but I wanted to check here before I did.
    Symbolic Representation
    At the bottom of the page are two .key files for Keynote. When I dropped them onto iWeb, it shows them added as filename.key.zip but in the Domain file and in the file area on my iDisk, it shows as filename.key.
    If you attempt to download them, one of two things happen. The file is downloaded as a .zip file, unarchived, .zip file sent to the trash then opened in Keynote
    OR
    File is a .zip when it downloads, but only filename.key is shown making the user think the file is corrupt. If they add .zip to the end and double click, it will unarchive and you'll be able to open the file properly.
    I was wondering if anyone else had run into this? Does this work consistently OR why wouldn't it work for some people?

    I'm going to zip them soon to see if that solves the problem, but wanted to know how many people using OSX are seeing a problem now. So far, I've only had one person say they downloaded as corrupt .key files, everyone else can see them fine.
    Just curious about the "why" so that if anyone else has this problem, I'll have more info
    Either way I link it, the interface shows filename.key (even the rollover text after I create the page says filename.key), the URL area in the inspector shows filename.key.zip, and the file in the Domain file AND on the iDisk is filename.key.

  • How does OVS handle sparse files?

    I can see that if I create a new virtual machine a spare disk image file is created - fine. But I'm having problem with other type of operations. If I have a sparse System.img in some Virtual machine and I create a template of it - then the System.img copied to the template catalog is not sparse anymore- I guess this holds true also if you clone a virtual machine. Does anyone know if OVS support handling of sparse files when moving/copying the files arround? Or maybe know if this feature is planned?

    I think you should rewrite your code using the following.
    FileWriter fw = new FileWriter(getServletContext().getRealPath("/testfile.txt"));
    FileReader fr = new FileReader(getServletContext().getRealPath("/testfile.txt"));It works for me.

  • How does Oracle handles the delete ?

    Hi ,
    I have a unix loder that does the issue this command
    EXEC SQL DELETE FROM TBl1 where id in (select id from TMP)
    if any user is accessing a record in TBL1 , will Oracle wait for the record to be released before it does the delete or it simply skip it ?
    pls advise
    tks & rgds

    It will wait please look at the example below:
    Session 1:
    [email protected]> select * from dept;
    DEPTNO DNAME LOC
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    [email protected]> update dept set loc = 'WARSAW' where deptno = 10;
    1 row updated.
    Session 2:
    [email protected]> delete dept;
    -- waiting
    Session 1:
    [email protected]> commit;
    Commit complete.
    Session 2:
    4 rows deleted.
    [email protected]> select * from dept;
    DEPTNO DNAME LOC
    10 ACCOUNTING WARSAW
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    Location was changed
    Best Regards
    Krystian Zieja / mob

  • How does RoboHelp handle aspx files?

    Working to convert aspx files to RoboHelp then BACK to aspx without taking in a different tool. Is it possible? If so, how?

    Colum is right. We need more information. Presently, the only way to have RoboHelp generate "native .aspx" files is using a Multiscreen layout and publishing to SharePoint. You will find documentation on this process in the online help topic
    Adobe RoboHelp 11 * Publish native (ASPX) Multiscreen output to Microsoft SharePoint
    Also, you will want to refer to Willam VanWeelden's website where there is more info as well as a recording of a seminar Willam and I conducted last year. Recording of RoboHelp & SharePoint Integration Webinar Now Available | WvanWeelden.eu
    Thanks
    John Daigle
    Adobe Certified RoboHelp and Captivate Instructor
    Evergreen, Colorado
    www.showmethedemo.com

  • How does Oracle hanlde I/O error

    I've setup an Oracle RAC using four Linux RH hosts connected with fiber channel to a DS4700 disk array.
    In case of a failover between the FC paths it could happen that a disk I/O request return error. How does Oracle handle that, will Oracle retry the error ?

    There are several possibilities to stripe a tablespace.
    You can create
    a) an ORACLE Tablespace with several datafiles
    b) an OS mountpoint which has striped several disks
    If you've an existing tablespace and want to stripe this tablespace with ORACLE than you can create an additional tablespace wtih several datafiles which are on different disks. After this you can use
    - imp/exp
    - CTAS
    - online redifinition
    to copy the tables to the tablespace.
    You should also consider that you've a less safe system if you have several disks which are not mirrored or on a RAID 5 system.

  • How does Aperture handle file structure

    I have been working with iPhoto since its infancy and have one big issue with it, namely that it is such a closed system. I dislike that everything needs to be imported and exported to use it elsewhere, clogging up my computer with all these duplicates. Does Aperture handle that better? I spent 2 hours reading different reviews and discussions and for some reason, nobody seems to discuss exactly that, maybe most people don't mind to have a vault structure? If so, how do you handle sharing files outside of the tools like Facebook export etc that are offered?
    Thanks ~ Barb

    namely that it is such a closed system.
    It's not. It's a Database and this
    everything needs to be imported...
    is a characteristic of databases. This
    and exported to use it elsewhere
    is just not true if you use any of the very many ways that the OS and other applications integrate with iPhoto. I rarely, if ever, exported from iPhoto when it was my primary Photo app.
    The point is not to defend iPhoto, but if the database aspect of it irritates you then run a mile from Aperture. Everything has to be imported and can be accessed only in (pretty much) the same ways as they can be in iPhoto.
    how do you handle sharing files outside of the tools like Facebook export etc that are offered?
    Here's a stock answer I use over on the iPhoto forum. You can pretty much swap the word 'Aperture' for iPhoto:
    There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    +*(Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)+*
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    Regards
    TD

  • How does FCP handle 23.98 DV Files?

    Hi All,
    Has anyone Edited using the DV-NTSC 24P (23.98fps) Easy Setup?
    1) How does FCP handle this video connected to a DV Converter Box like the Canopus ADVC-110?
    2) Does it actually play at 23.98fps on a monitor connected to the DV Converter Box?
    3) Does it get converted to 29.97fps somewhere in the process before it gets displayed?
    4) is it displayed at 29.97fps or is it really being displayed at 23.98fps?
    these are things that I am not sure of.
    sorry if I posted this message a couple of times. I didn't know that hitting the "Tab" Button posts the message, I thought it would just function like the Tab in a normal Text editor and indent a line. But here it doesn't.
    thanks
    Kalagan

    Hi,
    Thanks for the feed back. I guess I should fill in the caps a little.
    *DESCRIPTION OF ISSUE:*
    One of our main Clients Disney, is migrating to a Tapeless Workflow based on ProRes HQ 422 @ 23.98fps. From here on out, they will only send us ProRes HQ 422 1920x1080 files @ 23.98fps and they want us to Edit every project we work on for them @ 23.98fps. At the moment, it doesn't sound like they care if we Edit our projects in ProRes HD or some SD format, but the important thing to them is that we edit @ 23.98fps.
    PROBLEM:
    Our facility doesn't have the infrastructure to support 25 machines accessing ProRes HQ 422 files. Our facility was built to support DV NTSC @ 29.97fps and we have been working this way fairly well, for a number of years.
    SOLUTION:
    I am trying to find a way to continue to us our current equipment and satisfy Disney's request to work on all their projects at 23.98fps, starting from 1920x1080 ProRes HQ 422 files @ 23.98fps. So, it was my hope to be able to take the 23.98fps ProRes files and export them to 23.98fps DV NTSC. This way we wouldn't have to reconfigure our entire Facility (which would cost a couple hundred Thousand dollars).
    My approach was to:
    1) Use Media Manager to render a new DV NTSC file at 23.98fps, which it does pretty well for the most part. It keeps the Timecode consistent between the two files (very important), but doesn't allow you to Letterbox the 16x9 video in the 4x3 frame, it just stretches it to fill the entire 4x3 frame (not so good).
    2) Then import the newly created DV NTSC 23.98fps file into a FCP Project based on the DV NTSC 24(p) 23.98fps EASY SETUP. Which works well. No problems there.
    3) Then Play the file in FCP out through a Firewire based Canopus ADVC-110 DV Converter connected to a SD Sony Monitor. This seemed to worked fine also.
    The fact that it plays is great!!!! But, that brings up the question, is it really playing a 23.98fps?
    My understanding of Standard Definition and specifically DV NTSC, is that it can only be displayed at 29.97fps, it doesn't support 23.98fps natively. So the fact that it played when I tested it got me thinking that I may be missing something here and DV NTSC and other SD equipment (like the Sony SD Monitor) can playback/support 23.98fps SD video. But that goes against everything I know up to this point!!!
    Have I been wrong all this time?
    1) Can SD Video and DV NTSC Video be displayed at 23.98fps?
    2) Or is it getting converted to 29.97fps somewhere in the process before it is getting displayed?
    3) If it is getting converted back to 29.97fps, then where is it getting converted, FCP or in the DV Converter Box?
    I am sorry I went a little long on this email, but it is a problem that will have great influence on they way we work for a couple of years to come!!
    Thanks for your input!!
    Kalagan

  • How does iphoto handle files exactly?

    using the program spring cleaning, i found all images outside of my iphoto library and imported them into my library. my question now is, if i run the search again, finding all images not in my iphoto library, can i safely delete those images since they have been copied into iphoto or are they still needed as a reference for the program? how does iphoto work with files exactly? i know there's an "original" and a "data file", but where are each of these stored? when a photo is imported to the iphoto library, does it make a copy of the original and the data file or what?

    ryanfg
    Unless you changed the default setting in the iPhoto preferences, then if a photo is in the iPhoto Window then it's in the iPhoto Library Folder.
    A Note about the iPhoto Library Folder:
    In this folder there are various files, which are the Library itself and some ancillary files. Then you have three folders
    Originals are the photos as they were downloaded from your camera or scanner.
    (ii) Modified contains edited pics, shots that you have cropped, rotated or changed in any way.
    This allows the Photos -> Revert to Original command - very useful if you don't like the changes you've made.
    (iii) Data holds the thumbnails the the app needs to show you the photos in the iPhoto Window.
    Regards
    TD

  • How does oracle suggest the archive log

    Hi All,
    My question is about user managed backup and recovery.
    For User managed hot database refreshes.
    We  create a new controlfile and do cancel based recovery.
    How does oracle suggest the next archive to apply when we do "recover database using backup controlfile until cancel;"
    I mean we created a new control file ..rt.
    where is the information about the archivelogs stored.
    Thanks,
    Silver

    In the controlfile.
    The "using backup controlfile" means using a backed up controlfile, and you want to fool Oracle into thinking a point in time recovery will happen so don't use what would be the controlfiles current scn time to automatically say the recovery is complete.  If you have created a new controlfile, all it can know about is where the logs should be and compare to what log sequences the datafile headers have.  So it uses the init.ora parameters and what the data file headers have in them to figure it out. http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3151992035532#36651366990046
    If you backup controlfile to trace you can see log files that have the incarnation history.  See "Recovering Through a RESETLOGS with a Created Control File"  in Performing User-Managed Recovery: Advanced Scenarios

  • How does oracle know the databse is inconsistent and needs recovery?

    Hello,
    How does Oracle know that the datafiles are inconsistent and db needs recovery when rebuilding the db off of the online/hot backups? Whereas, it doesn’t ask for recovery when rebuilding the database from cold backup (I understand that, for cold backup, database is shutdown immediate and hence the db is consistent). In both scenarios, a new control file is created (that means it won’t have SCN) and only datafile header will have the SCN. What’s that piece of info that oracle check to know if the database is consistent or inconsistent during the backup restore and recovery and where that info resides?
    Thank you for any hints and answers.
    Jay

    Oracle uses the datafiles to identify if they are consistent. If the datafiles backup was taken when the database was OPEN, they are marked as "fuzzy" in the header. Also, likely, the Checkpoint SCNs may be different if tablespace checkpoints (e.g. by ALTER TABLESPACE BEGIN BACKUP) are at different points in time.
    If the backup was a cold backup with the database shutdown normal/immediate, the headers are marked appropriately.
    When you run CREATE CONTROLFILE, it has to read the datafiles because the controlfile, itself, has no SCN and LogSequenceNumbers information.
    Hemant K Chitale

  • How does impdp handles external tables

    I am just done with schema import and one of the package is invalid because it is referring the External Table. I am getting the error " Table or View does not exist".
    How does impdp handles external tables ?
    Do we need to replicate the directories and files from the source to imported destination ?
    Thanks

    Hi,
    Yes...
    external table directory not available on imported destination operating system
    You need to create the directories and files from the source to imported destination
    Recompile the invalid package
    Thanks

Maybe you are looking for