Reading zip into a IOStream or so....

Hi!
I'm trying to read a zip file and then transform the data to base64 so that i can send it via soap to the client (i'm programming the server side).
BUT i've got problems (that's why i'm here). I can't read the zip file without problems.
I think that the proper way to read the zip file and to convert it to base64 is via InputStream or something similar. Or am i totally mistaken?
Please reply!

             String inFilename = "webpages.zip";
                 ZipInputStream in = new ZipInputStream(new    
                                                                  FileInputStream(inFilename));That's not a solution.
Also when i try to read the compressed data via inputstream or bufferedinputstream i get a crash of the program and the computer keeps beeeeeeeeeeeeeeping... So...????
Converting data to base64 is easy :)
* A utility class to convert to and from base 64 encoding.
public class Base64 {
    final static String encodingChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
     * Returns the base 64 encoded equivalent of a supplied string.
     * @param source the string to encode
    public static String encode( String source ) {
        char[] sourceBytes = getPaddedBytes( source );
        int numGroups = (sourceBytes.length + 2) / 3;
        char[] targetBytes = new char[4];
        char[] target = new char[ 4 * numGroups ];
        for (int group = 0; group < numGroups; group++) {
            convert3To4( sourceBytes, group*3, targetBytes );
            for (int i = 0; i < targetBytes.length; i++) {
                target[ i + 4*group ] = encodingChar.charAt( targetBytes[i] );
        int numPadBytes = sourceBytes.length - source.length();
        for (int i = target.length-numPadBytes; i < target.length; i++) target[i] = '=';
        return new String( target );
    private static char[] getPaddedBytes( String source ) {
        char[] converted = source.toCharArray();
        int requiredLength = 3 * ((converted.length+2) /3);
        char[] result = new char[ requiredLength ];
        System.arraycopy( converted, 0, result, 0, converted.length );
        return result;
    private static void convert3To4( char[] source, int sourceIndex, char[] target ) {
        target[0] = (char) ( source[ sourceIndex ] >>> 2);
        target[1] = (char) (((source[ sourceIndex   ] & 0x03) << 4) | (source[ sourceIndex+1 ] >>> 4));
        target[2] = (char) (((source[ sourceIndex+1 ] & 0x0f) << 2) | (source[ sourceIndex+2 ] >>> 6));
        target[3] = (char) (  source[ sourceIndex+2 ] & 0x3f);
     * Returns the plaintext equivalent of a base 64-encoded string.
     * @param source a base 64 string (which must have a multiple of 4 characters)
    public static String decode( String source ) {
        if (source.length()%4 != 0) throw new RuntimeException( "valid Base64 codes have a multiple of 4 characters" );
        int numGroups = source.length() / 4;
        int numExtraBytes = source.endsWith( "==" ) ? 2 : (source.endsWith( "=" ) ? 1 : 0);
        byte[] targetBytes = new byte[ 3*numGroups ];
        byte[] sourceBytes = new byte[4];
        for (int group = 0; group < numGroups; group++) {
            for (int i = 0; i < sourceBytes.length; i++) {
                sourceBytes[i] = (byte) Math.max( 0, encodingChar.indexOf( source.charAt( 4*group+i ) ) );
            convert4To3( sourceBytes, targetBytes, group*3 );
        return new String( targetBytes, 0, targetBytes.length - numExtraBytes );
    private static void convert4To3( byte[] source, byte[] target, int targetIndex ) {
        target[ targetIndex  ]  = (byte) (( source[0] << 2) | (source[1] >>> 4));
        target[ targetIndex+1 ] = (byte) (((source[1] & 0x0f) << 4) | (source[2] >>> 2));
        target[ targetIndex+2 ] = (byte) (((source[2] & 0x03) << 6) | (source[3]));
}

Similar Messages

  • Reading ZIP/GZIP files from a FileChannel (NIO)

    I need to read/unpack a zip file given a FileChannel as part of a multi-task process. I've played around with extracting ZIP archives using ZipInputStream (FileInputStream) and ZipFile (File),
    but neither one of those will take a FileChannel. I don't have access to the original FileInputStream that the FileChannel was taken from.
    If someone could tell me a good way (or at least ANY way) of reading ZIP from a FileChannel, I would greatly appreciate it.

    ChannelInputStream doesn't seem thread-safe, unless I am doing something wrong. It seems it messes with the actual FileChannel, for example - running a single iteration
    of unpackZIp on a non-zip file (was my mistake, but works as test data) results in FileChannel.position() = 30, when it should be 0. Also, closing ChannelInputStream
    also closes FileChannel.
    I have another worker I run if the FileChannel given to me is actually an image that resamples the image and compresses it. I use
    com.sun.media.imageio.stream.FileChannelImageInputStream for it, and it works flawlessly - I can run as many threads as I want at the same time without
    running into any problems. However, when using ZipInputStream(ChannelInputStream), I can run neither another Zip decompression task nor image compression
    task in parallel (off the same FileChannel).
    Do you know any thread-safe ways of handling FileChannel -> Zip?

  • How to read zip file

    How to read zip file

    Zip files are not files you read. They are compressed archives containing other files. There are many utilities available for iOS that will expand zip files into its component files. I believe Documents by Readdle will expand zip files.
    However, if these zip files are attached to a pdf, I am unsure if Documents will do that. Reader and Acrobat will not open zip attachments on Macs and PCs as a security precaution.

  • Error reading zip file in Java 6

    We have a bespoke installer program that fails, intermittently, in Java 6 on Windows. After installing some files, it then fails with a stack trace like this:
    java.util.zip.ZipException: error reading zip file
         at java.util.zip.ZipFile.read(Native Method)
         at java.util.zip.ZipFile.access$1200(ZipFile.java:29)
         at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:447)
         at java.util.zip.ZipFile$1.fill(ZipFile.java:230)
         at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at com.XXXX.trent.installer.Installer.writeStreamToFile(Unknown Source)
         at com.XXXX.trent.installer.Installer.installFile(Unknown Source)
         at com.XXXX.trent.installer.PatchFileInstaller.installFile(Unknown Source)
         at com.XXXX.trent.installer.PatchFileInstaller.installFiles(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller$TpfAction.run(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller.runActions(Unknown Source)
         at com.XXXX.trent.installer.UpgradeInstaller.install(Unknown Source)
         at com.XXXX.trent.installer.TrentInstall$SoftwareInstallStage.install(Unknown Source)
         at com.XXXX.trent.installer.TrentInstall$UpgradeInstallWorker.install(Unknown Source)
         at com.XXXX.trent.installer.PatchInstall$InstallWorker.construct(Unknown Source)
         at com.XXXX.trent.utils.SwingWorker$2.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:619)The same code works in Java 5 on the same environments that it now fails in Java 6 (1.6.0_16).
    Any ideas?
    Thanks.

    gimbal2 wrote:
    it is not weird, it is a bug in the application. Don't let the upgrade from Java 5 to Java 6 make you believe otherwise.It's a singularly bad exception message though. I would have thought that something from java.util might be a bit more explicit about what the problem is.
    Winston

  • Is it possible to export data from a PDF in Reader XI into an xfdf file?

    Hello,
    I am new to the forum and to Adobe Acrobat.  Please bear with me as I explain what I need to do and what I have tried to do so far to accomplish this (based on reading numerous forum discussions and Adobe IAC/JavaScript manuals).
    Operating system, Adobe and Microsoft products on my standalone PC:
         OS:  Windows 7 Professional
         Adobe:  Adobe Acrobat Pro XI
                       IAC Software (free download)
                       Adobe Reader XI
        Microsoft: VisualStudio 2010 (VB.NET and C#.NET)
    I need to export the data from a fillable PDF in Acrobat Reader XI into an .xfdf file that will allow me to pull the field data out of the .xfdf  (xml-type) file and use it in a C# program.  I tried using exportXFDF as a trusted function not knowing initially that Acrobat Reader XI will allow you to import, but not export.  Is there any workaround for this problem?
    Using the IAC I was able to write a program that allowed my to save the data in a fillable PDF in Acrobat to an xml-type file; however, that only worked when my executable was running on a PC that had Acrobat installed (not Acrobat Reader).  I need to be able to do this out of Acrobat Reader XI, and we do not want to use Adobe LiveCycle to do this. 
    I feel like there is something very obvious that I am missing here.
    kfreema7

    I hope you won't see this as rude, but what you are missing is the obvious point that Adobe are in business to make money. So they put as little in Adobe Reader as they can, so people are motivated to buy stuff. Every development intended for Reader has severe limitations on feasibility and techniques for this reason; it's a huge (but very common) mistake to just develop for Acrobat and assume Reader will follow.

  • How to read ZIP from Source System

    Hi frnds,
    In my sender side i have Zip file, I need to read from source directory, File adapter will provide option to read Zip file??
    if i want to generate out put in ZIP format is it possible??
    tell me what are necessary steps required??
    Regards
    Raj

    Hi Raja,
    All the steps will be same as a file to file scenario. Nothing new except that you need to configure your sender channel as mentioned in the blog that i asked you to refer. Then you just put your file with extension .zip in the source directory. This is in case you dont need to process data(no mapping required).
    In case you do not need to create a mapping(just transfer data from one place to another), you can directly configure your scenario. No need to do anything in the IR.
    Hope it makes it clearer.
    Thanks and Regards,
    Sanjeev.

  • I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

    I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

    Hello,
    You mention that you send a string to the microprocessor that tells it how many bytes to send. Instead of requesting 512 bytes, try reading 10 times and only requesting about 50 bytes at a time.
    If that doesn�t help, try directly communicating with your microprocessor through HyperTerminal. If you are not on a Windows system, please let me know. Also, if you are using an NI serial board instead of your computer�s serial port, let me know.
    In Windows XP, go to Start, Programs, Accessories, Communications, and select HyperTerminal.
    Enter a name for the connection and click OK.
    In the next pop-up dialog, choose the COM port you are using to communicate with your device and click OK.
    In the final pop
    -up dialog, set the communication settings for communicating with your device.
    Type the same commands you sent through LabVIEW and observe if you can receive the first 54 bytes you mention. Also observe if data is returned from your 512 byte request or if HyperTerminal just waits.
    If you do not receive the 512 byte request through HyperTerminal, your microprocessor is unable to communicate with your computer at a low level. LabVIEW uses the same Windows DLLs as HyperTerminal for serial communication. Double check the instrument user manual for any additional information that may be necessary to communicate.
    Please let me know the results from the above test in HyperTerminal. We can then proceed from there.
    Grant M.
    National Instruments

  • Read statement into an internal table

    Hi Experts,
    In my report i have several read statements, now my requirement is i want to put all the read statements into an internal table, how do i achieve it???
    Thank you!

    Hello Maya,
    i want to know how many number of times the read statement is used .
    Two ways:
    1. use a counter after each read statement in your program and increase it by 1 everytime there is read statement and display the final value of the counter in the report that you want.
    2. If you just want to know press (CNTRL + F) enter "READ" , select the radio button "In Main program" and then you will get all the read statement and can count it manually.
    Hope I have not answered your question wrong. But if I have, please be more specific about your requirement so that many an help you.
    Thanks,
    Jayant Sahu.

  • Webdynpro reading context into table

    Hi Guy,
    I havent been able to find anything on this but I am assuming its a very common questions. I apologise in advance.
    My question below:
    I have a context 0..n
    I would like to read this into table type t1.
    Context and table are base on the same structure.
    I understand I have to use get_static_attributes_ref or table. But I am not sure how to go about getting it and then casting it into type t1
    Thanks in advance.
    Moderator message: please post again in "Web Dynpro ABAP" forum
    Edited by: Thomas Zloch on Oct 28, 2010 3:03 PM

    hi Nir..
    may be you shud use the HSSF api.....
    try this link....
    <a href="http://www.koders.com/java/fid5636164FDE72156B90C9973AC12EBBF49048BA4E.aspx">HSSF_API</a>
    Regards,
    Sudheer

  • Suddenly, most of my folders that I separate the read emails into dissappeared. How to get back?

    In Thunderbird just now most of the folders that I put my read emails into have disappeared. All the old messages are in them . I need them and the folders too. I don't know what I did to make them disappear. Please help. Thanks.

    this is a follow up from the profane post earlier....
    i have done this twice in two other posts..
    here is my problem.. i started off trying to update itunes, it failed twice and said i needed to install manually via tools.
    the only place to get to tools is the pop up box that appears when you click check for updates.. if there is an available update then the pop up shows up with the quick time and itunes files to download. so i finally figured that out. i clicked on tools and manual update, four files were saved to a file. Apple mobile device support, another one similar, itunes, and another one i cant remember. I only downloaded the itunes file seeing as though thats all i needed to accomplish in the first place.
    so then i restarted my computer bc you need to reboot and then reopen itunes for update to take effect. once i have itunes back open i plugged in my new 5s which i am trying to sync to my computer to get all my stuff back bc i lost my previous phone over the weekend.. once i plugged the phone in an error stating i needed to unistall the apple mobile device support and itunes and then reinstall. well i dont know where those files were originally stored on my computer AND since my itunes was updated, just not the other 3 associated files, when i click check for updates it says its up to date and then pop up containing the quick time and itunes does not pop up thus i cant get back to the tools tab to manually save the 4 files again.
    so i was just going to uninstall itunes all together and then i thought well what happens if it erases all my photos apps songs etc... which would defeat the whole purpose in the first place of me trying to sync my new phone to get all my stuff back.
    so i literally have no idea what to do at this point.. if you have read this you are probably just as confused as me...

  • Urgent help on reading data into ByteBuffer

    Hi,
    I am trying to read data into ByteBuffer using SocketChannel.
    The following code working fine but the problem is with ByteBuffer size.
    The data varies from request to request .
    How do I read data into ByteBuffer with out specifing size .
    The problem with size is some records has more than 500 bytes and some are less than 500 bytes.
    I want to read all the data .. ( even if it has more than 500 bytes ..)
    How do i solve this problem ..
    Is there any way to read data dynamically from socket channel ...
    Any help on this please ...
    The data I have to read is in the following format ..
    XXX ... yyyyy
    AAA
    BBBBBBBBBBBBBBBBBBBBBB
    CCCCCCCCCCCCCCCCCCCC
    DDDDDDDDDDDDDDDDDDDDDDd
    etc ...
    Here is my Code:
    public ByteBuffer getResponse(byte[] request) throws Exception {
    int lenth = 500;
    InetSocketAddress isa = new InetSocketAddress("ip", port);
    SocketChannel channel = SocketChannel.open(isa);
    ByteBuffer requestBuffer = ByteBuffer.wrap(request);
    channel.write(requestBuffer);
    ByteBuffer responseByteBuffer = ByteBuffer.allocate(length);
    int num = 0;
    while (num == 0 ) {
    responseByteBuffer.rewind();
    num = channel.read(responseByteBuffer);
    channel.close();
    return responseByteBuffer;
    Thanks.

    Two possible solutions
    1. Read in as many bytes as you can until you hit the EOS OR you fill the byte buffer. If you fill the buffer (try checking for BufferUnderFlowException), you could move the read bytes into a dynamically allocated memory Collection such as an ArrayList. When you hit the EOF, you could then do whatever else you need to do from then on.
    2. I use this option: Implement a site local protocol for transmitting data. Provide a header first containing 2 ints (compressed size, uncompressed size - so you can also use compression when sending), and send the remainder as a payload.
    Therefore
    Read in the header first (always 8 bytes)
    Then extract those integer values. They will tell you how much is being sent. Set you byte buffer for the payload to be the correct size for this transmission.
    Reset and wait for next connection

  • Program to read zip files???

    im looking for a program to read zip files?Is this even possible on a mac? Im running 10.4.11 on my ibook g4

    Hello,
    What you need is a program that can OPEN .zip files. Go here: http://my.smithmicro.com/mac/stuffitexpander/index.html
    Download the free installation and just follow the instructions to open .zip files.
    Carolyn

  • Problems on reading PCM into digital form

    Hi,
    I'm now on a project doing heart rate detection.
    Due to the project just started, therefore I do not got any device to measure my own heart rate, but I will be making up some PCM(analog) data, and try to read that into digital form and give me results of the heart rate.
    I'm not sure am I on the right track now or not,
    what I'm doing now is trying to convert a ".wav" into bytes array, then it should give me some data, however, I'm not sure how to relate that data into heart rate.
    Please leave me any comment if u think it might help please.
    Thanks,
    till

    I'm not too sure what should be the .wav should be, however, according to this acticle I got it from the web:
    _2.1 Signal acquisition_
    ECG signal frequency content lies between about 0.05Hz and
    500Hz and has amplitude of few mV. The acquisition is provided
    to be performed in three different ways: (i) using direct electrode
    measurements, (ii) using ECG equipment with analogous output;
    and (iii) using ECG equipment with digital output. For the first
    two cases, a sampling rate of 8 kHz is assumed. In the third case,
    the acquired discrete signals are accordingly resampled.
    _2.2 Modulation_
    The bandwidth of the phone’s voice channel is limited to the
    range 300Hz-3300Hz. The signal amplitude at the microphone
    input should not exceed 100mV. Modulation is performed through
    multiplication with carrying sinusoidal signals. Five 500Hz-wide
    channels are packed within the 500Hz-3000Hz band. The
    resulting signal is appropriately refined in amplitude and directed
    to the modulator’s output.
    _2.3 Digitizing, storing and sending_
    The complex signal is band-limited to 3300Hz. Therefore, a
    standard sampling frequency of 8 kHz is used for its digitization.
    A JAVA application performs that and in order to store the signal
    intact, the signal is recorded in a lossless format such as pulsecode
    modulation (PCM). The WAV audio file format implements
    PCM and is used to store the recorded modulated ECG signals.
    Once stored, the signals can be visualized, processed and sent by
    the mobile phone.
    Mobile phone’s firmware is accessible by programming
    languages as C++ and JavaTM. Most mobile phones support
    JavaTM runtime called Kilobyte Virtual Machine (KVM) [6]. This
    language provides the ability to build a GUI application that could
    support all the stages of recording, storing and transmitting of the
    ECG signal. JSR-135 contains libraries of JavaME, which are
    useful for capturing audio from the microphone's port of a mobile
    phone. The above mentioned platform was used to create the
    application software.
    _2.4 Demodulation_
    The procedure of demodulation is performed at the physician’s
    phone, following the reverse track of modulation. A digital band
    pass filter is used to separate the spectra, corresponding to the
    individual ECG signals. The filtered signal was then multiplied by
    the corresponding carrier frequency and filtered with a low pass
    filter, resulting in the original signal. The demodulated signals can
    be stored in separate WAV files in the physician’s phone.
    _2.5 Matlab simulations_
    In order to prove the principal feasibility of the approach, the
    signal acquisition, processing and transmission procedures were
    simulated in MATLAB. Five preliminary recorded ECG signals
    were directly loaded and used. The signals acquisition parameters
    were: 8-bit values, sampling rate of 250Hz and duration – 10S.
    Modulation and demodulation were programmed and performed
    in a numerical way. Modulation was done by multiplication of the
    ECG signals with carrying sinusoidal signals of frequencies
    500Hz, 1000Hz, 1500Hz, 2000Hz, and 2500Hz. The
    demodulation included first separating the spectrum of each
    individual signal with the help of 4-th order 400Hz-wide bandpass
    Butterword filters centered on the corresponding carrying
    frequency. Next the filtered signals were multiplied with the same
    carrier signals and eventually filtered with a low pass 4-th order
    Butterworth filter (fc=200Hz).
    btw, the system need to be implement into Symbian phone at the end,
    but I'm just now testing on the PC atm =)
    according to this article, what kind of wav I should be using ??
    thanks a lot!!!

  • Error reading zip file containing an excel file

    Hi all,
    Using servlets I am able to zip an excel file using java.util.zip package. The excel file is created using POI API.
    While I save and extract the zip file on my machine and then open the file in MS Excel. Excel pops a message saying "MS Office Excel has encountered a problem and need to close" and it gives me an option to "Recover my work and restart MS Office Excel". I select the option and then MS Excel does a document recovery and I am able to view my data. I get an excel repair log file saying as follows
    "Microsoft Office Excel File Repair Log
    Errors were detected in file 'C:\Documents and Settings\JohnDoe\Desktop\excel\test.xls'
    The following is a list of repairs:
    Damage to the file was so extensive that repairs were not possible. Excel attempted to recover your formulas and values, but some data may have been lost or corrupted.
    I have attached my servlet code down below I suspect there is a problem with PrintWriter to output or do I need to use OutputStream to write excel data.
    Below is my servlet code:
    import java.io.*;
    import javax.servlet.*;
    import org.apache.log4j.Logger;
    import java.util.*;
    import java.util.zip.*;
    import java.net.*;
    import org.apache.poi.hssf.usermodel.*;
    import org.apache.poi.hssf.record.*;
    import org.apache.poi.hssf.util.*;
    public class ZipServlet extends HttpServlet {
         * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest,
         * javax.servlet.http.HttpServletResponse)
         public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
              makeZip(request, response, "GET");
         * @see javax.servlet.http.HttpServlet#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
                   makeZip(request, response, "POST");
         public void makeZip(HttpServletRequest request, HttpServletResponse response, String methodGetPost) {
              Logger logger = Logger.getLogger(ZipServlet.class);
              try
                   int id=1;
                   ServletContext sc = getServletContext();
         HttpSession session = request.getSession();          
                   ConnectionPoolManager cpm = (ConnectionPoolManager)sc.getAttribute("CONNECTION_POOL_MANAGER");
                   ConnectionPool cp = cpm.getConnectionPool(id);
              createTestExcelZip(request,response,methodGetPost,session);
              } catch (Exception e2) {
         public void createTestExcelZip(HttpServletRequest request, HttpServletResponse response,
                   String methodGetPost,HttpSession session
                   )throws ServletException, IOException
              Logger logger = Logger.getLogger(ZipServlet.class);
              try
              {      //Create an Excel Workbook and placing value "Test" in the first cell
                   HSSFWorkbook wb = new HSSFWorkbook();
                   HSSFSheet sheet = wb.createSheet("new sheet");
                   HSSFCell cell=null;
                   HSSFRow row = sheet.createRow((short) 0);
                   short column = 0;
                   cell = row.createCell(column);
                   cell.setCellValue(new HSSFRichTextString("Test"));
                   HSSFCellStyle fontStyle = wb.createCellStyle();
              HSSFFont f = wb.createFont();
              f.setFontHeight((short) 200);
              f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
              fontStyle.setFont(f);
              cell.setCellStyle(fontStyle);
              response.setContentType("application/zip");
                   response.setHeader("Content-Disposition","attachment; filename=zipExcelRecordFiles.zip;");
                   int BUFFER = 2048;
                   byte buf[]=new byte[300000];
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   ZipOutputStream zos = new ZipOutputStream( baos );
                   ByteArrayInputStream is = null;
                   BufferedInputStream origin = null;
                   byte[] b = null;
                   String fileName = null;
                   b = wb.getBytes();
                   fileName = "testExcelRecords.xls";
                   try
                   is = new ByteArrayInputStream(b);
                   origin = new BufferedInputStream(is, BUFFER);
                   zos.putNextEntry(new ZipEntry(fileName)); // Add ZIP entry to output stream.
              int count;
              while((count = origin.read(buf, 0, BUFFER)) != -1)
              zos.write(buf, 0, count);
              zos.closeEntry(); // Complete the entry
                   is.close();
                   }catch(Exception e)
                        logger.error(e);
                   zos.close();
              PrintWriter pr = response.getWriter();
                   pr.write(baos.toString("ISO-8859-1"));
                   pr.close();
              catch(Exception e)
              logger.error(e);     
         * @see javax.servlet.GenericServlet#destroy()
         public void destroy() {
    Any help would be appreciated.
    Regards
    jdcunha

    Jdcunha,
    I am new to the field but encountered the same problem and recently found a solution. Hope this helps.
    For my project I wanted to create individual Excel 2003 workbooks for each file I created. Excel would give me the same error it gave you when I used the same HSSFWorkbook object. I tried creating a new Workbook object each time, but ran into the same issue.
    I ended up fixing the error by creating a new instance of my write-to-excel class each time I wanted to create a new workbook, instead of just recreating a new HSSFWorkbook object. It works perfectly and the Excel errors don't show. It may also be important to note I used OutputStream, I did not try it with printwriter.

  • How to read ZIP files(having PDFs,Image) using MQ Series link for R/3

    Hi,
    1)Is it possible to transfer a zip file (having an image or pdf) using IDocs in SAP 4.6C using MQ Series link for R/?
    Scenario: "MQ Series link for R/3" converts Business-Reports from a third-party software,into SAP IDocs.Each Business-Report contains one XML file and one ZIP file.
    2)Being on ABAP side,do I have to worry about how the zip file would be converted into IDocs?
    Detailed descrption:
    This scenario requires integration of a non-SAP software which talks in XML with SAP R/3(4.6C).The customer has decided to go with 'MQ Series link for R/3' (which integrates any non-SAP application running on IBM MQ Series to R/3,by converting data(in any format) into IDocs).He is not ready to go for XI.
    The Problem area is a functionality which requires the non-SAP software to send XML file along with an attached Zip file.So,XML document,basically,has a 'zippedFile' XML element having actual file in XML keyword 'file'.
    This XML document ideally, should be converted by the subsystem(MQSeries link for R/3) into IDocs i.e. into a stream which could be stored in a table on R/3 side and later, sent back to the non-SAP software through MQ Series link to be converted into zip-file again with corresponding pdfs,images.I want someone who has worked in a similar scenario to confirm this.

    Hi,
    I have a feeling I have posted this question in the wrong forum or maybe I will let you decide this.Any help would be appreciated (even the right forum name).
    My scenario requires integration of a non-SAP software which talks in XML with SAP R/3(4.6C).The customer has decided to go with 'MQ Series link for R/3' (which integrates any non-SAP application running on IBM MQ Series to R/3,by converting data(in any format) into IDocs).He is not ready to go for XI.
    The Problem area is a functionality which requires the non-SAP software to send XML file along with an attached Zip file.So,XML document,basically,has a 'zippedFile' XML element having actual file in XML keyword 'file'.
    This XML document ideally, should be converted by the subsystem(MQSeries link for R/3) into IDocs i.e. into a stream which could be stored in a table on R/3 side and later, sent back to the non-SAP software through MQ Series link to be converted into zip-file again with corresponding pdfs,images.I wanted someone who has worked in a similar scenario to confirm this.

Maybe you are looking for

  • Printing Problem with HP Laserjet 3055

    Font size, left, right, top and bottom of the printed page are not similar to the settings viewed on screen.There is a gross reduction in font size and increase in margins of printed page. I have tried by changing print and page set up and even by de

  • SEEBURGER Adapter Installation

    Hi, We are installing SEEBURGER Adapter for this below 3 files required. I searched in sap market place and other forms i am not able to find these files. SeeXIBaseTools.sca SeeXIExtendedTools.sca SeeXISolutionIdModule.ear Please help the down load 

  • BR0301E SQL error -1017 at location db_connect-2 during DB13

    While executing the check database through DB13 following error is showing by this t-code 08.12.2009     08:00:30     Job started 08.12.2009     08:00:30     Step 001 started (program RSDBAJOB, variant &0000000000178, user ID 11001481) 08.12.2009    

  • HTTPService redirect

    I'm trying to use J2EE Servlet form based authentication by posting to the well-known url j_security_check. In my web.xml file I specify FORM authentication and my custom Flex login page. Upon accessing a protected resource, I am redirected to my log

  • Why is my Adobe Photoshop Elements 10 not in English???

    I just purchased the Adobe photoshop elements 10 from the Mac App store and without even changing the settings or anything, it just launched in polish or german or idont know what language....I have no idea what to do...PLEASE HELPPPPPP