hibernate/hibernate-orm · error · IllegalStateException

Found multiple BytecodeProvider service registrations, canno

Error message

Found multiple BytecodeProvider service registrations, cannot determine which one to use

What it means

Error "Found multiple BytecodeProvider service registrations, cannot determine which one to use" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/bytecode/internal/BytecodeProviderInitiator.java:68

		return getBytecodeProvider( ServiceLoader.load(
				BytecodeProvider.class,
				BytecodeProvider.class.getClassLoader()
		) );
	}

	@Internal
	@Nonnull
	public static BytecodeProvider getBytecodeProvider(@Nonnull Iterable<BytecodeProvider> bytecodeProviders) {
		final var iterator = bytecodeProviders.iterator();
		if ( !iterator.hasNext() ) {
			// If no BytecodeProvider service is available,
			// default to the "no-op" enhancer
			return new BytecodeProviderImpl();
		}
		else {
			final var provider = iterator.next();
			if ( iterator.hasNext() ) {
				throw new IllegalStateException(
						"Found multiple BytecodeProvider service registrations, cannot determine which one to use" );
			}
			return provider;
		}
	}
}

View on GitHub (pinned to fad1729dce)

Solutions

  1. Keep only one bytecode provider on the classpath (bytebuddy or none); remove the conflicting hibernate-bytecode provider dependency.

Example fix

Keep only one bytecode provider on the classpath (bytebuddy or none); remove the conflicting hibernate-bytecode provider dependency.

When it happens

Trigger: Bytecode enhancement, proxy creation, or lazy interception is applied to an incompatible class or configuration.

Common situations: Build-time enhancement with module-system restrictions, mismatched Hibernate versions between build and runtime, or hibernate.bytecode.provider=none with a model that needs proxies.


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