{"record":{"id":"f8a4cd58c41bc0bd","repo":"testcontainers/testcontainers-java","slug":"database-name-cannot-be-set-to-xepdb1","errorCode":null,"errorMessage":"Database name cannot be set to xepdb1","messagePattern":"Database name cannot be set to xepdb1","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java","lineNumber":176,"sourceCode":"    }\n\n    @Override\n    public OracleContainer withPassword(String password) {\n        if (StringUtils.isEmpty(password)) {\n            throw new IllegalArgumentException(\"Password cannot be null or empty\");\n        }\n        this.password = password;\n        return self();\n    }\n\n    @Override\n    public OracleContainer withDatabaseName(String databaseName) {\n        if (StringUtils.isEmpty(databaseName)) {\n            throw new IllegalArgumentException(\"Database name cannot be null or empty\");\n        }\n\n        if (DEFAULT_DATABASE_NAME.equals(databaseName.toLowerCase())) {\n            throw new IllegalArgumentException(\"Database name cannot be set to \" + DEFAULT_DATABASE_NAME);\n        }\n\n        this.databaseName = databaseName;\n        return self();\n    }\n\n    public OracleContainer usingSid() {\n        this.usingSid = true;\n        return self();\n    }\n\n    @Override\n    public OracleContainer withUrlParam(String paramName, String paramValue) {\n        throw new UnsupportedOperationException(\"The Oracle Database driver does not support this\");\n    }\n\n    @SuppressWarnings(\"SameReturnValue\")\n    public String getSid() {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/oracle-xe/src/main/java/org/testcontainers/containers/OracleContainer.java#L158-L194","documentation":"withDatabaseName rejects the value \"xepdb1\" (case-insensitive). xepdb1 is the default pluggable database name the Oracle XE container creates itself; overriding it would clash with the container's internal setup, so the library throws IllegalArgumentException.","triggerScenarios":"Calling container.withDatabaseName(\"xepdb1\") or withDatabaseName(\"XEPDB1\").","commonSituations":"Developers seeing the default DB name in the JDBC URL and trying to set it explicitly; migrating config that hardcoded the default from another environment.","solutions":["Choose a different custom database name, e.g. withDatabaseName(\"mydb\")","Remove the withDatabaseName call entirely — xepdb1 is already the default","If the JDBC URL must reference xepdb1, just use the container's default URL"],"exampleFix":"// before\ncontainer.withDatabaseName(\"xepdb1\");\n// after\ncontainer.withDatabaseName(\"mydb\"); // or drop the call","handlingStrategy":"validation","validationCode":"if (\"xepdb1\".equalsIgnoreCase(dbName)) throw new IllegalArgumentException(\"xepdb1 is reserved as the default Oracle XE PDB name\");","typeGuard":"boolean isReservedOracleDbName(String n) { return n != null && \"xepdb1\".equalsIgnoreCase(n); }","tryCatchPattern":"try { container.withDatabaseName(name); } catch (IllegalArgumentException e) { container.withDatabaseName(\"customdb\"); }","preventionTips":["Remember Testcontainers creates its own non-default PDB; don't echo the default back","Treat xepdb1 as reserved in config validation","Drop withDatabaseName when you just want the default"],"tags":["oracle","testcontainers","validation","reserved-words"],"backgroundTag":"invalid-argument-value","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}