{"record":{"id":"d02337b2840a4b7c","repo":"hibernate/hibernate-orm","slug":"error-creating-intermediate-context-intermediat","errorCode":null,"errorMessage":"Error creating intermediate context [${intermediateContextName}]","messagePattern":"Error creating intermediate context \\[(.+?)\\]","errorType":"exception","errorClass":"JndiException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java","lineNumber":198,"sourceCode":"\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 );\n\t\t\t\t}\n\n\t\t\t\tif ( intermediateContext != null ) {\n\t\t\t\t\tCORE_LOGGER.tracef( \"Found intermediate context: %s\", intermediateContextName );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tCORE_LOGGER.tracef( \"Creating subcontext: %s\", intermediateContextName );\n\t\t\t\t\ttry {\n\t\t\t\t\t\tintermediateContext = intermediateContextBase.createSubcontext( intermediateContextName );\n\t\t\t\t\t}\n\t\t\t\t\tcatch ( NamingException e ) {\n\t\t\t\t\t\tthrow new JndiException( \"Error creating intermediate context [\" + intermediateContextName + \"]\", e );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tintermediateContextBase = intermediateContext;\n\t\t\t\tname = name.getSuffix( 1 );\n\t\t\t}\n\t\t\tCORE_LOGGER.tracef( \"Binding: %s\", name );\n\t\t\ttry {\n\t\t\t\tintermediateContextBase.rebind( name, value );\n\t\t\t}\n\t\t\tcatch ( NamingException e ) {\n\t\t\t\tthrow new JndiException( \"Error performing intermediate bind [\" + name + \"]\", e );\n\t\t\t}\n\t\t}\n\t\tCORE_LOGGER.tracef( \"Bound name: %s\", name );\n\t}\n\n\t@Override\n\tpublic void unbind(String jndiName) {","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java#L180-L216","documentation":"Error \"Error creating intermediate context [${intermediateContextName}]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the intermediate JNDI context with proper permissions or pre-create it in the naming server","Verify the parent context exists and allows subcontext creation"],"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"}