Buggy code:
@ Controller @ Scope ( "request" ) public final class HeatmapWidgetController { public static final String EXPERIMENT_ATTRIBUTE = "experiment" ; private static final String ALL_SPECIES_ATTRIBUTE = "allSpecies" ; private static final String PUBMED_IDS_ATTRIBUTE = "pubMedIds" ; private static final String EXPERIMENT_DESCRIPTION_ATTRIBUTE = "experimentDescription" ; private static final String HAS_EXTRA_INFO_ATTRIBUTE = "hasExtraInfo" ; private static final String EXPERIMENT_TYPE_ATTRIBUTE = "type" ; private ApplicationProperties applicationProperties ; private SpeciesLookupService speciesLookupService ; private ExperimentTrader experimentTrader ; private final BaselineExperimentProfileSearchService baselineExperimentProfileSearchService ; private final BaselineExperimentProfilesViewModelBuilder baselineExperimentProfilesViewModelBuilder ; private AssayGroupFactorViewModelBuilder assayGroupFactorViewModelBuilder ; FilterFactorsConverter filterFactorsConverter = new FilterFactorsConverter ( ) ; @ Inject private HeatmapWidgetController ( ExperimentTrader experimentTrader , ApplicationProperties applicationProperties , SpeciesLookupService speciesLookupService , BaselineExperimentProfileSearchService baselineExperimentProfileSearchService , BaselineExperimentProfilesViewModelBuilder baselineExperimentProfilesViewModelBuilder , AssayGroupFactorViewModelBuilder assayGroupFactorViewModelBuilder ) { } @ RequestMapping ( { "//widgets//heatmap//protein" , "//widgets//heatmap//referenceExperiment" } ) public String dispatchWidget ( HttpServletRequest request , @ RequestParam ( value = "geneQuery" , required = true ) String bioEntityAccession , @ RequestParam ( value = "propertyType" , required = false ) String propertyType , @ RequestParam ( value = "species" , required = false ) String species , @ RequestParam ( value = "disableGeneLinks" , required = false ) boolean disableGeneLinks , @ ModelAttribute ( "preferences" ) @ Valid BaselineRequestPreferences preferences , Model model ) { try { if ( StringUtils . isBlank ( species ) ) { species = speciesLookupService . fetchFirstSpeciesByField ( propertyType , bioEntityAccession ) ; } } catch ( Exception e ) { model . addAttribute ( "errorMessage" , ( "No<seq2seq4repair_space>genes<seq2seq4repair_space>found<seq2seq4repair_space>matching<seq2seq4repair_space>query:<seq2seq4repair_space>" + bioEntityAccession ) ) ; return "widget-error" ; } <START_BUG> String experimentAccession = applicationProperties . getBaselineWidgetExperimentAccessionBySpecies ( species ) ; <END_BUG> if ( StringUtils . isEmpty ( experimentAccession ) ) { model . addAttribute ( "errorMessage" , ( "No<seq2seq4repair_space>baseline<seq2seq4repair_space>experiment<seq2seq4repair_space>for<seq2seq4repair_space>species<seq2seq4repair_space>" + species ) ) ; model . addAttribute ( "identifier" , bioEntityAccession ) ; return "widget-error" ; } Experiment experiment = experimentTrader . getPublicExperiment ( experimentAccession ) ; prepareModel ( request , model , experiment ) ; prepareModelForTranscripts ( model , species , experiment ) ; return ( "forward:" + ( getRequestURL ( request ) ) ) + ( buildQueryString ( species , experiment , disableGeneLinks ) ) ; } @ RequestMapping ( "//widgets//heatmap//bioentity" ) public String heatmapWidgetPage ( @ RequestParam ( value = "geneQuery" , required = true ) String bioEntityAccession , @ RequestParam ( value = "species" , required = false ) String species , @ RequestParam ( value = "propertyType" , required = false ) String propertyType , Model model ) { } @ RequestMapping ( "//widgets//heatmap//multiExperiment" ) public String multiExperimentJson ( @ RequestParam ( value = "geneQuery" , required = true ) String bioEntityAccession , @ RequestParam ( value = "species" , required = false ) String species , @ RequestParam ( value = "propertyType" , required = false ) String propertyType , Model model , HttpServletResponse response ) { } private void populateModelWithMultiExperimentResults ( String bioEntityAccession , String species , String propertyType , Model model ) { } private ImmutableSet < String > extractOntologyTerm ( SortedSet < AssayGroupFactor > filteredAssayGroupFactors ) { } private void addAnatomogram ( ImmutableSet < String > allSvgPathIds , Model model , String species ) { } private SortedSet < AssayGroupFactor > convert ( SortedSet < Factor > orderedFactors ) { } private void addJsonForHeatMap ( BaselineExperimentProfilesList baselineProfiles , SortedSet < AssayGroupFactor > filteredAssayGroupFactors , SortedSet < Factor > orderedFactors , Model model ) { } private void prepareModelForTranscripts ( Model model , String species , Experiment experiment ) { } private void prepareModel ( HttpServletRequest request , Model model , Experiment experiment ) { } private String getRequestURL ( HttpServletRequest request ) { } private String buildQueryString ( String species , Experiment experiment , boolean disableGeneLinks ) { } private void addFilterFactors ( String species , Experiment experiment , Model model ) { } @ ExceptionHandler ( { ResourceNotFoundException . class } ) @ ResponseStatus ( HttpStatus . NOT_FOUND ) public ModelAndView widgetSpecific404 ( Exception e ) { } }

Fix:
String experimentAccession = applicationProperties . getBaselineReferenceExperimentAccession ( species ) ;