hibernate/hibernate-orm · error · JndiException

Error performing intermediate bind

Error message

Error performing intermediate bind [${name}]

What it means

After successfully creating intermediate contexts, the final rebind of the leaf name into the deepest context still failed with a NamingException. The cause carries the underlying provider error for the bind operation.

Solutions

  1. Ensure the intermediate context exists and the bind name is valid
  2. Check the underlying NamingException for details
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java:209 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/00c4c4f52c85399f. Report an issue: GitHub.

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java:209

				}
				else {
					CORE_LOGGER.tracef( "Creating subcontext: %s", intermediateContextName );
					try {
						intermediateContext = intermediateContextBase.createSubcontext( intermediateContextName );
					}
					catch ( NamingException e ) {
						throw new JndiException( "Error creating intermediate context [" + intermediateContextName + "]", e );
					}
				}
				intermediateContextBase = intermediateContext;
				name = name.getSuffix( 1 );
			}
			CORE_LOGGER.tracef( "Binding: %s", name );
			try {
				intermediateContextBase.rebind( name, value );
			}
			catch ( NamingException e ) {
				throw new JndiException( "Error performing intermediate bind [" + name + "]", e );
			}
		}
		CORE_LOGGER.tracef( "Bound name: %s", name );
	}

	@Override
	public void unbind(String jndiName) {
		final var initialContext = buildInitialContext();
		final Name name = parseName( jndiName, initialContext );
		try {
			initialContext.unbind( name );
		}
		catch (Exception e) {
			throw new JndiException( "Error performing unbind [" + name + "]", e );
		}
		finally {
			cleanUp( initialContext );
		}

View on GitHub (pinned to fad1729dce)