Getting error when open the file

Hi,
I am getting
" getOutputStream() has already been called for this response " when i wanted to open a file. Pls advise why I am getting this error and solution to tackle the error.
Thanks

Hi,
Thanks for the reply.
I am running jsp on jboss server. Previously, I was using java version 1.2.2 and the codes was working fine. But when i migrate the codes to jboss 3.2.5 with jdk 1.3.1_13, it throws the following error.
ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
     at org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:599)
     at org.apache.coyote.tomcat5.CoyoteResponseFacade.getWriter(CoyoteResponseFacade.java:163)
     at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:122)
     at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
     at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:190)
     at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
     at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
     at org.apache.jsp.icbbv2.users.DownloadFile_jsp._jspService(DownloadFile_jsp.java:181)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
What i am trying to do is, I am downloading a file stored in Oracle database and open the file based on the file extension, i.e, using ms word for .doc ext .
This i s where it is throwing error:
mySmartUpload.downloadFile(docid,"application/msword",docname,65000);
and the method is as the following:
public void downloadFile(String sourceFilePathName, String contentType, String destFileName, int blockSize)
throws ServletException, IOException
if(sourceFilePathName == null)
throw new IllegalArgumentException(String.valueOf((new StringBuffer("File '")).append(sourceFilePathName).append("' not found (1040).")));
if(sourceFilePathName.equals(""))
throw new IllegalArgumentException(String.valueOf((new StringBuffer("File '")).append(sourceFilePathName).append("' not found (1040).")));
if(!isVirtual(sourceFilePathName) && m_denyPhysicalPath)
throw new SecurityException("Physical path is denied (1035).");
if(isVirtual(sourceFilePathName))
sourceFilePathName = m_application.getRealPath(sourceFilePathName);
File file = new File(sourceFilePathName);
FileInputStream fileIn = new FileInputStream(file);
long fileLen = file.length();
int readBytes = 0;
int totalRead = 0;
byte b[] = new byte[blockSize];
if(contentType == null)
m_response.setContentType("application/x-msdownload");
else
if(contentType.length() == 0)
m_response.setContentType("application/x-msdownload");
else
m_response.setContentType(contentType);
m_response.setContentLength((int)fileLen);
m_contentDisposition = m_contentDisposition == null ? "attachment;" : m_contentDisposition;
if(destFileName == null)
m_response.setHeader("Content-Disposition", String.valueOf((new StringBuffer(String.valueOf(m_contentDisposition))).append(" filename=").append(getFileName(sourceFilePathName))));
else
if(destFileName.length() == 0)
m_response.setHeader("Content-Disposition", m_contentDisposition);
else
m_response.setHeader("Content-Disposition", String.valueOf((new StringBuffer(String.valueOf(m_contentDisposition))).append(" filename=").append(destFileName)));
while((long)totalRead < fileLen)
readBytes = fileIn.read(b, 0, blockSize);
totalRead += readBytes;
m_response.getOutputStream().write(b, 0, readBytes);
fileIn.close();
Pls assist. Thanks in advance.
Rajes

Similar Messages

  • Error when opening the file

    Hi all,
    we are sending the purchase orders from SAP to Third party system as file using IDOC to File scenario.
    In XI side successfully gone through in MDT also i didnt see any errors.
    But when we open the file in third party system its giving errors.
    Can anybody face this problem before please tell what cause the problem.
    the file is PurchaseOrder_20071730-121942-758.txt
    This is the time stamp in the file what time must be in MDT for this message because i didnt see any 12-19-42 time in MDT is there any time difference in the file and MDT if it is what time must i see it in MDT for identifying the message.
    Answer will be rewarded.
    Prasad.

    Hello Prasad,
    You can see the filename in MDT.
    In your reciever file adapter you will see theres a link below message id. click on that.
    new window will open . Click on the page down button you will see something like this..
    <i>2007-08-02 11:43:48 Success Write to file "
    10.1.1.35\xi_public\inbound\in20070802-114348-390.xml" as binary, size 460 bytes</i>
    Regards,
    Sumit

  • Getting error "Cannot open the file "*****.INDD". Adobe InDesign may not support the file format, a plug-in that supports the file format may be missing, or the file may be open in another application."

    How to fix this problem
    "Cannot open the file "*****.INDD". Adobe InDesign may not support the file format, a plug-in that supports the file format may be missing, or the file may be open in another application."

    When I have seen this message it is either when I try to open a document with an older version of Indesign E.g. an indesign 2014 document with Indesign CC.
    The other time I have seen it is to open an Indesign CC document with Indesign 2014 which does not have Mindsuite - a plugin I use. Mindsuite, as yet, has not upgrade the plugin for Indesign 2014 therefore it recognises that a the document was created withe a plugin that the 2014 version does not have installed.
    I believe your problem will be something like that.

  • Illustrator CS6 gets error when opening AI files - Mavericks 10.9

    I installed Mavericks yesterday ... lucky me, to be guinea pig in the office for this upgrade.
    Am having issues with Illustrator. First it wouldn't open and had to runt he Java install, that took care of that. I am able to make new files without problem and open EPS files, but cannot open existing AI files UNLESS going to File > Open. If I double click on an AI file I get the error "The appliation can't be found"
    After looking for similar issues I am not finding anyone else reporting a similar problem. I am not running any 3rd party plug ins. Any ideas???
    Thanks for the help.

    Issue:
    Clients logging into File Services over SMB with OS X 10.9 experience hanging connection upon login attempt.
    Root Cause:
    OS X 10.9 now utilizes a new SMB2 stack written by Apple.   Apple's SMB2 implementation is not compatible with many other SMB2 NAS products on the market today while Windows 7, 8, and 8.1 works just fine.   In short, its an Apple bug.
    Workaround Option 1:
    To force your connection to be SMB1, simply type cifs://servername instead of smb://servername when connecting to a Windows or NAS share.  This is by far easier and requires no real configuration changes.
    Workaround Option 2:
    To force all connections to be SMB1:
    Open A terminal window
    paste in the following line followed by the return key(should be all on one line): 
    echo "[default]" >> ~/Library/Preferences/nsmb.conf; echo "smb_neg=smb1_only" >> ~/Library/Preferences/nsmb.conf
    What the command does:
    Creates a file called nsmb.conf  in your  home directory at the path ~/Library/Preferences/nsmb.conf.
    Adds directives to force SMB connections to use the SMB1 protocol.  This is slower but stable.
    How to remove the workaround:
    Open a terminal window
    paste in the following at the prompt and then hit the return button:
    rm ~/Library/Preferences/nsmb.conf
    Notes:
    Its a good idea to restart your mac before trying to connect to your storage again. This will clear any hung SMB processes from previous attempts to connect to your storage before implementing this workaround.

  • Opening an Excel 2003 file in Office 2010 Universal Data Connection error when opening the file from a domain.

    Hi.
    One of my users are having  problem with old accounting files in Excel 2003 when opening Excel 2010.
    The user experience that linked information is not being updated properly.
    And suspects that it something do with Universal Data Connection .
    How can an Excel 2003 spread sheet be converted to Excel 2010 spread sheet and still contain active links?
    When the user is opening and converting the file as mention in your suggestion, on the common share on a common domain, the links "breaks".
    we are not using SharePoint on our domain.
    But when doing it on a local machine, the links does not "breaks".
    Looking forward to get solved to this problem.
    Thank you in advance.
    Rgds

    it sounds link, the links changed from relative paths to absolute path. You need to use absolute path in original file.
    KR

  • Getting error when opening the sap console

    Dear Experts,
                         When I opening the SAP console There is a error message like
    Get process list failed:80070424
    The specified service does not exist as an installed service.

    Hi Amit,
    There is another thread with exactly similar error like you.
    SAPMMC tree disappear
    1. Follow what Ashok Dalai mentioned in this thread.
    2. If the above doesn't work, then start sapstartsrv.exe, I've already put the detail instruction how to do it.
    Hope this helps.
    Debasis.

  • Problem with Flash CS4. Getting error when rendering the file

    Hi,
    One of my user is facing problem with Flash CS4.
    Whenever he tries to render the file, Flash CS4 throws the below error and only after restarting the application, it works fine for another couple of hrs.
    Please some one help me to resolve this issue.
    -Prabagaran L.

    Please post in the Flash forum. This forum is for suite specific issues.
    Bob

  • Getting "Can not open the file due to unknown error(FRM:0007)"

    Getting "Can not open the file due to unknown error(FRM:0007)", when refreshing the local copy of Deski report  from user docs.
    Any assistance
    Thanks,
    Sasi.

    Hi Sasi,
    One of the reason for this error is corrupted universe.So you can try following steps and restore copy of universe and then try to import this universe and check whether it works.
    1.While importing a universe, a temp file is created in the users local settings temp directory.
    2. For example C:\Documents and Settings\brijones\Local Settings\Temp\0dd0b0a7 .
    3. File has no extension is relatively the same size as the original universe file.
    4.Rename this file to original universe name.
    I hope it helps.
    Regards,
    Snehal

  • Getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1. It is creating issue to convert PDF into TIFF. Please provide the solution ASAP

    Hello All,
    I am getting 'Out of memory' error while opening the file. I have tried several versions of Adobe 7.0,9.0,X1.
    Also, it is creating issue to convert PDF into TIFF. Please provide the solution ASAP.

    I am using Adobe reader XI. When i open PDF it gives "OUT of memory" error after scrolling PDF gives another alert "Insufficient data for an image". after clicking both alerts it loads full data of PDF. It is not happening with all PDFs. couple of PDFs are facing this issue. Because of this error my software is not able to print these PDFS into TIFF. My OS in window7*64. I tried it on win2012R2 and XP. Same issue is generating there.
    It has become critical issue for my production.

  • FM GUI_UPLOAD gives PC036 "Error when opening the download file".

    Dear all
    I'm having a problem with a particular PC.
    A program which calls FM GUI_UPLOAD gives the error PC036 "Error when opening the download file".
    The file we are trying to upload is a text file, with tab delimiter.
    If the same user executes the same program from another PCs, it works fine.
    If another user executes the program in the "problematic" PC, it gives the error.
    So, the problem is PC-related.
    I checked SAP GUI Codepage, and was the same as other PCs.
    I cheched regional configuration, and was also the same as other PCs.
    The operating  system is Windows XP, and the SAP GUI version is 7.10,  File version 7100.2.7.3077, Build 967944 , Patch level 7.
    SAP version is ECC6.
    I searched across forums, SAP note, and the web, but I couldn't find anything.
    I would be grateful if someone could give me ideas.
    Thanks in advance
    Jordi

    Hello. The user accounts are have same privilegies (like both are "Power users")? Also the file system are the same in both PC NTFS or FAT32 (today i'm find FAT32 in enterprise ) If NTFS may be some Domain politics are not allow to save file correctly, or space are not enough....Try check this first...Regards.

  • I am getting an error when opening the organizer saying online services could not be initialized?

    I just installed photoshop elements 11 on my Mac and am receiving an error when opening the organizer.  It is stating that online services could not be initialized and that I need to reinstall.  I tried that and it is still coming up.  What do I do?

    How did you uninstall it?

  • Multiple JavaScript errors when opening aspx file in Dreamweaver

    I get multiple javascript errors when opening aspx file in Dreamweaver similar to... "While executing translateHyperLink in ExternalRenderers.htm, a JavaScript error occurred."

    Hi Steven,
    Not sure if this is related, but can  you try the solutions in Troubleshoot JavaScript errors | Dreamweaver CS4, CS5, CS5.5, CS6
    Thanks,
    Preran

  • Error while opening the file store file "WLS_DIAGNOSTICS000000.DAT".....

    I have a WL 9.2.1 running on Sun solaris o/s .....it is failing to start thowing the following exception
    <Mar 19, 2009 5:21:17 PM EDT> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:
    There are 1 nested errors:
    weblogic.diagnostics.lifecycle.DiagnosticComponentLifecycleException: weblogic.store.PersistentStoreException: java.io.IOException: [Store:280021]There was a
    n error while opening the file store file "WLS_DIAGNOSTICS000000.DAT"
    at weblogic.diagnostics.lifecycle.ArchiveLifecycleImpl.initialize(ArchiveLifecycleImpl.java:44)
    at weblogic.diagnostics.lifecycle.DiagnosticFoundationService.start(DiagnosticFoundationService.java:107)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: weblogic.store.PersistentStoreException: java.io.IOException: [Store:280021]There was an error while opening the file store file "WLS_DIAGNOSTICS0
    00000.DAT"
    at weblogic.store.io.file.Heap.open(Heap.java:166)
    at weblogic.store.io.file.FileStoreIO.open(FileStoreIO.java:85)
    at weblogic.store.internal.PersistentStoreImpl.open(PersistentStoreImpl.java:350)
    at weblogic.store.PersistentStoreManager.createFileStore(PersistentStoreManager.java:202)
    at weblogic.diagnostics.archive.DiagnosticStoreRepository.getStore(DiagnosticStoreRepository.java:61)
    at weblogic.diagnostics.lifecycle.ArchiveLifecycleImpl.initialize(ArchiveLifecycleImpl.java:42)
    ... 4 more
    Caused by: java.io.IOException: [Store:280021]There was an error while opening the file store file "WLS_DIAGNOSTICS000000.DAT"
    at weblogic.store.io.file.StoreDir.throwIOException(StoreDir.java:213)
    at weblogic.store.io.file.StoreDir.open(StoreDir.java:103)
    at weblogic.store.io.file.Heap.open(Heap.java:164)
    ... 9 more
    Caused by: java.io.IOException: Error from fcntl() for file locking, Resource temporarily unavailable, errno=11
    at weblogic.store.io.file.direct.DirectIONative.open(Native Method)
    at weblogic.store.io.file.direct.DirectFileChannel.<init>(DirectFileChannel.java:51)
    at weblogic.store.io.file.direct.DirectIOManager.open(DirectIOManager.java:138)
    at weblogic.store.io.file.StoreFile.openInternal(StoreFile.java:112)
    at weblogic.store.io.file.StoreFile.open(StoreFile.java:142)
    at weblogic.store.io.file.StoreDir.open(StoreDir.java:95)
    ... 10 more
    i went ahead and checkd the file and the privs on the file they look correct -rw-r--r-- ...but when i just restart it ..it starts with no errors the next time......What could be the issue.....please help
    Then only reason i could think of is the size of the file is 35MB now...is this the problem....if yes....is there a way to automaticaly rotate this file ....

    The root cause appears to be right in the stack trace:
    Caused by: java.io.IOException: Error from fcntl() for file locking, Resource temporarily unavailable, errno=11I think this indicates that either the file was either locked (because another instance of WebLogic had it opened), or that the file was unavailable for some reason. WebLogic locks files as a safety precaution to prevent misconfigured setups (multiple domains sharing the same directory and store name) from attempting to share the same file.
    I don't think that this message necessarily means there is a file corruption.
    As for rotation, the file store automatically adds new files as needed (I think its 1 file for every 2GB of data). The "diagnostics" file store is generated by the optional diagnostics feature, and I think that this feature has options for controlling the amount of stored data.
    Tom

  • Error When Opening the Setup/Transactions/ Sources Window

    Hi All,
    in Oracle E-Business Suite R12 Version
    Error When Opening the Setup/Transactions/ Sources Window
    APP-FND-01388: Cannot read value for profile option FND_DEVELOPER_MODE in routine &ROUTINE.
    ORA-01403: no data found
    FRM-40735: WHEN-CREATE-RECORD trigger raised unhandled exception ORA-06502.

    Amr,
    Please see the suggested solutions in these docs.
    App-Fnd-01388: Cannot Read Value For Profile Option Fnd_developer_mode In Routine [ID 563884.1]
    R12: How To Avoid The Error Message APP-FND-01388 On Drilldown [ID 556668.1]
    R12 APXINWKB Error APP-FND-01388 When Trying To Query Invoice [ID 864195.1]
    APP-FND-01388 Cannot Read Profile Option FND_DEVELOPER_MODE In Benefits Service Center Form [ID 422182.1]
    Thanks,
    Hussein

  • Error When Opening the Transactions/Transactions Window

    Hi All,
    in Oracle E-Business Suite R12 Version
    Error When Opening the Transactions/Transactions Window
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "APPS.AR_MO_GLOBAL_CACHE", line 55
    ORA-06512: at "APPS.ARP_STANDARD", line 2912
    ORA-06512: at "APPS.ARP_GLOBAL", line 282
    FRM-40735: PRE-FORM trigger raised unhandled exception ORA-06502
    Can any body help about the error
    Thanks in advance.

    Did you go through the below notes:
    Note:125204.1, Note:153207.1 and Note:191306.1.

Maybe you are looking for

  • Photos app on 10.10.3 and on iOS 8.3 shows wrong location

    I have a set of photos shot in my living room in Riverside, CA, and all of them have similar GPS coordinates stored in the photos, around 33 deg 59' N, 117 deg 19' W, which is right in Riverside. For some strange reason, two of the photos register as

  • More of a TV issue than a Fios, but I can't see my Fios TV!

    HELP! So Last night daughter's TV was too loud, went in there to turn the volume down. Accidentally pushed the channel button. Now I can't get the TV to show the Fios stuff. Her TV says do a channel auto scan (which BTW comes up with no channels foun

  • My TV Shows Used to sort in Chronological order, but now???? Help.

    I have an entire series on my iPod, and it used to display in chronological order. Then I upgraded to the iPod Classic, and now they display in alphabetical order. The sub heading for each show reads, "no release date for this program", but there isn

  • Setting Shutdown time in Energy Saver

    I'm trying to set a shutdown time in the Energy Saver on an additionaliMac G5 I have. The wakeup time works fine; however, every time I go into the Energy Saver, the lock is unlocked even though I've locked it when I set the time and closed out. The

  • Can I Create Ringtones In Garageband

    Dear All, Can I create ringtones for my iphone in garageband? Thx