hibernate/hibernate-orm · error · ParsingException

Illegal path '" + ctx.getText() + "'

Error message

Illegal path '" + ctx.getText() + "'

What it means

Error "Illegal path '" + ctx.getText() + "'" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java:5752

		}
	}


	// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Path structures

	@Override
	public SemanticPathPart visitPath(HqlParser.PathContext ctx) {
		final var syntacticDomainPath = ctx.syntacticDomainPath();
		final var generalPathFragment = ctx.generalPathFragment();
		if ( syntacticDomainPath != null ) {
			return visitPathContinuation( visitSyntacticDomainPath( syntacticDomainPath ), ctx.pathContinuation() );
		}
		else if ( generalPathFragment != null ) {
			return (SemanticPathPart) generalPathFragment.accept(this);
		}
		else {
			throw new ParsingException("Illegal path '" + ctx.getText() + "'");
		}
	}

	@Override
	public SemanticPathPart visitGeneralPathFragment(HqlParser.GeneralPathFragmentContext ctx) {
		return visitIndexedPathAccessFragment( visitSimplePath( ctx.simplePath() ), ctx.indexedPathAccessFragment() );
	}

	@Override
	public SemanticPathPart visitSyntacticDomainPath(HqlParser.SyntacticDomainPathContext ctx) {
		if ( ctx.treatedNavigablePath() != null ) {
			return visitTreatedNavigablePath( ctx.treatedNavigablePath() );
		}
		else if ( ctx.collectionValueNavigablePath() != null ) {
			return visitCollectionValueNavigablePath( ctx.collectionValueNavigablePath() );
		}
		else if ( ctx.mapKeyNavigablePath() != null ) {
			return visitMapKeyNavigablePath( ctx.mapKeyNavigablePath() );

View on GitHub (pinned to fad1729dce)

Solutions

  1. The path is illegal in this context. Verify the path exists on the entity and is used in a context that allows it.

When it happens

Trigger: A runtime precondition of the Hibernate query API is violated: Illegal path '" + ctx.getText() + "'

Common situations: Application code or configuration calls the query API in a way that violates its documented contract; the interpolated values in the message identify the offending input.


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