{"record":{"id":"6de3e7ae007da004","repo":"theonedev/onedev","slug":"an-error-occurred-while-trying-to-set-the-collecti","errorCode":null,"errorMessage":"An error occurred while trying to set the collection attached to {formComponent}","messagePattern":"An error occurred while trying to set the collection attached to (.+?)","errorType":"exception","errorClass":"org.apache.wicket.WicketRuntimeException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java","lineNumber":1713,"sourceCode":"\t\t\tcatch (UnsupportedOperationException unmodifiable)\n\t\t\t{\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\"An error occurred while trying to modify the collection attached to \"\n\t\t\t\t\t\t\t+ formComponent, unmodifiable);\n\t\t\t\t}\n\t\t\t\tcollection = new ArrayList<>(convertedInput); \n\t\t\t}\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tformComponent.getModel().setObject(collection);\n\t\t\t}\n\t\t\tcatch (Exception noSetter)\n\t\t\t{\n\t\t\t\tif (!modified)\n\t\t\t\t{\n\t\t\t\t\tthrow new WicketRuntimeException(\"An error occurred while trying to set the collection attached to \"\n\t\t\t\t\t\t\t+ formComponent, noSetter);\n\t\t\t\t}\n\t\t\t\telse if (logger.isDebugEnabled())\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\"An error occurred while trying to set the collection attached to \"\n\t\t\t\t\t\t\t+ formComponent, noSetter);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tformComponent.modelChanged();\n\t\t}\n\t}\n}\n","sourceCodeStart":1695,"sourceCodeEnd":1727,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java#L1695-L1727","documentation":"When applying converted multi-select input, Wicket tries to set the collection on the component's model; if the model object rejects modification and has no usable setter, the failure is thrown as this WicketRuntimeException naming the form component.","triggerScenarios":"Thrown at server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java:1713 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a mutable collection type in the component's model.","Provide a working setter on the model object, or replace the model with a settable property."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}