ICEfaces
  1. ICEfaces
  2. ICE-5048

dynamic images showed using graphicimage do not refresh

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2
    • Fix Version/s: 1.8.2-EE-Beta, 1.8.2-EE-GA, 1.8.3
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      debian linux 5.0.2, glassfish 2.1, icefaces 1.8.2
      client firefox under windows and linux
      not tested with internet explorer

      Description

      1.8.2 changed the way urls for images are generated
      the new way causes images to not be refreshed
      this sort of "caching effect" problems is not happening on the client but on the server side.

      1.8.1 generates those urls quite differently and it is not affected

      More details can be found in the forum reference

        Activity

        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P2
        Assignee Adnan Durrani [ adnan.durrani ]
        Hide
        Joanne Bai added a comment -

        Test app has been added to repo\qa\trunk\Regression\ICE-5048. Thanks, Adnan.

        Show
        Joanne Bai added a comment - Test app has been added to repo\qa\trunk\Regression\ ICE-5048 . Thanks, Adnan.
        Ken Fyten made changes -
        Fix Version/s 1.8.2-EE-GA [ 10216 ]
        Hide
        Adnan Durrani added a comment -

        Thanks Paul and Hybris for verification.

        Show
        Adnan Durrani added a comment - Thanks Paul and Hybris for verification.
        Hide
        Hybris Zero added a comment -

        works for me
        thanks

        Show
        Hybris Zero added a comment - works for me thanks
        Hide
        Paul van Rossem added a comment -

        Tested it with the patched jar on Tomcat 6. Looks like my image problem has been solved.
        Thanks, Adnan. Regards, Paul.

        Show
        Paul van Rossem added a comment - Tested it with the patched jar on Tomcat 6. Looks like my image problem has been solved. Thanks, Adnan. Regards, Paul.
        Adnan Durrani made changes -
        Attachment icefaces-comps.jar [ 12078 ]
        Hide
        Adnan Durrani added a comment -

        The bug has been fix, for quick testing I am attaching a patched jar. can you please verify it.

        Thanks,

        Show
        Adnan Durrani added a comment - The bug has been fix, for quick testing I am attaching a patched jar. can you please verify it. Thanks,
        Adnan Durrani made changes -
        Salesforce Case []
        Fix Version/s 1.8.2-EE-Beta [ 10215 ]
        Adnan Durrani made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Adnan Durrani added a comment -

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java
        Completed: At revision: 19589

        Modified: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java
        Completed: At revision: 19591

        Show
        Adnan Durrani added a comment - Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java Completed: At revision: 19589 Modified: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java Sending content: D:\work\development\head\svn\ossrepo\icefaces-ee\branches\icefaces-ee-1.8.2\icefaces\component\src\com\icesoft\faces\component\ext\HtmlGraphicImage.java Completed: At revision: 19591
        Adnan Durrani made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19590 Tue Nov 03 15:22:43 MST 2009 adnan.durrani clean up related to ICE-5048
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlGraphicImage.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #19589 Tue Nov 03 15:16:33 MST 2009 adnan.durrani Fix for ICE-5048 (dynamic images showed using graphicimage do not refresh)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlGraphicImage.java
        Hide
        Adnan Durrani added a comment -

        This can be easily reproduce on Glassfish after page reload.

        Show
        Adnan Durrani added a comment - This can be easily reproduce on Glassfish after page reload.
        Hide
        Paul van Rossem added a comment -

        I think that's just a coincidence. I'm having the same kind of problem with a number of pages in Tomcat 6, not with all, and not with this example you provided though.

        Show
        Paul van Rossem added a comment - I think that's just a coincidence. I'm having the same kind of problem with a number of pages in Tomcat 6, not with all, and not with this example you provided though.
        Hide
        Adnan Durrani added a comment -

        Thanks Hybris for the testing of the application with both web servers. So this seems like server specific issue. We will look into it.

        Show
        Adnan Durrani added a comment - Thanks Hybris for the testing of the application with both web servers. So this seems like server specific issue. We will look into it.
        Hide
        Hybris Zero added a comment -

        i tested the app with glassfish 2.1 and tomcat 6.0.18

        with glassfish initially all seems to work ok but if i reload the page (via the browser button) all stops working as described before. no error is given but pressing the get next image button does not produce the expected result.

        same test with tomcat works fine even after reloading the page

        Show
        Hybris Zero added a comment - i tested the app with glassfish 2.1 and tomcat 6.0.18 with glassfish initially all seems to work ok but if i reload the page (via the browser button) all stops working as described before. no error is given but pressing the get next image button does not produce the expected result. same test with tomcat works fine even after reloading the page
        Hide
        Kai Cheung added a comment - - edited

        When I encountered this bug, it doesn't fail all the time. It works the first time I enter a Java bean page with graphicImage. It is when I enter the Java bean page the second time and afterwards that graphicImage stops changing.

        Show
        Kai Cheung added a comment - - edited When I encountered this bug, it doesn't fail all the time. It works the first time I enter a Java bean page with graphicImage. It is when I enter the Java bean page the second time and afterwards that graphicImage stops changing.
        Adnan Durrani made changes -
        Attachment ICE-5048.war [ 12074 ]
        Hide
        Adnan Durrani added a comment -

        Attaching new war file, which doesn't require any external file. Images are served from the web/images.

        Show
        Adnan Durrani added a comment - Attaching new war file, which doesn't require any external file. Images are served from the web/images.
        Adnan Durrani made changes -
        Attachment ICE-4861.war [ 12073 ]
        Hide
        Paul van Rossem added a comment -

        Maybe just a stupid guess. But I hope the hashcode of the byte[ ] isn't just computed as bytes.hashCode() (where bytes is a byte[ ])? That delivers the address of the array, not a valid hash code (the Object default)! But it would perfectly explain the results I am seeing...
        Regards, Paul.

        Show
        Paul van Rossem added a comment - Maybe just a stupid guess. But I hope the hashcode of the byte[ ] isn't just computed as bytes.hashCode() (where bytes is a byte[ ])? That delivers the address of the array, not a valid hash code (the Object default)! But it would perfectly explain the results I am seeing... Regards, Paul.
        Hide
        Hybris Zero added a comment - - edited

        Hi,
        i'm having much trouble in getting "C:\work\1.jpg" work in a linux environment.
        Could you please provide me the source code of the test case so i can adapt it to my system or modify it so it searches for images in the application context root?
        Thanks

        Show
        Hybris Zero added a comment - - edited Hi, i'm having much trouble in getting "C:\work\1.jpg" work in a linux environment. Could you please provide me the source code of the test case so i can adapt it to my system or modify it so it searches for images in the application context root? Thanks
        Adnan Durrani made changes -
        Attachment ICE-4861.war [ 12073 ]
        Hide
        Adnan Durrani added a comment -

        I am attaching a slide show demo using byte[] and 1.8.2 jars. I have tested it with tomat6 + FF3, IE8, Safari and Chrome. Seems to be working fine. Can you please test it, mean while we will test it with your configuration. App has source as well.

        Show
        Adnan Durrani added a comment - I am attaching a slide show demo using byte[] and 1.8.2 jars. I have tested it with tomat6 + FF3, IE8, Safari and Chrome. Seems to be working fine. Can you please test it, mean while we will test it with your configuration. App has source as well.
        Hide
        Hybris Zero added a comment -

        This is what i do.
        I can see the hashCode changing in the uri and sniffing the browser actions (with httpfox and firefox) i can see that the browser actually requests the new picture.
        I tracked my server application and i am sure that a new picture and a new byte array are generated whenever i have a new image to display.

        The problem is that it seems that the picture served is not updated even if a new byte array is given and even if the hash code proves that the array is new.

        Show
        Hybris Zero added a comment - This is what i do. I can see the hashCode changing in the uri and sniffing the browser actions (with httpfox and firefox) i can see that the browser actually requests the new picture. I tracked my server application and i am sure that a new picture and a new byte array are generated whenever i have a new image to display. The problem is that it seems that the picture served is not updated even if a new byte array is given and even if the hash code proves that the array is new.
        Hide
        Adnan Durrani added a comment - - edited

        We fixed a memory leak in 1.8.2, so regardless of number of images get served would be served by one resource only. To let the browser know when to request a new image we pass the hashCode of the contents of the image. In graphicImage case its the hashcode of the byte[]. So its in the control of the application. Don't recreate the byte array for the served images. Only recreate it when you want new picture to be loaded.

        uri.getPath()+ "?"+ content.hashCode();

        Show
        Adnan Durrani added a comment - - edited We fixed a memory leak in 1.8.2, so regardless of number of images get served would be served by one resource only. To let the browser know when to request a new image we pass the hashCode of the contents of the image. In graphicImage case its the hashcode of the byte[]. So its in the control of the application. Don't recreate the byte array for the served images. Only recreate it when you want new picture to be loaded. uri.getPath()+ "?"+ content.hashCode();
        Ken Fyten made changes -
        Field Original Value New Value
        Salesforce Case []
        Fix Version/s 1.8.3 [ 10211 ]
        Assignee Priority P2
        Assignee Adnan Durrani [ adnan.durrani ]
        Hybris Zero created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Hybris Zero
          • Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: