Simple way to reproduce:
@Configuration @Import(OtherConfig.class) |
public class MyConfig { |
Before running webserver (Tomcat, Jetty, anything), remove the "WEB-INF/classes/somepackage/OtherConfig.class" file. Then run.
The reason is Spring tries to call .getAnnotations() on the MyConfig class. However since it has @Import which refers to non-existing class OtherConfig, it throws error. Which is a valid error, however....
Without any clue to which class Spring is processing, it's hard to diagnose this problem for the app developer. So Spring should catch the Exception thrown by .getAnnotations() and wrap it with an error describing the class it is processing.
Read full article from [SPR-10441] java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy exception when annotation config not found needs to specify what class is not found - Spring JIRA
No comments:
Post a Comment