{"record":{"id":"6ed6b2197ed05a89","repo":"hibernate/hibernate-orm","slug":"error-performing-bind-name","errorCode":null,"errorMessage":"Error performing bind [${name}]","messagePattern":"Error performing bind \\[(.+?)\\]","errorType":"exception","errorClass":"JndiException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java","lineNumber":168,"sourceCode":"\t\tfinal Name name = parseName( jndiName, initialContext );\n\t\ttry {\n\t\t\tbind( name, value, initialContext );\n\t\t}\n\t\tfinally {\n\t\t\tcleanUp( initialContext );\n\t\t}\n\t}\n\n\tprivate void bind(Name name, Object value, Context context) {\n\t\ttry {\n\t\t\tCORE_LOGGER.tracef( \"Binding: %s\", name );\n\t\t\tcontext.rebind( name, value );\n\t\t}\n\t\tcatch ( Exception initialException ) {\n\t\t\t// We had problems doing a simple bind operation.\n\t\t\tif ( name.size() == 1 ) {\n\t\t\t\t// if the jndi name had only 1 component there is nothing more we can do...\n\t\t\t\tthrow new JndiException( \"Error performing bind [\" + name + \"]\", initialException );\n\t\t\t}\n\n\t\t\t// Otherwise, there is a good chance this may have been caused by missing intermediate contexts.  So we\n\t\t\t// attempt to create those missing intermediate contexts and bind again\n\t\t\tContext intermediateContextBase = context;\n\t\t\twhile ( name.size() > 1 ) {\n\t\t\t\tfinal String intermediateContextName = name.get( 0 );\n\n\t\t\t\tContext intermediateContext = null;\n\t\t\t\ttry {\n\t\t\t\t\tCORE_LOGGER.tracef( \"Intermediate lookup: %s\", intermediateContextName );\n\t\t\t\t\tintermediateContext = (Context) intermediateContextBase.lookup( intermediateContextName );\n\t\t\t\t}\n\t\t\t\tcatch ( NameNotFoundException handledBelow ) {\n\t\t\t\t\t// ok as we will create it below if not found\n\t\t\t\t}\n\t\t\t\tcatch ( NamingException e ) {\n\t\t\t\t\tthrow new JndiException( \"Unanticipated error doing intermediate lookup\", e );","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java#L150-L186","documentation":"Error \"Error performing bind [${name}]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the target context exists and is writable before binding","Check permissions and that the name is not already bound to an incompatible object"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}