You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Pedro Santos (JIRA)" <ji...@apache.org> on 2011/04/27 20:31:03 UTC

[jira] [Created] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

ClassCastException when AbstractResource writes in response of some type other than WebResponse
-----------------------------------------------------------------------------------------------

                 Key: WICKET-3649
                 URL: https://issues.apache.org/jira/browse/WICKET-3649
             Project: Wicket
          Issue Type: Bug
          Components: wicket-core
    Affects Versions: 1.5-RC3
            Reporter: Pedro Santos
            Assignee: Pedro Santos
         Attachments: WICKET-3649.patch

Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

Posted by "Pedro Santos (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027412#comment-13027412 ] 

Pedro Santos edited comment on WICKET-3649 at 5/1/11 1:02 AM:
--------------------------------------------------------------

Same fix moving header setup code to ResourceResponse and test case preventing the bug.

IMO AbtratctResource is just an API to request handlers objects and all response setup code makes more sense inside ResourceResponse. The attached patch do not move cache headers setup to it since this change would involve API break.

      was (Author: pedrosans):
    Same fix; moving header setup code to ResourceResponse and test case preventing the bug.

IMO AbtratctResource is just an API to handler objects and all response setup code makes more sense inside ResourceResponse. The attached patch do not move caching headers setup to it since this change would involve API break.
  
> ClassCastException when AbstractResource writes in response of some type other than WebResponse
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3649
>                 URL: https://issues.apache.org/jira/browse/WICKET-3649
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>            Reporter: Pedro Santos
>            Assignee: Pedro Santos
>         Attachments: WICKET-3649-refactoring-fix-test.patch, WICKET-3649.patch
>
>
> Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

Posted by "Pedro Santos (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pedro Santos updated WICKET-3649:
---------------------------------

    Attachment: WICKET-3649-refactoring-fix-test.patch

Same fix; moving header setup code to ResourceResponse and test case preventing the bug.

IMO AbtratctResource is just an API to handler objects and all response setup code makes more sense inside ResourceResponse. The attached patch do not move caching headers setup to it since this change would involve API break.

> ClassCastException when AbstractResource writes in response of some type other than WebResponse
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3649
>                 URL: https://issues.apache.org/jira/browse/WICKET-3649
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>            Reporter: Pedro Santos
>            Assignee: Pedro Santos
>         Attachments: WICKET-3649-refactoring-fix-test.patch, WICKET-3649.patch
>
>
> Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

Posted by "Pedro Santos (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pedro Santos updated WICKET-3649:
---------------------------------

    Attachment: WICKET-3649.patch

> ClassCastException when AbstractResource writes in response of some type other than WebResponse
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3649
>                 URL: https://issues.apache.org/jira/browse/WICKET-3649
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>            Reporter: Pedro Santos
>            Assignee: Pedro Santos
>         Attachments: WICKET-3649.patch
>
>
> Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028111#comment-13028111 ] 

Martin Grigorov commented on WICKET-3649:
-----------------------------------------

Running the new test in Maven fails with:


Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.071 sec <<< FAILURE!
testThumbnailImageResource(org.apache.wicket.extensions.markup.html.image.resource.ThumbnailImageResourceTest)  Time elapsed: 1.067 sec  <<< ERROR!
java.lang.IllegalArgumentException: Unknown image type 0
        at java.awt.image.BufferedImage.<init>(BufferedImage.java:492)
        at org.apache.wicket.extensions.markup.html.image.resource.ThumbnailImageResource.getScaledImageInstance(ThumbnailImageResource.java:158)
        at org.apache.wicket.extensions.markup.html.image.resource.ThumbnailImageResource.getImageData(ThumbnailImageResource.java:91)
        at org.apache.wicket.request.resource.DynamicImageResource$1.writeData(DynamicImageResource.java:156)
        at org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:524)
        at org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77)
....

In Eclipse it passes.

> ClassCastException when AbstractResource writes in response of some type other than WebResponse
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3649
>                 URL: https://issues.apache.org/jira/browse/WICKET-3649
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>            Reporter: Pedro Santos
>            Assignee: Pedro Santos
>         Attachments: WICKET-3649-refactoring-fix-test.patch, WICKET-3649.patch
>
>
> Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3649.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-RC5

> ClassCastException when AbstractResource writes in response of some type other than WebResponse
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3649
>                 URL: https://issues.apache.org/jira/browse/WICKET-3649
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>            Reporter: Pedro Santos
>            Assignee: Martin Grigorov
>             Fix For: 1.5-RC5
>
>         Attachments: WICKET-3649-refactoring-fix-test.patch, WICKET-3649.patch
>
>
> Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (WICKET-3649) ClassCastException when AbstractResource writes in response of some type other than WebResponse

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-3649:
---------------------------------------

    Assignee: Martin Grigorov  (was: Pedro Santos)

> ClassCastException when AbstractResource writes in response of some type other than WebResponse
> -----------------------------------------------------------------------------------------------
>
>                 Key: WICKET-3649
>                 URL: https://issues.apache.org/jira/browse/WICKET-3649
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>            Reporter: Pedro Santos
>            Assignee: Martin Grigorov
>         Attachments: WICKET-3649-refactoring-fix-test.patch, WICKET-3649.patch
>
>
> Some times is usefull to write the resource in ByteArrayResponse to access the response bytes latter. An use case is ThumbnailImageResource accessing the wrapped resource image to first resize it and than write in response.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira