• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

No active profile set, falling back to 1 default profile: "default" spring boot micro service messag

 
Ranch Hand
Posts: 964
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

While doing Jenkins build of spring boot 3 micro service rest messaging application getting below type of errors in Jenkins build console logs



No active profile set, falling back to 1 default profile: "default"



I have two profiles defined in application.yaml file namely LOCAL, OpenShift as below.




How to resolve these types of errors. Please advise.
 
Saloon Keeper
Posts: 15655
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error message is reasonably clear. You haven't told Spring which profile to activate. You normally do this using an environment variable or an application.properties file.

Do you know how to set environment variables in Jenkins?
 
sai rama krishna
Ranch Hand
Posts: 964
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. When Invoking the sonarqube from jenkins getting this error though. So far not passing any environment variables in jenkins to pass like LOCAL or openshift profiles. Ideally I have to pass openshift to resolve these issues.
 
Stephan van Hulst
Saloon Keeper
Posts: 15655
367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay. So have you tried setting environment variables in Jenkins for the stage that runs SonarQube?
 
sai rama krishna
Ranch Hand
Posts: 964
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is one test case under test class which I commented resolved this issue. Apparently that one test is causing this issue. Thank you.
 
Bartender
Posts: 2437
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sai,
I am curious. Why your test case is causing the problem?
 
sai rama krishna
Ranch Hand
Posts: 964
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This test class is like below written by someone else. I commented as below it all worked out well.
 
Himai Minh
Bartender
Posts: 2437
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am even more curious. That may tell me that your Spring boot context cannot be loaded during the test?
 
sai rama krishna
Ranch Hand
Posts: 964
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yea. I agree. As of now it is working fine. Due to JFROG security blockage lot of dependencies and versions keep getting blocked adding more challenges to development.
reply
    Bookmark Topic Watch Topic
  • New Topic