{"record":{"id":"11c565d748729b03","repo":"flowable/flowable-engine","slug":"baseurl-can-not-be-null","errorCode":null,"errorMessage":"baseUrl can not be null","messagePattern":"baseUrl can not be null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/AppRestUrlBuilder.java","lineNumber":57,"sourceCode":"    protected AppRestUrlBuilder() {\n    }\n\n    protected AppRestUrlBuilder(String baseUrl) {\n        this.baseUrl = baseUrl;\n    }\n\n    public String getBaseUrl() {\n        return baseUrl;\n    }\n\n    public String buildUrl(String[] fragments, Object... arguments) {\n        return new StringBuilder(baseUrl).append(\"/\").append(MessageFormat.format(StringUtils.join(fragments, '/'), arguments)).toString();\n    }\n\n    /** Uses baseUrl as the base URL */\n    public static AppRestUrlBuilder usingBaseUrl(String baseUrl) {\n        if (baseUrl == null) {\n            throw new FlowableIllegalArgumentException(\"baseUrl can not be null\");\n        }\n        if (baseUrl.endsWith(\"/\")) {\n            baseUrl = baseUrl.substring(0, baseUrl.length() - 1);\n        }\n        return new AppRestUrlBuilder(baseUrl);\n    }\n\n    /** Extracts the base URL from the request */\n    public static AppRestUrlBuilder fromRequest(HttpServletRequest request) {\n        return usingBaseUrl(ServletUriComponentsBuilder.fromServletMapping(request).build().toUriString());\n    }\n\n    /** Extracts the base URL from current request */\n    public static AppRestUrlBuilder fromCurrentRequest() {\n        return usingBaseUrl(ServletUriComponentsBuilder.fromCurrentServletMapping().build().toUriString());\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/AppRestUrlBuilder.java#L39-L75","documentation":"This FlowableIllegalArgumentException is thrown by taskNameIn(Collection) in HistoricTaskInstanceQueryImpl when a historic task query tries to use taskNameIn together with another name filter that is already set (taskName, taskNameLike, or taskNameLikeIgnoreCase). The query builder allows only one name-matching strategy per query, because the SQL would otherwise be ambiguous or contradictory. It is a fail-fast misuse check, not a runtime failure.","triggerScenarios":"Calling historicTaskInstanceQuery.taskNameIn(List.of(\"a\",\"b\")) after having previously called taskName(\"x\"), taskNameLike(\"x%\"), or taskNameLikeIgnoreCase(\"x%\") on the same query object (in either order).","commonSituations":"Building a query incrementally from optional user filters where both an exact-name list and a name/description search end up set; copying an existing query object and adding taskNameIn without clearing prior name criteria; merging two filter builders into one query.","solutions":["Remove the earlier taskName / taskNameLike / taskNameLikeIgnoreCase call so only taskNameIn is set.","If both filters are truly needed, run two queries (one per name criterion) and merge results in application code.","Restructure filter-building code so name criteria are mutually exclusive (e.g., else-if branches, or clear the field before calling taskNameIn)."],"exampleFix":"// before\nquery.taskNameLike(\"Report%\");\nquery.taskNameIn(List.of(\"Report A\", \"Report B\")); // throws\n\n// after\nquery.taskNameIn(List.of(\"Report A\", \"Report B\"));","handlingStrategy":"validation","validationCode":"boolean hasOtherNameFilter = query.getTaskName() != null || query.getTaskNameLike() != null || query.getTaskNameLikeIgnoreCase() != null;\nif (hasOtherNameFilter) {\n    throw new IllegalStateException(\"Use taskNameIn OR name filters, not both\");\n}\nquery.taskNameIn(names);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Encapsulate name filtering in one helper method that applies exactly one criterion","Never reuse a query object across unrelated filter sets; build a fresh query per request","Prefer adding exact values to the IN list instead of combining with taskName"],"tags":["flowable","query-builder","illegal-argument","mutually-exclusive-filters"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}