Spring boot errorjava.lang.ArrayStoreException sun.reflect.annotation.TypeNotPresentExceptionProxy
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy in a Spring Boot application usually points to a missing class referenced by an annotation. The exception looks strange because Java is trying to materialize annotation metadata through reflection, encounters a type that is not on the classpath, and then fails while storing a proxy object where a real class value was expected.
Understand what the error is really saying
The visible exception is often not the root problem. The real issue is usually one of these:
- an annotation references a class that no longer exists
- a dependency containing an annotation type or class value is missing
- compiled code and runtime classpath are out of sync
For example, this can happen with annotations that take Class<?> values, arrays of classes, or nested configuration types.
Look for the first missing-type clue in the stack trace
The stack trace often contains a more informative TypeNotPresentException or ClassNotFoundException deeper down. That missing class name is the key diagnostic detail.
Once you know which type is missing, work backward to the annotation or dependency that references it.
Typical causes in Spring Boot projects
A common pattern is refactoring code and removing or renaming a class that still appears in an annotation.
If LegacyHandler is deleted or removed from the runtime classpath, reflective annotation parsing can trigger the proxy-based failure.
Another common cause is version mismatch between modules. One module was compiled against a dependency that contained the class, while the runtime application starts with a different dependency set.
Clean and rebuild before deeper debugging
Because annotation metadata is compiled into class files, stale build output can keep old references alive.
If the error disappears after a clean rebuild, the runtime was likely using outdated compiled artifacts.
Check dependency alignment explicitly
Spring Boot projects with many starters or multi-module builds can drift into incompatible dependency sets. Inspect the resolved dependency graph and verify that the jar containing the missing class is present.
This is especially important after excluding transitive dependencies, changing starter versions, or moving code between modules.
Minimize the suspicious annotation surface
If the stack trace points near a specific configuration class, temporarily remove or simplify annotations there until the startup failure disappears. This is often faster than searching the whole codebase abstractly. Focus on annotations that accept class literals, arrays, imports, custom handlers, or framework extension points.
Common Pitfalls
- Treating
ArrayStoreExceptionas the real bug instead of looking for the missing type behind it. - Ignoring the deepest
Caused byentry that names the absent class. - Forgetting to clean and rebuild after annotation-bearing classes were renamed or deleted.
- Overlooking version mismatch across modules or starters in a multi-module Spring Boot build.
- Searching only application code when the missing annotation-referenced type actually came from a removed dependency.
Summary
- This error usually means an annotation references a class that is missing at runtime.
- The useful clue is deeper in the stack trace, often as
TypeNotPresentExceptionorClassNotFoundException. - Clean the build and verify dependency alignment before assuming Spring itself is broken.
- Inspect annotations that contain class literals or arrays of classes.
- Fix the missing type or classpath mismatch, and the proxy-related exception usually disappears.
Related reading
- Spring Boot extending CrudRepository
- Spring boot external application.properties
- Spring boot fails to load DataSource using PostgreSQL driver
- Spring Boot fails to run maven-surefire-plugin ClassNotFoundException org.apache.maven.surefire.booter.ForkedBooter
- Spring Boot /h2-console throws 403 with Spring Security 1.5.2
- Spring Boot Handler dispatch failed; nested exception is java.lang.NoSuchMethodError
- Spring Boot Getting Scheduled cron value from database
- Spring Boot gives TemplateInputException Error resolving template when running from jar

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.