java.lang.IllegalStateException: Failed to execute CommandLineRunner

Apache's JIRA Issue Tracker | Hendy Irawan | 1 year ago
  1. 0

    First form: (not working) {code:java} final Form<Void> form = new Form<>("form"); final ListModel<FileUpload> filesModel = new ListModel<>(); final FileUploadField fileFld = new FileUploadField("fileFld", filesModel); form.add(fileFld); final Model<GrayscaleMode> modeImageModel = new Model<>(GrayscaleMode.WHITE_ON_BLACK); final RadioChoice<GrayscaleMode> modeImage = new RadioChoice<>("modeImage", modeImageModel, ImmutableList.copyOf(GrayscaleMode.values())); form.add(modeImage); form.add(new AjaxButton("loadBtn2") { @Override protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) { super.onAfterSubmit(target, form); log.info("modeimageModel: {}", modeImageModel.getObject()); } }); add(form); {code} Second form: exactly same as above, but remove the fileUploadField. {code:java} final Form<Void> form2 = new Form<>("form2"); final Model<GrayscaleMode> modeImage2Model = new Model<>(GrayscaleMode.WHITE_ON_BLACK); final RadioChoice<GrayscaleMode> modeImage2 = new RadioChoice<>("modeImage2", modeImage2Model, ImmutableList.copyOf(GrayscaleMode.values())); form2.add(modeImage2); form2.add(new AjaxButton("loadBtn3") { @Override protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) { super.onAfterSubmit(target, form); log.info("modeimageModel: {}", modeImage2Model.getObject()); } }); add(form2); {code} Markup: {code} <form class="col-md-3" wicket:id="form"> <p><strong>Original</strong></p> <div> <input type="file" wicket:id="fileFld" accept="image/*"/> <p> <label>Mode</label>: <span wicket:id="modeImage"></span> </p> <button class="button" wicket:id="loadBtn2">Load Biasa</button> </div> </form> <form class="col-md-3" wicket:id="form2"> <p><strong>Original</strong></p> <div> <p> <label>Mode</label>: <span wicket:id="modeImage2"></span> </p> <button class="button" wicket:id="loadBtn3">Load 3</button> </div> </form> {code} With the non-working form, the request is multipart. This seems to cause all form components' model.getObject() become null. {noformat} POST /chaincode?0-1.IBehaviorListener.0-form-loadBtn2&wicket-ajax=true&wicket-ajax-baseurl=chaincode%3F0 HTTP/1.1 Host: localhost:8080 Connection: keep-alive Content-Length: 576 Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Origin: http://localhost:8080 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryv78rJ8mvP8YbHtBy Referer: http://localhost:8080/chaincode?0 Accept-Encoding: gzip, deflate Accept-Language: id,en-US;q=0.8,en;q=0.6,ms;q=0.4 Cookie: JSESSIONID=746B6931A8791427E02FCE5C1D20F1B7 ------WebKitFormBoundaryv78rJ8mvP8YbHtBy Content-Disposition: form-data; name="form3_hf_0" ------WebKitFormBoundaryv78rJ8mvP8YbHtBy Content-Disposition: form-data; name="fileFld"; filename="" Content-Type: application/octet-stream ------WebKitFormBoundaryv78rJ8mvP8YbHtBy Content-Disposition: form-data; name="modeImage" 0 ------WebKitFormBoundaryv78rJ8mvP8YbHtBy Content-Disposition: form-data; name="msgImage" ------WebKitFormBoundaryv78rJ8mvP8YbHtBy Content-Disposition: form-data; name="loadBtn2" 1 ------WebKitFormBoundaryv78rJ8mvP8YbHtBy-- {noformat} With the working form, the request is urlencoded form: {noformat} POST /chaincode?0-1.IBehaviorListener.0-form2-loadBtn3 HTTP/1.1 Host: localhost:8080 Connection: keep-alive Content-Length: 36 Origin: http://localhost:8080 Wicket-FocusedElementId: loadBtn32 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept: application/xml, text/xml, */*; q=0.01 X-Requested-With: XMLHttpRequest Wicket-Ajax: true Wicket-Ajax-BaseURL: chaincode?0 Referer: http://localhost:8080/chaincode?0 Accept-Encoding: gzip, deflate Accept-Language: id,en-US;q=0.8,en;q=0.6,ms;q=0.4 Cookie: JSESSIONID=746B6931A8791427E02FCE5C1D20F1B7 form21_hf_0=&modeImage2=0&loadBtn3=1 {noformat} "Probably" related with WICKET-5924, but I don't have issue with FileUploadField, my issue is with other form components in the same form as FileUploadField. Probably related to: http://stackoverflow.com/questions/28784942/fileupload-field-wicket-error *Test case:* {code} git clone https://github.com/tmdgitb/pengenalan_pola_shih.git -t WICKET-6002 {code} 1. Run {{DaemonApp}} 2. Go to "ChainCode" page 3. click "Load Biasa" on the left, you'll see "modeimageModel: null". --> not working: using FileUploadField + multipart 4. click "Load 3" on the right, you'll see "modeimageModel: WHITE_ON_BLACK" --> works: using urlencoded

    Apache's JIRA Issue Tracker | 1 year ago | Hendy Irawan
    java.lang.IllegalStateException: Failed to execute CommandLineRunner
  2. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.createIndexer()
    2. org.bytedeco.javacpp
      opencv_core$AbstractArray.createIndexer
      1. org.bytedeco.javacpp.helper.opencv_core$AbstractArray.createIndexer(opencv_core.java:175)
      2. org.bytedeco.javacpp.helper.opencv_core$AbstractArray.createIndexer(opencv_core.java:165)
      2 frames
    3. id.ac.itb
      PlatNomorApp.run
      1. id.ac.itb.sigit.pengenalanpola.ChainCodeWhiteConverter.getChainCode(ChainCodeWhiteConverter.java:49)
      2. id.ac.itb.sigit.pengenalanpola.PlatNomorApp.run(PlatNomorApp.java:58)
      2 frames
    4. Spring Boot
      SpringApplicationBuilder.run
      1. org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:673)
      2. org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:691)
      3. org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
      4. org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
      4 frames
    5. id.ac.itb
      PlatNomorApp.main
      1. id.ac.itb.sigit.pengenalanpola.PlatNomorApp.main(PlatNomorApp.java:32)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    7. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
      1 frame