Problem in getting the image through URL

hi all,
I facing the problem,Inwhich i am unable find the solution...I am using the following code to display the image
public void doGet(HttpServletRequest request,HttpServletResponse response)
                    throws IOException, ServletException {
               int data=0;
               response.setContentType("image/png");
               ServletOutputStream out = response.getOutputStream();
               String file = request.getContextPath()+imageNames[0];
               //String file = "C:/Program Files/Apache Group/Tomcat 4.1/webapps/ImageComm/WEB-INF/images"+imageNames[index];
               BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
               System.out.println("the size of the inputStream is..."+in.available());
               System.out.println("the context path is..."+request.getContextPath());          
               while ((data = in.read()) != -1) {
               out.write(data);
with the above i am not getting any error at the compile time but it was giving exception like FileNotFoundException.
but the same thing(URL address) when i am copying on the browser it was displayig the image.
(what might be the reason)
one more thing when i commented on the url address and try to use the actual realpath address it was displaying the image with out any problem
can anybody give me the solution like where to keep my images by which i can able to get the images through url address
thanks in advance
lakshman

hi all,
I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
can anybody give me the solution in rectifying that exception.
thanks in advance
lakshman

Similar Messages

  • Problem in getting the image coordinates  when i zoom in or zoom out

    Hi,
    i have doubts with scaling (Zoom in and Zoom out) using following code but when i zoom in want to get the x and y coordinates but im getting resized coordinates , pls do the needful
    public class TiffTest extends JFrame implements MouseListener
    public TiffTest(String filename)
    RenderedImage source= JAI.create("fileload",filename);
    SubsampleBinaryToGrayDescriptor sb=new SubsampleBinaryToGrayDescriptor();
    RenderingHints rh=new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_DEFAULT);
    RenderedOp op=sb.create(source,new Float(0.5),new Float(0.5),rh);
    JScrollPane scrollPane = new JScrollPane();
    displayjai dj=new displayjai(op);
    scrollPane.setViewportView(dj);
    getContentPane().add(scrollPane,BorderLayout.CENTER);
    int screen_width=(int)this.getToolkit().getScreenSize().getWidth();
    int screen_height=(int)this.getToolkit().getScreenSize().getHeight();
    setVisible(true);
    setSize(screen_width,screen_height);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setExtendedState(JFrame.MAXIMIZED_BOTH);
    dj.addMouseListener(this);
    JAI.create("filestore",dj.ima,"god.tif","TIFF");
    public static void main(String s[])
    new TiffTest("1_org.tif");
    public void mouseClicked(MouseEvent e){System.out.println(e.getX()+","+e.getY());}
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    public void mouseExited(MouseEvent e){}
    class displayjai extends DisplayJAI
    RenderedOp ima;
    public displayjai(RenderedOp inputImage)
    super(inputImage);
    ima=inputImage;
    setPreferredSize(new Dimension(ima.getWidth(),ima.getHeight()));
    System.out.println(inputImage.getWidth()+","+inputImage.getHeight());
    Thankx
    Kannan

    hi all,
    I am getting the image from the server.but the problem is i am getting the Exception as ArrayOutOfBound exception.
    It was displaying the Image for the first time.and when ever it was going for the second time in to the paint method it was displaying the IOException in reading the stream from the connection.
    can anybody give me the solution in rectifying that exception.
    thanks in advance
    lakshman

  • Since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    A Davey1 wrote:
    Not a nice answer!
    Posting "Check the 'More like this'" area and not simply providing the answer is a great way to make these groups worthless.
    You're ignoring context.  On the old Apple Discussion Groups I never posted replies like that, instead giving people relatively detailed answers.  The new Apple Support Communities made things worse by introducing certain inefficiencies.  Then came Lion.  The flood of messages that came with Lion required a painful choice for any of the people who had been helping here: (1) Give quality responses to a few questions and ignore the rest.  (2) When applicable, give a brief answer such as the one that you found objectionable.  (3) Give up all the other normal activities of life and spend full time trying to answer questions here.
    People who needed help with Lion problems seemed to have trouble discovering existing message threads that described how to solve their problems.  I never posted the suggestion of "Check the 'More like this' area" without verifying that the help that the poster needed could be found there.  Even doing that, what I posted saved me time that I could use to help someone else.
    The people helping here are all volunteers.  None of them is being paid for the time they spend here.  They all have a life outside of Apple Support Communities.  It's arrogant of you to demand that people helping here spend more time than they already do.

  • I keep getting an error message saying "There was a problem connecting to the server.  URLs with the type "file:" are not supported."  Can someone help me get rid of it.

    I keep getting an error message saying "There was a problem connecting to the server.  URLs with the type "file:" are not supported"  Can someone help me locate and get rid of this error.

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • My Mac suddenly started getting a pop up message saying "There was a problem conecting to the server. URLs with the type "file" are not supported." My internet is working fine,no problem connecting. I just keep getting this message which I click off .

    My Mac suddenly started getting a pop up message saying "There was a problem conecting to the server. URLs with the type "file" are not supported." My internet is working fine,no problem connecting. I just keep getting this message which I click off and continue working.

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • After loading lion, I get an error message "There was a problem connecting with the server.  URL's with the type "file" are not supported."

    After loading Lion, I have been getting an error message "There was a problem connecting to the server.  URLs with the type "file:" are not supported."  There does not seem to be any actual problem with internet connectivity, but it is persistent and annoying.  Any idea of its cause and treatment?

    Take a look at this link, https://discussions.apple.com/message/16156214#16156214

  • I upgraded to Lion yesterday. Now I keep getting and error message: there was a problem connecting to the server. URLs with type "file:" are not supported. What server?

    I upgraded to Lion yesterday. Now I keep getting and error message: there was a problem connecting to the server. URLs with type "file:" are not supported. What server? How do I get rid of this.

    Take a look at this link, https://discussions.apple.com/message/16156214#16156214

  • I have a macbook pro, a mini display port to hdmi cable to hook up to my tv (a toshiba 1080p flatscreen).  what do I do to actually get the image on the tv screen?  Do I need another cable for sound?

    I am trying to watch a tv show that I purchased into I-tunes.  I have the cable and it hooks to the TV okay.  The TV shows the regular apple screen that looks like the universe screen - like when it boots up or is doing an upgrade on the OS.  I can't get the image to go from the laptop to the TV.  I tried under displays and it shows the TV as a display but I can't get the image on the TV.......Please help.

    Rwogera wrote:
    I couldn't transmit sound either, do i need another cable like Kim said? i mean it cant be transmitted through this HDMI port? as for me i have one of the latest mac pro with intel core i5..tnx
    I need to know which MacBook Pro you have.  Only mid-2010  and later MBP's transmit sound through MiniDisplay Port to HDMI.  I have no information about the Mac Pro, so you might want to go to that Forum and ask there.

  • How to get the image stored in archieve link as an attachment in work item.

    Hi All,
    through transaction OAWD we are storing scanned images.
    Once this transaction is executed a workitem appears in the inbox of the initiator with the scanned invoice as attachment.
    When the user executes the work item FV60 screen is displayed where the user enters the data based on the scanned invoice attachment.
    After the user Parks the document the custom workflow triggers and a workitem appears in the inbox of an approver.
    Our requirement is that the scanned image should also appear as the attachment.
    Can you please suggest how to get the image stored in archieve link as an attachment in work item.
    Regards
    Shraddha

    Hi Martin,
    with every parked document a scanned image is linked.
    I need to create a link under objects and attachments in the work item, such that when the user clicks that link the image is displayed.
    At present the following functionality is available.
    The BO used is FIPP
    Objects and attachments:
    parkeddocument:AK0108500001252008.(via FIPP binding with WIOBJECT_ID)
    On clicking the link below objects and attachments: the parked document AK0108500001252008 opens in display mode.
    Now we want to have 2 links:
    parkeddocument:AK0108500001252008.
    image.
    When we click on the link image then the scanned invoice linked to the document should get opened.
    I am able to get the image id of the the image through  SAP_WAPI_GET__OBJECTS,
    export parameter leading_object provides the detail.
    But I am not able to figure out how to use it in my workflow to display it as an attachment.
    Hope this will give a better understanding of my question.
    can you please suggest as to how I should proceed with it.

  • "there was a problem connecting to the server. URLS with the type 'file' are not supported"

    i have a new macbook pro 13" and every 6 minutes or so it pops up a window that says "there was a problem connecting to the server. URLS with the type 'file' are not supported". it never seems to cause any problems but is supremely annoying. how can i make this come to an end?

    I tried someone's solution of taking another external disc and plugging it in, then when it showed up and time machine asked if I wanted to use it or that someone might be trying to trick me, I chose not use it.  Then I  shut down my computer, plugged in the original Lacie, and rebooted the computer and all seems to work fine now-- the Lacie appears on my desktop and all seeems to be in working order. Who knows why or anything else,- as weird as it gets- but for now things seemed fixed--- maybe others can try this too-- it worked for me so far.

  • "There was a problem connecting to the server.   URLs with the type "file:" are not supported.  Why?  What can be done to eliminate it?

    After upgrading to Mountain Lion, I repeatedly get this message:  "There was a problem connecting to the server.   URLs with the type "file:" are not supported. 
    Why? 
    What can be done to eliminate it?

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • There was a problem connecting to the server. URLs with the type "file:" are not supported. OK

    I have just upgraded to Mountain Lion from Leopard, but now I keep getting this message when I open some web-pages and every time I wake the Mac up after going to sleep. For some odd reason I get it in Swedish sometimes (installed language) and some times in English...
    There was a problem connecting to the server.
    URLs with the type "file:" are not supported.
    OK
    What is this and how can I get rid of it. I use Firefox and have updated to latest version.

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • I'm being shown an error pop-up message periodically saying "There was a problem connecting to the server. URLs with the type 'file:' are not supported." I have a brand new MacBook Pro, and at no time am I actually having trouble connecting to the server.

    I'm being shown an error pop-up message periodically saying "There was a problem connecting to the server. URLs with the type 'file:' are not supported." I have a brand new MacBook Pro, and at no time am I actually having trouble connecting to the server, but this message continues to pop-up several times a day at random intervals. Is there something I'm doing wrong? Or is my computer just having a glitch? Other than that, and a mildly sticking caps lock button, it's working perfectly.
    Thank you!

    Alright it didn't solve it. Any other suggestions?
    I haven't suggested a solution yet. I want to know whether you still get the messages while Time Machine is disabled. Do you? If so, try any or all of the solutions proposed in this thread:
    There was a Problem connecting to the...: Apple Support Communities

  • How can i get the images from a picture ring into a cell in Excel?

    Hi
    I need to get the chosen image from a picture ring into a cell in a Excel worksheet. If i use an invoke node i only get to write a picture from file. How can i get the picture directly from the picture ring into Excel?
    Kenneth

    No, there is no simple way of doing it directly. You need some clipboard manipulation which means you need to write some codes in excel as well. Importing the image through a file is much easier.
    -Joe

  • How can I get the Lync Meeting URL programmatically in C#?

    Currently I am running an ASP.NET web application and my web page needs to provide a button to get the Lync Meeting URL just like the Outlook does:
    Please see the screenshot here: Lync
    Meeting Address in Outlook
    The behavior of this button is when it is clicked, the Lync Meeting URL is retrieved (maybe from the Exchange server) and is shown on a asp:Label control on the web page.
    I googled but I have been told that there are three SDKs can be considered for this scenario:
    Lync SDK - seems the Lync client must be running while the SDK is in use
    Microsoft Unified Communications Managed API (UCMA)
    Microsoft Exchange Web Services (EWS)
    I am really confused on these three SDKs, and don't know how to achieve my goal by utilizing these SDKs, could someone please help me? It would be much appreciate if you can post some sample code here.

    Hi,
    You'll receive a better response posting this thread in the Lync Development forums here;
    https://social.msdn.microsoft.com/Forums/office/en-US/home?category=lync
    The majority of readers here typically are end users, administrators, consultants, architects, or enthusiasts.
    Kind regards
    Ben
    Note: If you find a post informative, please mark it so using the arrow to the left. If it answers a question you've asked, please mark the thread as answered to aid others when they're looking for solutions to similar problems or queries.
    Lync | Skype | Blog: Gecko-Studio

Maybe you are looking for

  • Report on Daily Status Of Process Chains

    Hi all, I need a report on process chain where daily i can check the status of the Chains executed, failed, logs, start time, end time, log ID, Job Type, Run Time, Last Update ( User name ), Duration, Source System. Is there any Standard Report on th

  • Bug:4705928 PLSQL: Memory leak using small varrays

    We have Oracle version 10.2.0.1.0 We have a problem with a procedure. In our scenario we make use of VARRAY in the procedure to pass some filter parameters to a select distinct querying a view made on three tables. Unfotunately not always execution i

  • Troubles with a switch case and final expression?

    Been developing C/C++ for quite a while and still new to Java, and struggling with even the simplest things ... Why isnt this switch/case working? have some final "variable" declared in a class contating "constants" like this ... public class CConsta

  • TO not working in LT12

    Hi, We are using leam wm in plant A while now we are going to use wm in plant B. When we are running ZLT12 for plant A, it is showing different screen from plant B. There is a custom T code ZLT12, which has been used in plant A, there seems nothing b

  • Can't play videos after I move them to the micro sd memory card

    I moved my videos bought on video unlimited to the micr sd card to save space using the file transfer app that came with the tablet and now they won't play. I just get the message " can't play video". If I move back onto internal memory they won't pl