Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6414

Form submit with scheduleRequestHandlerAfterCurrent break after download

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 7.5.0, 7.6.0
    • None
    • wicket
    • JBoss EAP 6.4

    Description

      Hello there Wicket Developers!

      We are currently working with Wicket 7.4 and have the following behavior.

      We have a form to download some report after fill some fields. This button and the fields are inside a Wicket Form.

      To do this we have a on submit this code.

      final AbstractResourceStreamWriter rstream = new AbstractResourceStreamWriter() {
                  @Override
                  public void write(final OutputStream output) throws IOException {
                      output.write(bytes);
                  }
      
                  @Override
                  public String getContentType() {
                      return contentType;
                  }
              };
      
              final ResourceStreamRequestHandler handler = new ResourceStreamRequestHandler(rstream)
                      .setFileName(downloadFileName)
                      .setCacheDuration(Duration.NONE)
                      .setContentDisposition(ContentDisposition.ATTACHMENT);
              RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
      

      The problem is after download if we want to export again or change any component which access model object throw this exception.

      at org.apache.wicket.core.util.lang.PropertyResolver$MethodGetAndSet.getValue(PropertyResolver.java:946) [wicket-core-7.6.0.jar:7.6.0]
      at org.apache.wicket.core.util.lang.PropertyResolver$ObjectWithGetAndSet.getValue(PropertyResolver.java:440) [wicket-core-7.6.0.jar:7.6.0]
      at org.apache.wicket.core.util.lang.PropertyResolver.getValue(PropertyResolver.java:117) [wicket-core-7.6.0.jar:7.6.0]
      at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:86) [wicket-core-7.6.0.jar:7.6.0]
      at org.apache.wicket.Component.getDefaultModelObject(Component.java:1646) [wicket-core-7.6.0.jar:7.6.0]
      ... 52 more
      Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_131]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_131]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_131]
      at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_131]
      at org.apache.wicket.core.util.lang.PropertyResolver$MethodGetAndSet.getValue(PropertyResolver.java:937) [wicket-core-7.6.0.jar:7.6.0]
      ... 56 more

      This work on wicket 7.4, but when we update to 7.5 or 7.6 throw this exception.

      Is like scheduleRequestHandlerAfterCurrent is not after but is right now on this versions.

      If you need more information just let me know.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vectorns Matías Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: