last day (15 days later) » 

16:49
0
Q: Unsatisfied dependency expressed through constructor parameter 2

JeyJI upgraded spring from version 2.1.1 to 2.2.0 . Since then I'm facing the following error when I start my app : Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'ParentService' available: expected single matching bean but found 2: MasterSer...

but I have the @Profile annotation that should help spring determine which bean to autowrite. As I mentioned, in version 2.1.1 it worked.
They are my own annotations , just simple interfaces with @profile annotation above them
same as MasterProfile, just a different name. Added it to the main post
What does Spring's logging print when the app starts? It should say "The following profiles are active:" followed by a list, very near the top, after the banner
"The following profiles are active: test,native." Which means it doesnt get the profile(master or slave). Something related to the way the profile is passed to spring
spring.profiles.include is not an application level argument. It is for including one profile in another, i.e. in a properties file. Change it to -Dspring-boot.run.jvmArguments=-Dspring.profiles.active=MAST‌​ER
but if I'll want to have multiple profiles activated ?
16:49
comma separated. -Dspring-boot.run.jvmArguments=-Dspring.profiles.active=MAST‌​ER,FOO,BAR
for example : -Dspring.profiles.active=profile_a,profile_b,profile_c ?
Yeah, that's right
Tried that also, but still I'm getting the same exception.
What does "The following profiles are active" say now
same thing : "The following profiles are active: test,native."
16:49
In fact, why are you using -D property for this in the first place? The plugin already has configuration for profiles docs.spring.io/spring-boot/docs/current/maven-plugin/…
hey
ahm I'm just trying to fix the issue that appeared
as I mentioned, I just wanted to upgrade spring to 2.2.0 from 2.1.1
the -D param was used , not I chose to use it
well now you have a good reason to change it
I saw the doc
so instead of using -D
I just need to write
<profiles>a,b,c ?
something like that ?
oh its in the properties file
16:53
in spring-boot-maven-plugin


<configuration>
<profiles>MASTER,whatever</profiles>
<!-- any other config -->
<configuration>
ahm
cant do such a change
need to try to understand how I can pass it via the -D flags
oh well, good luck then
understood
thank you for the help michael

last day (15 days later) »