Releasing Resource (File Handle) and Document Builder

I am currently working on a project that uses a Jar file containing XML configuration files. The Jar file needs to read this file and the DocumentBuilder.parse method is called on the XML files. Later, new XML files need to be added to this same Jar file.
The problem is that at that point I can't open the Jar file for writing because I can't unlock the file since it is held by the DocumentBuilder. Even when these objects go out of scope and are deleted the resource is not being unlocked. The only solution I've found is to copy the file and read from the copy and write to the original. This solution leaves extra files lying around though and is not very elegant. Is there anyway I can force that file handle to be destroyed and unlock the configuration file resource?

That could be.....
Basically I create a URI object using the path for the Jar file and the XML file within it. Then I use URI.toString() and give that to the Document Builder.
DocumentBuilder.parse( StringURI )

Similar Messages

  • Records management and Document builder in SRM with PS

    Hi,
    We are implementing SRM 5.0 with PS ( Public section), can any one share any experience and documentation about Records management and Document builder in SRM with PS.
    Thank you
    Sreedhar Vetcha

    Hi Chris,
    I am having the same issue as Patrizia while using BSP, SRM_DEMO_RECORD & SRM_DEMO_BSPEXT, to search/display, maybe update later the records,documents,and notes that are stored in RM. I have read all the documentation  described in your messages as to how to customize web display BSP application using these 2 BSPs, srm_demo_record & srm_demo_bspext. 
    I tested SRM_DEMO_RECORD with <srm:element> tag embbeded in the layout page, but it lists only the records that associated to a given RMS_ID and SPS_ID, and I wasn't able to get it to display the associated document and notes for a selected RM record. The comments on the iview page in BSP suggest the custom code is needed for initial request from browser and callback event to return the notification for the activities occurred in RM. As you suggested to Patrizia, I wonder if you've some sample code that i could use to make these BSPs work before additional enhancements is needed later.  As far as other prerequisit settings of http access and assigning search interface class to the correct service provider element type using GENSP_QUERY_EXT connection parameter are all properly set with my customer. So i'd feel really grateful if you could forward me the example codes for these BSPS.
    Regards,
    Amy Lee
    SAP NetWeaver Consultant

  • Problem keeping resource files for iPhone/iPad builds in sync

    I recently created a new target for iPad by upgrading my target for iPhone, which seemed to work fine. However, since then I have had problems when I make changes to the plist files that I have grouped under Resources.
    When I upgraded the target, it created a new folder for iPad resources called Resources-iPad. This only contained the nib files -all the other plist files I have containing data are still in the Resources folder.
    When I added a new plist file to Resources and try to load it using the bundle path, it gives me different paths for the iPhone/iPad versions, in .../Application Support/iPone Simulator/4.2/Application/...
    However, the path of the file I am trying to load is of the form myApp./MyFile.plist, and I can't seem to open the app in the bundle path directory in Finder.
    I've tried things like making clean, etc. Are there any steps you need to take to keep the resource files of the iPad target in sync with the iPhone one once it has been created?

    I created the new target using Xcode>Project>UpgradeCurrentTargetForIpad. This created another folder under .../Application Support/iPhone Simulator/4.2/Application/... with a different serial number. The new folder contains a new app, myApp-Upgraded, which corresponds to the bundle path it will use when this target is run.
    I presume it's due to the file path existing in the original app, but not in the upgraded one. The file will be found when the original target is run, either on the device or the simulator, but not when the upgraded target is run on either, but I don't know how to make the upgraded target reference the correct resources.

  • Problem with File Handler and log files

    I'm developing a polymorphic structure for file handling specially for the log file for a server based App... Its working fine except for one thing. The log file that goes into the File Handler comes as a parameter to the class, the problem is that when it writes de file, though it DOES know where it should go, it doesn't do it and it writes the message into some other Log file belonging to another process...
    Does someone know how to avoid this or fix it?? any ideas or tips would be great!!

    Immediately below the Tabs saying "Files" and Assets" is a small box 
    with arrow on the right to show the drop down list.        In the box 
    on the right there's an icon of two networked computers.  Then it 
    says, "ftp://Hill farm Web Site"  which is the name of my website.     
    If I click on the arrows to pull up the drop-down box,  I get four 
    options divided by a line.   Above the line the options are Computer, 
    HD and ftp://Hill farm Web Site.  Below the line it says manage sites.
    Below this is list of files that make up my website in a directory 
    structure.   The header for the first column reads, "Local Files",  
    which appears to be untrue, because the top line in the directory 
    structure below reads,  "ftp://Hill farm Web Site".
    Does this help?
    regards
    David

  • Contracts with Duet and Document Builder

    Dear all,
    does anybody have more detailed information regarding the technical document
    flow / integration in SRM 6.0 for Contract?
    I am esp. looking for the details between Duet, XI, SRM and the Document Builder.
    Duet seems to be only the presentation layer, the contract document itself is
    managed via the Document Builder and saved in SRM.
    Looking forward to your insights / opinion!
    Thanks,
    Claudia

    Hi Anil
    How did you manage this? We also had the same problem in one of our contracts and what we did was that we copied the contracts from the legacy with the full value. That is suppose SAP went live on 1st April, 2009 and the contract was created on 1st January 2009 for a value of suppose 100 USD, with the first billing being done on 1st Jan for 33.33 USD for 4 months. We first created the contract with a validity from 1st Jan 2009 in the new system. We billed it with a billing type that we created that did not actually create new accounting entries as the accounting entries had already been created in the legacy system. In the new system then we recognised the revenue till the go live, so that the actual value remaining of the contract reduced. Then we started the billing plan of the contract from 1st of April 2009 for the remaining amount. So next invoice was created on 1st april for 33.33 USD. Can you share your solution.
    Regards
    Indranill

  • Save as, type files, images, and documents

    Is it possible in flash to embed links to use right click save as for large documents.
    I know that you can open a pdf in another browser but what about a file that you just want people to be able to save and not open.

    If your linked file is zipped, it will be downloaded and not opened.

  • 10/14/2014 - Release - AIR 15 Runtime and SDK - build no. confusion

    the latest release build of AIR15.0  10/14/2014 appears to be exactly the same build as the one released on  10/02/2014
    both downloads give AIR 15.0.0.302 ---  is this an error .... ?
    its all getting very confusing ...
    was expecting a new build number for the latest release 10/14/ , updated docs etc ?

    Sometimes the release version has a later build number than the last beta we received, which in a way can be even worse than if the build is the same. The thing that has caused some confusion is that a few posts here have been answered with "we've fixed that and it will be in the next build", and the next build turned out to be the same as the previous build.
    So, I think the truth is that those things are fixed in the next build that appears on labs, and the release one doesn't count as a new beta build. I don't know when the next labs build will be.

  • Empty File handling and raise alert.

    Hi,
    We have requirement where we are doing file pass through. But client wants PI to raise alert when it receives 0 byte file.
    How can we achieve this using File/FTP/SFTP adapter when we are not reading the actual payload and doing only pass thru?
    Thanks,
    Vertika

    Hi Vertika,
    AFAIK - there is no standard way for pass through interface to raise alert (for empty file). so you need to develop adapter module to raise the alert for empty file.
    Please refer the help page
    Configuring the Sender File Adapter - Advanced Adapter Engine - SAP Library
    Under Handling of Empty Files, specify how empty files (length 0 bytes) are to be handled:
    Do Not Create Message No XI messages are created from empty files.The files are processed according to the selected processing mode.For example, if the processing mode is Delete, empty files are deleted in the source directory.
    Process Empty Files XI messages are created with an empty main payload.The files are processed according to the selected processing mode.
    Skip Empty Files No XI messages are created from empty files.Empty files are skipped and remain in the source directory.

  • NEED HELP about file handling and searching

    Hi guys !!!!!!!!!!!!!!
    A) I need a help from u i wrote this programme to read from the file and assign the lines for the string array.
    import java.io.*;
    public class ReadFile{
    public static void main(String[] args){
    int i;
    BufferedReader file;
    String line() = null;
    String fileName = "xx.txt";
              try {
                   file = new BufferedReader(new FileReader(fileName));
    for(i=1;i<=10;i++){
    line(i)= file.readLine();
    System.out.println(line(i));
    file.close();
              } catch (FileNotFoundException e) {
                   System.out.println("File: " + fileName + " not found.");
              } catch(IOException e) {
                   System.out.println("Error reading data from file: " + fileName);
    the thing is it is compiling but when interpritting it gives the error
    Exception in thread "main" java.lang.NullPointerException in line(i)= file.readLine();
    plese help me on this and
    B) i want to know how to search the string array to find 4 letter words.
    i'm taking the each element which is line(i) one at a time and search it.
    Plese help me on these issues !!!!!!!!!!!!!!!!!!!!!

    You try to create an array with line(i) (as far as i see) but you dont need to keep each line in memory. As far as i understand you just need to process lines sequentially.. (Null pointer exception is thrown because you did not create your array properly!)
    Look at this code:
    http://www.java-tips.org/java-se-tips/java.io/reading-text-from-a-file.html
    You just need to define process method in that code. (and of course try to understand). So as far as i see, you will check for 4-letter words inside process method!
    For detecting 4-character word, you need to extract the words in the line using StringTokenizer:
    http://www.java-tips.org/java-se-tips/java.util/how-to-use-stringtokenizer.html
    Then you can just just use length() method of String class:
    http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html
    And if you need more advanced logic for processing the lines(currently seems to be the length of strings), you may try regular expressions:
    http://java.sun.com/docs/books/tutorial/essential/regex/index.html
    http://www.java-tips.org/java-se-tips/java.util.regex/

  • How do I diable auto compression in cs5? I have tried looking for an option in file handling & and also deleted the preferences file with no luck.

    Please help!

    nataliec76701245 wrote:
    Will that apply to saving psd files as jpegs also?
    Natalie, JPG is a completely different format to PSD, but whereas PSD is loss-less with or without compression (it just takes longer to save with compression) JPG does affect image quality.  But if you use the highest quality settings with JPG, and don't open and save multiple times, you'd be hard pressed to see any problem with JPG images.
    As with so many things, Wikipedia has an excellent page on JPEG compression.
    JPEG - Wikipedia, the free encyclopedia
    I particularly like the sample images towards the end of the article, which demonstrate how the compression works.
    JPEG - Wikipedia, the free encyclopedia
    Image
    Quality
    Size (bytes)
    Compression ratio
    Comment
    Highest quality (Q = 100)
    83,261
    2.6:1
    Extremely minor artifacts
    High quality (Q = 50)
    15,138
    15:1
    Initial signs of subimage artifacts
    Medium quality (Q = 25)
    9,553
    23:1
    Stronger artifacts; loss of high frequency information
    Low quality (Q = 10)
    4,787
    46:1
    Severe high frequency loss; artifacts on subimage boundaries ("macroblocking") are obvious
    Lowest quality (Q = 1)
    1,523
    144:1
    Extreme loss of color and detail; the leaves are nearly unrecognizable

  • Bug in Flash Professional CC when launching debug launcher xml file handle not released

    There appears to be a bug in either Adobe Flash Professional CC, or ADL when launching debug launcher for an AIR application Flash Professional CC automatically generates or updates the XML app descriptor file. The bug is that Flash Professional is not immedately releasing the file handle to the app descriptor XML file.
    This bug was introduced in Flash Professional CC (Windows). It did not occur in CS5.5 or CS5.
    The question is whether this is a bug related to the ADL, or if this bug is related specifically to Flash Professional CC (Windows).
    Either way, where and how do I appropriately report this bug?

    Hi Dharmendra,
    Thank you for the solution. It is not what I expected, but it might look like a solution that "could" be applied.
    There is still one problem with this approach. If I still use a movie with radial gradient within the bitmap, the same exact problem could occur again.
    I was trying to understand if I did something wrong in my code, or it was a bug in the Flash software. I still find weird that I get different results by drawing a movie clip at different positions on a bitmap object. How can the drawing position change if the movie clip is drawn or not drawn? Why does it make mathematical patterns? I guess it has something to do with the precision numbers.
    Meanwhile, I did a few extra tests. I tried a new approach with Blur and Glow effects. That is not exactly what I want, but it seems to create a transparent gradient. I might consider this approach if the basic radial gradient does not work. I also created a gradient transparency circle bitmap in Photoshop that I imported into my movie clip. It worked. So, at the moment I have two solutions that seem to be working.
    I would appreciate if you could investigate the original problem. It looks like there is a problem in the rendering of Flash. Workarounds are fine sometimes, but I do not expect to developer programs on workarounds.

  • "Cannot open resource file" when InDesign CS6 starts.

    I have an Intel Mac Pro running OS/X Snow Leopard.
    When I open InDesign CS6 I get an error "Cannot open resource file", but there is no indication of what file it can't open.
    When I click OK in the dialog box, InDesign opens and appears to be working.
    I am concerned that this may cause a problem as I continue to use it.
    Is there any way I can correct this issue?
    I also have InDesign CS5.5 installed on the same Mac and it runs fine with no resource error.

    I tried uninstalling InDesign, once I figured out how to do that with Creative Cloud that is (it's not an option in the Adobe Application Manager - which I think it should be).
    Anyway, after uninstalling and reinstalling, the error is still there.
    I also tried Peter's suggestion to remove the InDesign Defaults and InDesign SavedData and have them recreated but that didn't work either. I even tried the cmd-ctrl-opt-shift method to delete the preference files and still I get the "Cannot open resource file" error.
    I thought that it was just a glitch since if I click "OK" in the dialogue box InDesign seems to open fine and then even let me open up a document that I had been working on in InDesign CS5.5.
    But ....
    Even though the document opened fine, as soon as I click on a text field, any text field, InDesign crashes.
    I tried three different documents and it does the same thing.
    It didn't crash when I selected a graphic or an embedded pdf but it does as soon as I click on any text field.
    Does that help narrow down what the resource file error is?
    By the way, I can open InDesign CS5.5 just fine (same computer) with no resource file error and it does not crash when I select a text field, so the issue seems to be strictly with CS6.

  • File Handling missing from Import on MacBook Air?

    Hi. I have the latest version of Lightroom on my PC and also my MacBook Air. The PC one is fine. However on the MacBook Air there is a problem with the IMPORT function. File Handling isn't displayed so I can't do such things as smart previews, make a second copy etc. That whole section is totally missing. I am on the Cloud version and have the latest 5.6 installed. Should I reinstall it again or is there some setting I am missing? I have searched all the menus to no avail. Regards Carol

    Hi. I put this post in while waiting for customer support. The problem has been solved. Control click with the mouse in the right side blank area of the import window but up the selections that are available. I selected File Handling and it has now appeared. I hope this information helps someone else. regards Carol

  • Integrate ECC with SRM Document Builder

    Hello SRM Guru,
    We have requirement in our client to Integrate ECC with Only SRM PPS Document Builder Component.
    Here is more detail:
    After creating PO in ECC , User should click some button in the PO Transaction that should launch the document
    builder Webdynpro where they can enter some more questioners then the PDF format or Word format contract will be generated then it should be attached in the PO in ECC.
    Client wanted to use only SRM document builder component. Could you please let me know the possible
    option to integrate ECC and Document Builder.
    Like how to open document builder webdynpro application form ECC and how to transfer PO details to Document Builder
    and finally how to attach the generated contract to PO in ECC.
    Thanks in Advance.
    VJ

    The upload type should be same, for ECC and SRM .. only the datasource need to be changed
    Example:
    If I you want to integrate Contracts from ECC and SRM, The OPM_SOURCES table should be like BELOW
    ECC:
    SOURCE ID  :    SRXCLNT220##ZBBP_TD_CONTR_2
    SOURCE NAME  :  CONTRACTSSRM_DS
    UPLOAD TYPE :  CONTRACTS
    SOURCE TYPE    DS
    SRM
    SOURCE ID :     EXSCLNT220##Z_SADSECC6CONTRACT
    SOURCE NAME :   CONTRACT_DS
    UPLOAD TYPE :   CONTRACTS
    SOURCE TYPE :   DS
    Rgds,
    Raj

  • Changed /etc/redhat-release in 5.3 and 4.7

    Does anyone know why Oracle left the RedHat strings in /etc/redhat-release in the newest rpms for 5.3 and 4.7?
    ex: 5.3 - Red Hat Enterprise Linux Server release 5.3 (Tikanga)
    ex: 4.7 - Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
    These are provided in enterprise-release-5.0.0.17.i386.rpm and enterprise-release-4.3.7.12.i386.rpm respectively as well as in the equivalent x86_64 rpms.
    Is this a bug or a feature? These files used to contain the correct Enterprise Release string in them.

    Let me expand on what Avi has said:
    The correct, reliable way to determine the release information about the current system is to get that information from the RPM package that owns the <tt>/etc/*-release</tt> file, like this:
    $ ls /etc/*-release
    $ rpm -qf --qf="%{VERSION}\n" /etc/*-releaseUnfortunately, many third-party packages do string comparisons on the content of the <tt>/etc/*-release</tt> file of interest and refuse to install or operate if unexpected content is found.
    Often, the <tt>redhat-release</tt> file would be edited to temporarily have the expected content and the third-party product would be happy, but this was just a needless hassle, so OEL5U3 started leaving the <tt>/etc/redhat-release</tt> file unchanged and the <tt>/etc/enterprise-release</tt> file added.

Maybe you are looking for

  • Report Query - Highlighting the cells that have a new value...

    hello all, I have to display a report in alv in web dynpro abap. In that I have to display two fields and both the fields are locations of different months. If the location is different than the previous one then i have to display cell with the new l

  • How to print from Macbook Pro on a Cannon MP610 printer?

    I have recently bought a Macbook Pro, and I have a wireless network set up at home. I have no problems connecting to the internet or the network. But I can't seem to access the printer. I have a Cannon MP610 Printer. This printer is connected to the

  • Delete row from Advanced Table

    Hi, I'm trying to follow the Delete exercise to create a table with delete image for my project. We don't need to have switcher and confirm dialog as exercise does. My table only has three columns: fromDate, endDate and delete. I got issue if I enter

  • Table TOLE Adobe Acrobat reader (PDF)

    All,   Does anybody now how to add Adobe Acrobat reader as an application in table TOLE ? Regards, Michel

  • WLAN Proxy Settings - Saving User Id and Password

    I've looked around on the net but have not been able to find a solution to this problem. Using an N8 (on Nokia Belle), the WLAN settings does not seem to provide any place to specify the username and password for a proxy based network (Note: this is