OutputStream is already being used for this request.

I have been trying to get images fom Oracle Database and displaying from JSP but get an IllegalStateException:OutputStream is already being used for this request.
My code is as follows:
<%
Connection con = cods.getConnection();
Statement st = con.createStatement();
String query="SELECT image FROM image_table WHERE id=1";
ResultSet rs = st.executeQuery(query);
if( rs.next() ){
BLOB blob=((OracleResultSet)rs).getBLOB(1);
byte []bl=new byte[1024*1024];
bl=blob.getBytes(1,(int)blob.length());
response.setContentType("image/jpeg");
ServletOutputStream outs = response.getOutputStream ();
outs.write(bl);
outs.close();
rs.close();
st.close();
con.close();
%>

Try a plain ol' out.write();

Similar Messages

  • Tomcat Error : OutPutstream is already being used for this request

    I'using Jdev3.2 to develop an application based on the dataweb
    beans.
    I'm using the EditCurrentRecord, and the function UseListOfValue
    to disply lovs.
    I deployed the application on tomcat, when the page is displayed
    an execption occur which is 'OutPutstream is already being used
    for this request'
    can someone help me please
    THX in advance
    Ghassen

    can someone help?
    Please

  • IllegalStateException:output stream is already being used for this request

    How to read binary data in JSP. I know, in servlets it can be done and JSP can handle only character data. When i try to open res.getOutputStream(), it is throwing the following exception:"IllegalStateException:output stream is already being used for this request". Is there any workaround in JSP?

    Can you save the file to a location in your server ? Even if you are creating a dynamic image, all you get is a byte array which can be stored in your server. If you can do so, you can set the content type and display the content as mentioned above.

  • He iTunes Store account entered is already being used for an iTunes Connect account that distributes Apps

    I am getting the following message when trying to sign up with iTunesConnect for selling our companies eBooks.
    "The iTunes Store account entered is already being used for an iTunes Connect account that distributes Apps. To continue with this application, you must enter a different iTunes account."
    The email account I am using is not being used for distributing apps. We need to sell ebooks.
    We DO have a developer account to sell apps but it is a different email address (confirmed).
    How should I go about getting this straitened so we can get into iTunesConnect?

    That worked, thank you very much! The Apple support document is quite misleading then.

  • HT4848 Is it possible to partition an external hard drive that is already being used for Time Machine backups without it being erased?

    I'm want to use my current external hard drive, which I use for Time Machine Backup, as a recovery disk for Mac OS X Mountain Lion 10.8.2. From what I have read, the recovery disk assistant will erase all data on the external drive unless it is partitioned. Can I partition my current backup drive without erasing it, even though it is already being used for Time Machine?

    It's very simple to test.  Turn off your computer.  Have your time machine backup plugged in.  Hold option and turn it on, keeping option held.  Do you see your time machine drive?  If so, select it and press enter. You'll end up in recovery.  If it works, there you go.  Then just click the apple and restart to get back to your regular desktop.  Then you'll know for when you're ready to do the deed.
    Edit...
    I'm not sure if time machine will think it's an entirely different computer, though, when a hard drive changed, making an actual restore not doable.  Either way, you could still reinstall mt lion fresh and then just migrate after, skipping the need for SL.

  • How do I determine ethX is being used for this port?

    if one of two ports ethernet card (10GbE) gets connected, how do I know which ethX on linux is corresponding to this port?
    Oracle linux 6.3
    NC523SFP 10Gb 2-port Server Adapter
    HP G5 server
    Thanks!
    Edited by: 943714 on Sep 25, 2012 7:10 AM

    Here is another option:
    Find the interrupt of eth0:
    <pre>
    # grep eth0 /proc/interrupts
    *19*: 163728 IO-APIC-fasteoi ehci_hcd:usb1, eth0
    </pre>
    So it the above example device eth0 uses IRQ 19.
    Then query lspci for IRQ 19:
    <pre>
    lspci -v
    00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
         Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter
         Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 19
         Memory at f0000000 (32-bit, non-prefetchable) [size=128K]
         I/O ports at d010 [size=8]
         Capabilities: [dc] Power Management version 2
         Capabilities: [e4] PCI-X non-bridge device
         Kernel driver in use: e1000
         Kernel modules: e1000
    </pre>
    For information about the link:
    <pre>
    # mii-tool -v eth0
    # ethtool -a eth0
    </pre>

  • My iMac was stolen in a robbery - no files via iCloud (long story).  I have a new iMac which is set up and being used - how do I recover old iMac files from what looks like back-up files showing on my Time Capsule (also being used for this new iMac)?

    My iMac was stolen - but I think there's a backup on my Time Capsule (which wasn't stolen). I have a new iMac which I've been using normally; I didn't use the 'Restore from...' option at the start because I thought the Time Capsule had nothing on it.  So how do I now recover files from the Time Machine?  I can see various back-ups on the Time Capsule, from various machines - laptops, etc. - but it's not letting me open any of them to see what they contain. Does anyone know how I access this information?

    Use migration assistant.
    See http://pondini.org/OSX/MigrateLion.html
    Although this is only up to Mountain Lion it is still relevant to Mavericks.. only expect Mavericks to kick and buck a lot more.

  • What should i do if my new email address is already been used for an apple ID?

    I have updated my itunes account with my new email address and I obviously want any further emails from apple or itunes to be sent to my new email address but I can't add my new email address s my primary email address as I'm getting a message to say "the email address you entered is already being used for an apple account.  If it is yours, you can cancel and sign in using that apple account". 

    Apple ID disabled
    http://support.apple.com/kb/TS2446
    If you still have problem, contact iTunes Support
    https://ssl.apple.com/emea/support/itunes/contact.html
    Message was edited by: Diavonex

  • I'm trying to set up my iPad2.  I am entering my Apple ID and get a message that says "try another apple id, this ID is already being used.  The only time I've used this Apple ID (my email), is when I bought a mac for my college student.

    I'm trying to set up my iPad2.  I am entering my Apple ID and get a message that says "try another apple id, this ID is already being used.  The only time I've used this Apple ID (my emal) was when I purchased a mac for my college aged child.

    Thank you...I had selected the incorrect option to create an Apple ID....so backing up a few pages and doing as you stated worked!

  • After downloading latest update to my iphone3, I found a 'game center' app.  When I opened and tried to sign in using my current info it keeps rejecting my password as already being used. Yes, by ME. How do I get past this?

    After downloading latest update to my iphone3, I found a "game center" app.  I opened and tried to sign in using my current info and kept getting msg that password  already being used (yeah, by me).  How do I get past this so I can download and use my games?

    THANK YOU, LIMNOS, I FIXED IT!!!!!!!! [And yes, I was being REALLY dumb.]
    Just in case the following is helpful to anyone else:
    The switch has to be done manually since all of the sort categories--except album artist--have changed to automatically sort with articles, which is a bit of a pain if you have a lot of articled artists, but there is actually a way to WRITE IN how you want your artist (or whatever) to sort. I just changed my POLICE to COPPERS as a test, and by golly now all the music comes up/is reorganized under C right below Coolio, still listed as The Police!
    Before the newest update, the auto-sort always sorted ARTIST to my liking (i.e. ignoring the article), so I never bothered to check out any other tab save Details and Artwork, but voila:
    [For any other dummies out there, here's how to get to this screen: right click song or songs-->Get Info-->Sorting.]
    Dankeschön, Limnos, really appreciate it!!! But hey, I guess it could be worse when you only have use of half your brain...

  • Apple IDI am trying to update my IPAD and it gives me a message when I put my email address in:The apple ID is already being used?? I set my Iphone up yeasterday and I only have one email address and one account how do I use it for all my devices?

    I need some help I set my IPhone up yesterday and now I am trying to set up my IPad but I only have one Itunes account and one email but the IPad error message states "The apple ID is already being used" I dont know how to get passed this and my family and I only have one account and we all have IPhones now I dont want them to update if we cant all use the same account. Please help with ideas!!!

    Try here:
    http://support.apple.com/kb/HT4895
    Apple IDs and iCloud)

  • My Time Capsule won't allow my computer to back up.  It says it is already in use but that is what it is being used for.

    My Time Capsule won't allow my computer to back up.  It says it is already in use but that is what it is being used for. It has been working fine for years.  All of a sudden I keep getting a message that TC (time capsule) cannot complete back up as it is already in use.  I am doing the backups automatically through Time Capsule.

    Restart the Time Capsule by disconnecting and reconnecting the power adapter. When it's back online, open the AirPort Utility application and check to see whether there's a firmware update for it.

  • HT4203 I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this.  Thanks.

    I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this. 

    I assume you are including the STIX font as part of your epub files?     
    Perhaps the folks who do this blog might be able to help -- they have done some work with font embedding:
    http://www.pigsgourdsandwikis.com/2011/04/embedding-fonts-in-epub-ipad-iphone-an d.html

  • Your Apple ID and phone number are now being used for iCloud on a new iPhone. Why did this pop up today?

    Why did this pop up today?
    Your Apple ID and phone number are now being used for iCloud on a new iPhone.

    Turned on my Mac Pro a few minutes ago and I got the following "POP-UP" message.
    " Your Apple ID and phone number are now being used for iCloud on a new iPhone. "  ( my iPhone is not new. )
    " If you recently signed into "xxxxx  iPhone" you can ignore this notification."
    On the bottom of this pop-up window is an "OK" button.  Well it's NOT "OK"  No option is offered if it is not "OK".
    I have made no changes to my iPhone whatsoever.  Just normal use today.  In my iCloud settings everything is turned off except sharing Contacts.
    I'd suggest you log on to iCloud.com with your Apple ID, and then go to Settings and look in the "My Devices" settings for anything you don't recognize.
    I just did this. All of the devices are iPhones, iPads, and Macintoshes that I own and am familiar with.

  • I rec'd an alert that my "Apple ID and phone no. are now being used for iCloud on a new iPhone."  I am not using iCloud and I don't have a new iPhone.  Is this something to worry about?

    I rec'd an alert that my "Apple ID and phone no. are now being used for iCloud on a new iPhone."  I am not using iCloud and I don't have a new iPhone.  Is this something to worry about?

    Howdy Libbidydooda,
    There are a couple of possibilities that may apply to the email you have received regarding your Apple ID. The first is that the email may be a legitimate warning that your Apple ID has been compromised. For this reason I would suggest that you change the password to your Apple ID as soon as possible. Use the instructions on this page -
    Apple ID: Changing your password - Apple Support
    In order to increase security for your Apple ID you may want to set up and use two-step verification. See this article for information about it -
    Frequently asked questions about two-step verification for Apple ID - Apple Support
    The second possibilty is that the email is an attempt at "phishing" in order to get you to reveal personal information. Typically this is done with an email that looks like it comes from an official source but has links to web pages that, while they may look like they are real, may actually be gathering your information for use by others. This article has more information about phishing -
    Identifying fraudulent "phishing" email - Apple Support
    For this reason it is important that you do not follow any links in the email, as they may compromise your security.
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

Maybe you are looking for