hibernate/hibernate-orm · error · HibernateException

Produced proxy does not correctly implement…

Error message

Produced proxy does not correctly implement ProxyConfiguration

What it means

Post-conditions guard after instantiating a ByteBuddy-generated proxy: the instance cannot be narrowed to ProxyConfiguration (asProxyConfiguration() returned null), so the lazy-initializer interceptor cannot be injected. This indicates a bytecode-provider/proxy-generation defect or an incompatible proxy class; the faulty input is the generated proxy class for the entity.

Solutions

  1. Regenerate proxies with a compatible ByteBuddy/Hibernate version.
  2. Check for bytecode-provider version conflicts on the classpath.
Defensive patterns

Strategy: validation

When it happens

Trigger: A runtime precondition of the Hibernate API is violated.

Common situations: Occurs when application code or configuration does not satisfy the documented contract of the API being called.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/proxy/pojo/bytebuddy/ByteBuddyProxyFactory.java:80

	public HibernateProxy getProxy(
			Object id,
			SharedSessionContractImplementor session) throws HibernateException {
		final var interceptor = new ByteBuddyInterceptor(
				entityName,
				persistentClass,
				interfaces,
				id,
				getIdentifierMethod,
				setIdentifierMethod,
				componentIdType,
				session,
				overridesEquals
		);

		final var instance = getHibernateProxy();
		final var proxyConfiguration = instance.asProxyConfiguration();
		if ( proxyConfiguration == null ) {
			throw new HibernateException( "Produced proxy does not correctly implement ProxyConfiguration" );
		}
		proxyConfiguration.$$_hibernate_set_interceptor( interceptor );
		return instance;
	}

	private HibernateProxy getHibernateProxy() {
		final var internal = getHibernateProxyInternal();
		final var hibernateProxy = internal.asHibernateProxy();
		if ( hibernateProxy == null ) {
			throw new HibernateException( "Produced proxy does not correctly implement HibernateProxy" );
		}
		return hibernateProxy;
	}

	/**
	 * This technically returns a HibernateProxy, but declaring that type as the return
	 * type for the newInstance() action triggers an implicit case of type pollution.
	 * We therefore declare it as PrimeAmongSecondarySupertypes, and require the

View on GitHub (pinned to fad1729dce)