JarEntry has a size of 0

I am trying to read a few entries from one jar, and add them to another jar. But, when I do, I get an error saying that the size of the entries are 0. Here is my code:
//Read the entries in from the origenal JAR
     List ResourceJarEntries = new Vector();                    
     JarInputStream resourceIn = new JarInputStream(
          new BufferedInputStream(
               new FileInputStream("GeneTreeResources.jar")));
     while (resourceIn.available() != 0){
          JarEntry temp = resourceIn.getNextJarEntry();
          System.out.println(temp);
          if (temp != null){
               System.out.println(temp.getSize());
               ResourceJarEntries.add(temp);
     resourceIn.close();
//Write the resources to a new JAR
     JarOutputStream resourceOut = new JarOutputStream(
          new BufferedOutputStream(
               new FileOutputStream(
                    new File("NewResources.jar"))));
     Iterator origenalEntries = ResourceJarEntries.iterator();
     while(origenalEntries.hasNext()) {
          JarEntry next = (JarEntry)origenalEntries.next();
                //Don't save if they where in the saved_trees directory
          if (next.toString().indexOf("saved_trees") == -1) {
               resourceOut.putNextEntry(next);
     resourceOut.flush();
     resourceOut.close();The output I get from the reading demonstrates that the entries being read don't have a valid size:
male.GIF
-1
papyrus.gif
-1
female.GIF
-1
luke/steve/genetree/Resources.class
-1
saved_trees/Map.xml
-1
saved_trees/MapPanel.xml
-1
saved_trees/TestPanel.xml
-1
saved_trees/testAgain.xml
-1
null
And the Error measage in the putNextEntry just seconds that:
java.util.zip.ZipException: invalid entry size (expected 1925 but got 0 bytes)
If I read some of the JarEntries from the disk I do not get this error for those entries, but I would for every one I read from the other JAR. Any help on how I can get the full JarEntry with proper size from the origenal JAR?
thanks.

A while back I tried to do something similar, I finally got it to work with the following code:
     private final byte[] chunk = new byte[1024 * 1024];
     public void shift(final ZipFile inFile,
                      final File outFile)
          if ((inFile != null) && (outFile != null))
               ZipInputStream zis = null;
               ZipOutputStream zos = null;
               try
                    Manifest manifest = null;
                    final String inFileName = inFile.getName();
                    if (inFileName.endsWith(".jar"))
                         zis = new JarInputStream(new FileInputStream(inFileName));
                         manifest = ((JarInputStream) zis).getManifest();
                    else
                         zis = new ZipInputStream(new FileInputStream(inFileName));
                    if (outFile.getName().endsWith(".jar"))
                         if (manifest != null)
                              zos = new JarOutputStream(
                                        new FileOutputStream(outFile), manifest);
                         else
                              zos = new JarOutputStream(
                                        new FileOutputStream(outFile));
                    else
                         zos = new ZipOutputStream(new FileOutputStream(outFile));
                    ZipEntry entry;
                    String entryName;
                    while ((entry = zis.getNextEntry()) != null)
                         entryName = entry.getName();
                         if (!entryName.equals("MANIFEST.MF"))
                              zos.putNextEntry(entry);
                              int length = 0;
                              while (length > -1)
                                   zos.write(chunk, 0, length);
                                   length = zis.read(chunk, 0, chunk.length);
                              zos.closeEntry();
                         zis.closeEntry();
               catch (Exception ex)
//                    System.err.println(ex.toString());
                    ex.printStackTrace();
               finally
                    closeStream(zis);
                    closeStream(zos);
     }I'll leave it to you to make the neccessary adjustments to fit your specific problem ;-)
The two closeStream methods are trivial: check for null and if not close the stream in an eneveloping try-catch-block.

Similar Messages

  • HP Officejet Pro L7590 (L7555) has legal size flatbed but won't scan legal size documents - WHY?

    HP Officejet Pro L7590 (L7555) has legal size flatbed but won't scan legal size documents - WHY? Scanning to a Macbook Pro osx (10.6)

    Hey there. What application are using to scan? Have you tried using a different application like Preview or Image Capture?
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • REP-1219: 'F_MONTH' has no size -- length or width is zero.

    Dear all,
    I want to create a .lis file through form call report. The statements in form are as below:
    lv_report_id := 'FAR017A';
    P_List := CREATE_PARAMETER_LIST(lv_report_id);
    if :ctl_blk.destype = 'FILE' then
    ADD_PARAMETER(P_LIST,'desformat', TEXT_PARAMETER,'wide180');
    ADD_PARAMETER(P_LIST,'mode', TEXT_PARAMETER, 'Character');
    ADD_PARAMETER(P_LIST,'desname', TEXT_PARAMETER,:global.path || lv_report_id || '.LIS');
    end if;
    ADD_PARAMETER(P_LIST,'destype', TEXT_PARAMETER,:ctl_blk.destype);
    ADD_PARAMETER(P_LIST,'p_company_id', TEXT_PARAMETER,:global.company_id);
    ADD_PARAMETER(P_LIST,'p_goods_no_from', TEXT_PARAMETER,NVL(:ctl_blk.goods_no_from,'00000000'));
    ADD_PARAMETER(P_LIST,'p_goods_name_from', TEXT_PARAMETER,:ctl_blk.goods_name_from);
    ADD_PARAMETER(P_LIST,'p_goods_no_to', TEXT_PARAMETER,NVL(:ctl_blk.goods_no_to,'99999999'));
    ADD_PARAMETER(P_LIST,'p_goods_name_to', TEXT_PARAMETER,:ctl_blk.goods_name_to);
    ADD_PARAMETER(P_LIST,'p_yymm', TEXT_PARAMETER,wrk_c1);
    ADD_PARAMETER(P_LIST,'P_WHERE_CLAUSE', TEXT_PARAMETER,vWhere);
    ADD_PARAMETER(P_LIST,'P_ZONE_CODE_TITLE', TEXT_PARAMETER,:ctl_blk.zone);
    ADD_PARAMETER(P_LIST,'p_cyear', TEXT_PARAMETER,:ctl_blk.accnt_cyear);
    ADD_PARAMETER(P_LIST,'p_month', TEXT_PARAMETER,NVL(:ctl_blk.accnt_period,SUBSTR(TO_CHAR(TRUNC(SYSDATE),'YYYYMM'),5,2)));
    ADD_PARAMETER(P_LIST,'paramform', TEXT_PARAMETER, 'no');
    RUN_PRODUCT(REPORTS, :global.path||lv_report_id||'.rep', SYNCHRONOUS, RUNTIME, FILESYSTEM, P_LIST);
    DESTROY_PARAMETER_LIST(P_List);
    When I press the button to produce the .lis file, I read the message in the report server log:
    Starting report FAR017A [Fri Jul 25 17:06:32 2003] ...
    REP-1219: 'F_MONTH' has no size -- length or width is zero.
    End report FAR017A [Fri Jul 25 17:06:34 2003].
    I have no idea what "has no size" means, does any know how to solve this problem?
    Thanks for your help in advance!!!
    Joseph

    rwconverter.exe is a separate executable(It is rwcon60.exe)
    1.Invoke rwconverter.exe executable.
    2. In the conversion page:
    a. Set document type to Report.
    b. Set Source Type to Report Binary File (RDF).
    c. Set Source to the name of the existing bit-mapped report, example "old.rdf"
    d. Set Destination Type to Report Binary File (RDF).
    e. Set Destination to the name of the new character-mode report, example "new.rdf".
    4. On the options page, set Destination Unit to Character.
    5. Click OK. This will convert the report to character mode repot.
    6. Use this new.rdf in your forms application. You don't need add any parameter. Just make sure you use this new report.
    This should solve the problem. If you still get the error, open the report and resize the field which gives the error.
    Regards,
    Siva

  • Frame has no size - length or width is zero

    Hi to all:
    I've created a character report that works OK without a user parameter. The moment I've created a user parameter (even without puting it in the query) an started report, instead of a report I've got the message:
    "REP-1219: name_of_a_repeating_frame has no size -length or width is zero"
    Does anyone knows solution to my problem ?

    SEGURAMENTE UN FRAME TIENE POCA ALTURA,
    A MI ME HA PASADO LO MISMO,LO QUE HAGO ES QUE LOCALIZO EL ITEM Y LE DOY MAS ALTURA, POR ALGUNA RAZON REPORTS EN MODO CARACTER NO ACEPTA UNA ALTURA CORTA

  • Error: REP-1219: 'Body' has no size

    I've got a runtime error whenever I set 'mode=character' :
    REP-1219: 'Body' has no size -- length or width is zero
    What is 'Body' mean ? Header Section's body ? Main Section's body ? ... ?
    How can I solve this error ?
    Thanks.

    Error:          REP-1219: ‘Body’ has no size – length or width is zero
    Solution:
    Report height changed to 50 solved error REP-1219: ‘Body’ has no size – length or width is zero.
    The property sheet values for ‘Report Width and ‘Report Height under Layout Model Node, ‘Character Mode’, for ‘Header Section’, Main Section’ and ‘Trailer Section all matched in the original version of the report.
    Report Width:           126
    Report Height:      50
    Report height was modified to 45 while making other changes.
    When Report height was changed from 45 , back to the original value of 50 the REP-1219 error was resolved.

  • REP-1219 - frame has no size

    Hi All,
    When I run my report using Report builder 6i, it runs fine whereas I try to run using oracle apps it gives the below error
    "REP-1219: 'M_12' has no size -- length or width is zero"
    As said by one of the users in one of the old thread, i tried converting to rex file and searched for M_12. In it,the height and width was not zero.
    Any help is appreciated

    Hi,
    I did the same setup,my report is completed normal,but not able to get the correct output.
    The output as given below :
    %!PS-Adobe-3.0 %%Creator: Oracle Toolkit 2 for Character-Mode 6.0.8.22.0 PRODUCTION %%Version: 6.0 8 %%CreationDate: (Mon Aug 2 12:31:39 2010) %%For: (([email protected])) %%Title: 'GETRAXINV' (Oracle Toolkit Application) %%LanguageLevel: 1 %%Requirements: numcopies(1) %%DocumentData: Clean7Bit %%PageOrder: Ascend %%Pages: (atend) %%Orientation: Landscape % NOTE: This file was generated with the PPD file default.ppd %%DocumentNeededResources: font Courier font Courier-Bold %%+ font Courier-BoldOblique font Courier-Oblique font Helvetica %%+ font Helvetica-Bold font Helvetica-BoldOblique font Helvetica-Oblique %%+ font Symbol font Times-Bold font Times-BoldItalic font Times-Italic %%+ font Times-Roman %%DocumentSuppliedResources: font Courier-ISL font Courier-Bold-ISL %%+ font Courier-BoldOblique-ISL font Courier-Oblique-ISL %%+ font Helvetica-ISL font Helvetica-Bold-ISL %%+ font Helvetica-BoldOblique-ISL font Helvetica-Oblique-ISL %%+ font Times-Bold-ISL font Times-BoldIta
    can anybody help me to come out this issue.
    Thanks,
    Ashish

  • REP-1219 - Body has no size - width or length is zero

    I run my report on my desktop and it runs fine. I then register it under the Concurrent Manager in Oracle Apps. When I run it, I get the following message: "REP-1219 - Body has no size - width or length is zero". Do you have any suggestions on why I only get this after I register it.

    Hi John,
    I think there is some problem in Report Header Or Report Footer, you do one small R&D. First you remove the Report Header and generate the report and Second Time you remove the Report Footer and generate the report.
    I am sure that you will get the report...
    If you get the report output then that means there is some problem in Report Header or Footer,After that in the Report Header before the Feilds, you keep some Space and in the Report Footer also after feild you keep some space.
    Try This
    Regards,
    Ravi
    [email protected]

  • REP-1219 : 'Body' has no size - length or width is zero

    Hi.
    I am using reports 6i (6.0.8.11.3). There is a report which runs
    successfully, and suddenly after adding some fields to the
    layout, it start giving the error :-
    REP-1219 : 'Body' has no size - length or width is zero
    I have checked everything in the layout and it appears to be
    perfectly fine. In fact i have faced this problem several times
    on Reports 6i.
    Any help?
    Thanks

    There are two sets of circumstances that have caused this error
    for me.
    Firstly, when I have tried to run an .rdf that was written under
    version 2.5 or earlier of reports and I did not use the r25mrep
    executable to migrate the .rdf.
    Secondly, when a report is run in character mode it resizes and
    aligns objects to the nearest point on a grid 'x' characters in
    width and 'y' in height. If an objects top edge gets rounded
    down and the bottom edge gets rounded up, to the same point on
    the grid, then the object has no height or width and the error
    happens.
    Paul

  • ERR REP-1219: 'R_1' has no size -- length or width is zero.

    Hi All,
    Please tell me the solution for my problem..
    I am getting the error ERR REP-1219: 'R_1' has no size -- length or width is zero.
    .... in report builder i am getting the result..
    But in application11i it is giving error..(ERR REP-1219: 'R_1' has no size -- length or width is zero)
    plz Replay me

    try converting it into character mode before running this might help you .
    File>Administration>Convert...(navigation for 6i)
    Tools>File Conversions.... (navigation for 9i)
    1. Select the Source and Destination(preferable take a new location)
    2. Change the Destination Type to .RDF
    3. Switch to Option tab
    4. Change Destination Unit to "Character".
    Rgds...R

  • REP-1219:' Object name ' has no size -- length or width is zero.

    my report has @28 columns in one repeating frame so the horizontal width is long..
    on running the report i am getting following error..
    REP-1219'<Object name>' has no size -- length or width is zero.
    Can somebody help??
    Anu

    no need to delete any frame or any thing else
    just read my post in the following thread
    Re: Apps Error
    hth

  • REP-1219: 'MAIN_GRPFR' has no size -- length or width is zero.

    Hi ,
    I am working in reports 6i.I have a problem in character reports .I am modifying old character reports that is i am adding new data at the end.In my old report the report was extended to 154 vertically now i added some data and it increased to 200
    The report running fine in report builder but when i am trying to run the report in unix it is throwing an error
    REP-1219: 'MAIN_GRPFR' has no size -- length or width is zero.
    if the length is reduced from 200 to 154 it is running fine.Do i need to modify any properties of report height and width.
    report height =66
    width=120 in old one
    Really urgent ...
    Thanks in advance

    rwconverter.exe is a separate executable(It is rwcon60.exe)
    1.Invoke rwconverter.exe executable.
    2. In the conversion page:
    a. Set document type to Report.
    b. Set Source Type to Report Binary File (RDF).
    c. Set Source to the name of the existing bit-mapped report, example "old.rdf"
    d. Set Destination Type to Report Binary File (RDF).
    e. Set Destination to the name of the new character-mode report, example "new.rdf".
    4. On the options page, set Destination Unit to Character.
    5. Click OK. This will convert the report to character mode repot.
    6. Use this new.rdf in your forms application. You don't need add any parameter. Just make sure you use this new report.
    This should solve the problem. If you still get the error, open the report and resize the field which gives the error.
    Regards,
    Siva

  • REP 1219 object has no size error? when using a character report

    REP-1219 'Margin' has no size- length or width
    I searched on metalink, otn, and dejanews for this. I saw a variety of responses none are helpful. I am a forms person and do not know reports well.
    This error happens when I try to change a report to character mode. My client wants to be able to view reports in excel. To do this, I need to change them to client mode.
    I read places that I am supposed to change the font of all objects to fix this? How? I brought up the layout model. Clicked select and changed the font and size. Did not help?
    How do I resize objects in report? I look in the property pallete of items under 'Margin' and I dont see any properties for size. I go to the layout model and try to size things and I cannot drag anything.
    I tried using the convert utility that someone recommended. This did not work.
    Please be thorough in your explanation and understand that I have read the existing notes about this problem.

    Hi Ryan,
    Firstly you should understand that Reports is a bitmapped reporting tool (think 600-1200 dots per inch laser printer), so when you run under character mode, Reports is taking objects that are sizable to the laser printer pixel and mapping them onto a much, much less granular character grid (e.g., 70x54 grid). So, a report designed for bitmapped may have many objects where after rounding to the character grid the object ends up being a line or single point in the character grid, making it have zero size...and you get the error when that happens.
    You can see how your report looks in the character unit grid by following the steps in the help topic "Setting properties for an ASCII (character-mode) report". You'll want to adjust your layout objects to snap to the grid points of the character grid. You'll also want to use a font that comes closest to the character grid; you can do an Edit->Select All, and then choose, say, Courier, Regular, 12 point.
    To get to the objects in the margin area of the report, choose View->Layout Section->Edit Margin. This will put the layout editor in a mode for manipulating only the margin objects. You can see the objects in the body area of the report, but you can't edit them. Then click this menuitem again to go back to editing the objects in the body of the layout.
    Hope this helps...
    regards,
    Stewart

  • REP-1219 'M_G_TITLE_GRPFR' has no size--length or width is zero!!!!

    REP-1219 'M_G_TITLE_GRPFR' has no size--length or width is zero!!!!
    Hi,
    My report runs fine in default or bitmap mode. However, when I run it in character mode i got REP-1219 error message.
    Using the report layout, I increase the size of 'M_G_TITLE_GRPFR' but it still gives me the same error.
    Thanks,
    null

    Did you also try increasing the size of the items inside the group?

  • Can i get a print out of a report output which has LINE-SIZE = 400?

    Hello everybody,
    I have a task where in the output of a report which has LINE-SIZE = 400 needs to be printed.
    can i get a printout out directly in LANDSCAPE or do i need to write some code to get to the result?
    Please do suggest me.
    Helpful answers will surely b rewarded.
    Thanx in advance,
    Sanghamitra.

    Thanx one and all for your quick and prompt replies.
    Now is there any other way of priniting a report of line-size 400 on a fairly large paper ,other than using smart forms.
    Please do suggest.
    Thanx in advance,
    Sanghamitra.

  • Datapump: cloning schema, target has multiple size. How to solve?

    Hi all,
    I am quite unfamiliar with dataump - i've used imp / exp before.
    Now I need to clone a schema and have to remap the tablespaces. The forum advised me to use datapump but now I have some problems with it:
    source schema name: DEV_6
    target schema name: TESTUSER
    I checked the size of the schemas with the following statement:
    select owner, sum(bytes)/1024/1024 tsize
    from dba_segments
    group by owner
    order by tsize desc;
    My source (DEV_6) has the size of 4GB.
    After importing the target (TESTUSER) has a size of more than 32GB (import is still running)
    I exported the schema with following statement:
    expdp DIRECTORY=DATA_PUMP_DIR DUMPFILE=DEV_6.expdp LOGFILE=DEV_6_exp.log SCHEMAS=DEV_6
    For importing and remapping schema and tablespace I used the following statement:
    impdp LOGFILE=TESTUSER_imp.log REMAP_TABLESPACE='AMES_DEV_PERM':'TESTUSER_PERM','DEV_TRUNK_DATA_XXL':'TESTUSER_PERM' REMAP_SCHEMA='DEV_6':'TESTUSER' SCHEMAS='DEV_6' DIRECTORY=DATA_PUMP_DIR DUMPFILE=DEV_6.expdp
    We are using 11.2.0.1.
    Any ideas how to solve this problem?
    Thanks in advance,
    Andreas
    Edited by: Andreas S. on 07.09.2012 03:21

    Hi,
    I think I found the problem:
    The definition of the tablespaces differs:
    TABLESPACE_NAME BLOCK_SIZE INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_SIZE ALLOCATION_TYPE
    TABLESPACE_ORG 8192 65536 null 1 null SYSTEM
    TABLESPACE_NEW 8192 131072000 131072000 1 2147483645 SYSTEM
    Andreas

Maybe you are looking for

  • Checkbox cell factory + Tableview

    I'm writing a JavaFX client for my soap service, and of my fxml pages must contain a fully-editable TableView, which consists of Product-class entities.My table consists now of 2 text columns and one, which consists of Double values.I want to add a s

  • Why i can't send "MAIL FROM:"?

    i wonder why i failed to send "MAIL FROM:" while commnunicating with the server using SMTP protocol? my code is: socket = new java.net.Socket(strServer, 25); dis = new java.io.DataInputStream(socket.getInputStream()); dos = new java.io.DataOutputStre

  • Calendar weeks start on monday

    is anyone else having weird small problems like my calendar week starts on monday (all my other calendars are set to start on sunday) and i cant find any setting on my phone to change this. also i'm not sure how long its been like this but i recently

  • [RESOLVED]NF980-G65 Hang on windows 7 install. Unable to boot

    Hello, I'm a bit at wit's end here.  My old non-MSI motherboard was failing and giving me loud beep errors, so I decided to replace it.  In doing so I was required to update basically the whole computer in order to keep up with tech trends and my new

  • .zip files??

    does ae cc support .zip files??