hibernate/hibernate-orm · error · JndiException

Error performing unbind

Error message

Error performing unbind [${name}]

What it means

JndiServiceImpl.unbind wraps any exception raised by InitialContext.unbind for the parsed name — the name may not exist or the provider rejects the unbind. The cause holds the original exception.

Solutions

  1. Verify the name is bound before unbinding and that the context permits the operation
  2. Check the underlying NamingException cause
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/engine/jndi/internal/JndiServiceImpl.java:223 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/ae5d91dd268999b5. Report an issue: GitHub.

Appendix: source

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

			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 );
		}
	}

	@Override
	public void addListener(String jndiName, NamespaceChangeListener listener) {
		final var initialContext = buildInitialContext();
		final Name name = parseName( jndiName, initialContext );
		try {
			( (EventContext) initialContext ).addNamingListener( name, EventContext.OBJECT_SCOPE, listener );
		}
		catch (Exception e) {
			throw new JndiException( "Unable to bind listener to namespace [" + name + "]", e );
		}
		finally {
			cleanUp( initialContext );

View on GitHub (pinned to fad1729dce)