You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/04/14 11:14:38 UTC

[Bug 63346] New: Xlsx corrupted on IBM server

https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

            Bug ID: 63346
           Summary: Xlsx corrupted on IBM server
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: vsz43919@cndps.com
  Target Milestone: ---

Created attachment 36526
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36526&action=edit
File corrupted

On ibm server, the xlsx is corrupted. From back end string base 64 to Fe where
is decode and downloaded in jsp

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #6 from Andreas Beeker <ki...@apache.org> ---
Ok, let us ignore the AJAX client for now - we need to stay on the server
first. You can write to a temp folder on the testing server.

For now I assume the file is invalid on the server.

The difference can be the loaded classes.

Please check the following for classpath issues:
https://stackoverflow.com/questions/4925901/classcastexception-while-parsing-xml-with-weblogic

Also try to set the classloader order to parent last:
https://stackoverflow.com/questions/31583968/how-to-specify-order-of-jar-class-loading-in-weblogic

IIRC you can activate a jar browser in the management console of weblogic to
check for duplicated jars - please check that too.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
             Status|NEW                         |NEEDINFO

--- Comment #1 from Andreas Beeker <ki...@apache.org> ---
Please try with POI 4.1.0 first, usually we don't even try to find out, what
the problem in old versions of POI were.

The corrupt file is a truncated zip (... .xlsx is a .zip) - without knowing the
your webapp, my guess would be, you are closing the stream to the browser to
early.

What you could try is to save the worksheet locally on the server. If this file
is corrupt, it might be POIs problem (use 4.1.0!) ... if not, your servlet
logic is faulty.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

--- Comment #4 from Alex <vs...@cndps.com> ---

On Development server my code works. The problem is on IBM testing server where
i have a corrupted xlsx. On IBM server I can only deploy the war on weblogic
On development server i also use weblogic . 

In Front End 

function base64ToArrayBuffer(base64) {
var binaryString = window.atob(base64);
var binaryLen = binaryString.length;
var bytes = new Uint8Array(binaryLen);
for (var i = 0; i < binaryLen; i++) {
   var ascii = binaryString.charCodeAt(i);
   bytes[i] = ascii;
}
return bytes;
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Andreas Beeker <ki...@apache.org> ---
I see two issues here:

- you haven't reacted to what I've requested, i.e. saving to a file (instead of
the ByteArrayOutputStream). This is just temporarily for testing, to assist in
finding the problem. you can use the ByteArrayOutputStream.writeTo() method to
forward to the FileOutputStream

- how do you handle a base64 encoded JSON String? when saving the file on
client/browser side, this might lead to further errors. Is it really necessary
to handle this in an AJAX call ... or can't you simply return a byte stream of
content-type "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
" and leave the handling to the browser?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Dominik Stadler <do...@gmx.at> ---
I don't think this is really caused by Apache POI itself. If you still have
this problem, please create a more isolated test-case which allows to see where
the problem is actually happening.

As there was no response for some time we are closing this as INVALID for now. 

Please work on a more narrowed down test-case if you want us to continue
investigation.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

--- Comment #5 from Alex <vs...@cndps.com> ---
or can't you simply return a
> byte stream of content-type
> "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
> " and leave the handling to the browser?


Sorry for my second message. I also tried to return a byte stream but i have
the same problem. I made many attempts :( Thanks you so much and sorry for my
english

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

Alex <vs...@cndps.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

Alex <vs...@cndps.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63346] Xlsx corrupted on IBM server

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63346

--- Comment #2 from Alex <vs...@cndps.com> ---
In Back end:

ByteArrayOutputStream fileOut = new ByteArrayOutputStream();
workbook.write(fileOut);                        
fileOut.flush();
 byte[] ba = fileOut.toByteArray();     
String encoded = DatatypeConverter.printBase64Binary(ba);

fileOut.close();
workbook.close();                       

res.setJSonObject(encoded);

return res;

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org