projectlombok/lombok · error

${element} ${message}

Error message

${element} ${message}

What it means

SpiProcessor.report raises a RuntimeException with '<element> <message>' because in Eclipse annotation processing round, printed Kind.ERROR messages are silently ignored, so the processor throws instead to surface the problem.

Solutions

  1. Read the thrown message: it names the element and the actual problem
  2. Fix the SPI provider declaration flagged in the message (implement the required interface, correct the class)
  3. Run the build outside Eclipse (javac/Gradle) to get the error as a normal diagnostic
  4. Check that the annotated class matches what the SPI annotation expects

Example fix

// before
@Provider(MyService.class)
public class MyImpl { }
// after
@Provider(MyService.class)
public class MyImpl implements MyService { }
Defensive patterns

Strategy: try-catch

Validate before calling

if (!typeElement.getInterfaces().stream().anyMatch(i -> i.toString().equals(providerInterface))) {
  throw new IllegalStateException("provider must implement " + providerInterface);
}

Try / catch

try { compileWithProcessor(); } catch (RuntimeException e) { if (e.getMessage().contains("simpleName") || wasThrownBySpiProcessor(e)) reportAsDiagnostic(e.getMessage()); else throw e; }

Prevention

When it happens

Trigger: handleProvidingElement detects an invalid @Provider-style SPI declaration (e.g. provider class not implementing the advertised interface) and calls report; under Eclipse this always throws.

Common situations: Using lombok's SPI annotation processor with a misdeclared service provider class; running annotation processing inside Eclipse where normal messaging fails.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of projectlombok/lombok@6d6a3e9fec (2026-09-07). Data as JSON: /api/errors/b98ff419bb353a87. Report an issue: GitHub.

Appendix: source

Thrown at src/spiProcessor/lombok/spi/SpiProcessor.java:247

	}
	
	private Name getQualifiedTypeName(AnnotationMirror mirror) {
		Element elem = mirror.getAnnotationType().asElement();
		if (!(elem instanceof TypeElement)) return null;
		return ((TypeElement) elem).getQualifiedName();
	}
	
	private TypeElement toElement(TypeMirror typeMirror) {
		if (typeMirror instanceof DeclaredType) {
			Element asElement = ((DeclaredType) typeMirror).asElement();
			if (asElement instanceof TypeElement) return (TypeElement) asElement;
		}
		return null;
	}
	
	private void report(Element elem, String message) {
		/* In eclipse, messages just seem to get ignored, so we throw instead. */
		if (Boolean.TRUE) throw new RuntimeException(elem.getSimpleName() + " " + message);
		processingEnv.getMessager().printMessage(Kind.ERROR, elem.getSimpleName() + " " + message, elem);
	}
	
	private String createProperQualifiedName(TypeElement provider) {
		return processingEnv.getElementUtils().getBinaryName(provider).toString();
	}
}

View on GitHub (pinned to 6d6a3e9fec)