Buggy code:
@ AuthorizeInstantiation ( { "ROLE_USER" , "ROLE_EXPERIMENTER" , "ROLE_ADMIN" } ) public class ExperimentFormPage extends MenuPage { private static final long serialVersionUID = 5729268495591680609L ; private Log log = LogFactory . getLog ( getClass ( ) ) ; @ SpringBean private ExperimentsFacade facade ; @ SpringBean private FileFacade fileFacade ; public ExperimentFormPage ( ) { } public ExperimentFormPage ( PageParameters parameters ) { } private void setupComponents ( final Model < Experiment > model ) { final ListModel < FileUpload > fileModel = new ListModel < FileUpload > ( new ArrayList < FileUpload > ( ) ) ; ComponentFeedbackMessageFilter filter = new ComponentFeedbackMessageFilter ( this ) ; getFeedback ( ) . setFilter ( filter ) ; WizardModel wizardModel = new WizardModel ( ) ; wizardModel . add ( new cz . zcu . kiv . eegdatabase . wui . ui . experiments . forms . wizard . AddExperimentScenarioForm ( model ) ) ; wizardModel . add ( new cz . zcu . kiv . eegdatabase . wui . ui . experiments . forms . wizard . AddExperimentEnvironmentForm ( model ) ) ; wizardModel . add ( new cz . zcu . kiv . eegdatabase . wui . ui . experiments . forms . wizard . AddExperimentResultsForm ( fileModel ) ) ; Wizard wizard = new Wizard ( "wizard" , wizardModel , false ) { private static final long serialVersionUID = 1L ; @ Override public void onFinish ( ) { Experiment experiment = model . getObject ( ) ; ResearchGroup group = experiment . getResearchGroup ( ) ; if ( ( group != null ) && ( group . isLock ( ) ) ) { this . error ( ResourceUtils . getString ( "text.group.lock.experiment.create" , group . getTitle ( ) ) ) ; setResponsePage ( getPage ( ) ) ; return ; } Set < DataFile > files = new HashSet < DataFile > ( ) ; try { List < FileUpload > fileUploadList = fileModel . getObject ( ) ; if ( fileUploadList . isEmpty ( ) ) { <START_BUG> this . error ( "required.dataFile" ) ; <END_BUG> setResponsePage ( getPage ( ) ) ; return ; } for ( FileUpload fileUpload : fileUploadList ) { DataFile file = new DataFile ( ) ; file . setMimetype ( fileUpload . getContentType ( ) ) ; file . setFilename ( fileUpload . getClientFileName ( ) ) ; file . setFileContentStream ( fileUpload . getInputStream ( ) ) ; files . add ( file ) ; } } catch ( Exception ex ) { error ( "File<seq2seq4repair_space>saving<seq2seq4repair_space>failed" ) ; log . error ( ex . getMessage ( ) , ex ) ; } Person logged = EEGDataBaseSession . get ( ) . getLoggedUser ( ) ; experiment . setPersonByOwnerId ( logged ) ; Integer id = experiment . getExperimentId ( ) ; if ( ( experiment . getExperimentId ( ) ) != 0 ) facade . update ( experiment ) ; else id = facade . create ( experiment ) ; Experiment read = facade . read ( id ) ; for ( DataFile file : files ) { file . setExperiment ( experiment ) ; fileFacade . create ( file ) ; } setResponsePage ( ExperimentsDetailPage . class , PageParametersUtils . getDefaultPageParameters ( id ) ) ; } @ Override protected Component newFeedbackPanel ( String id ) { ComponentFeedbackMessageFilter filter = new ComponentFeedbackMessageFilter ( this ) ; return new org . apache . wicket . markup . html . panel . FeedbackPanel ( id , filter ) ; } @ Override protected Component newButtonBar ( String id ) { return new AjaxWizardButtonBar ( id , this ) ; } @ Override public void onCancel ( ) { throw new org . apache . wicket . RestartResponseAtInterceptPageException ( ExperimentsDetailPage . class , getPageParameters ( ) ) ; } } ; add ( wizard ) ; } @ Override public void renderHead ( IHeaderResponse response ) { } private int parseParameters ( PageParameters parameters ) { } }

Fix:
this . error ( ResourceUtils . getString ( "required.dataFile" ) ) ;