Open gavvvr opened 8 years ago
prababely it is caused by InitializingBean but not the getter, may be you can have a try remove InitializingBean and keep getter
Encountered simmilar problem when trying to implement singleton
on @Configuration
class with @Getter
and @Setter
. In my case the following code causes StackOverflowError during annotation resolution on everything that tries to parse the code (java language server silently stops working, maven throws StackOverflowError
without details)
@Getter
@Setter
@Configuration
@ConfigurationProperties("app")
@Log4j
public class AppConfiguration {
// some members ...
// Adding this code will cause StackOverflow during resolution of annotations
private static AppConfiguration instance;
@Autowired
private void setInstance(AppConfiguration appConfiguration) {
AppConfiguration.instance = appConfiguration;
}
public static AppConfiguration getInstance() {
return instance;
}
}
Not sure if it is a bug of Spring boot annotation processor or lombok, anyways... I have the following class:
It causes StackOverflowError on compilation with
@ConfigurationProperties
annotation present (without it, compilation is successful).@ConfigurationProperties
is processed by Spring boot annotation processor and probably causes some conflict. Error is caused by@Getter
on static field. If i set@Getter
only forengineDir
property and leave@ConfigurationProperties
, compilation is successful too.Processing of
@ConfigurationProperties
annotation is performed with org.springframework.boot:spring-boot-configuration-processor