I'm having trouble with a Spring Boot app that is not loading a config class with 2 beans in it. The weird thing is that another config class in the same package gets loaded.
Both config classes have @Configuration
in them. The one that doesn't load also has a @ComponentScan(basePackages = {"com.example.package.in.jar"})
in it.
The base packages value refers to a package in a loaded jar file.
I'm using Gradle 3.4.1
, Spring Boot 1.5.3
. When I turn on Spring debugging, it shows the other config class being found and loaded, but it just skips over the other one. No exceptions are thrown - no errors at all.
It would be one thing if the code didn't run, but at least load the class or throw an error, but the log file that was created showed no errors.
@ComponentScan
from the one that doesn't load currently, does that fix it? What are you attempting to load with the@ComponentScan
with? (I'm assuming) Beans in a 3rd party lib? – Bwvolleyball@ComponentScan(basePackages = {"classpath*:com.example.package.in.jar"})
the*
means search in jars from classpath. – StanislavL@Configuration
on the class and inside@Bean
on a method that just returns a new instance of DummyClass. I put a break point on the return and the debugger broke there. But it still won't address the other class! – Les