0

I was trying to deploy my application in one environment. The pod is going in crash back loop with the below error:

"mdc":{},"timestamp":"2021-06-01 09:38:03.582","level":"ERROR","logger":"org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter","message":"\n\n***************************\nAPPLICATION FAILED TO START\n***************************\n\nDescription:\n\nField bac in com.anjana.ms.anjana.ouseph.resources.services.implementation.anjanaValidator required a bean of type 'anjana.wrapper.IBAC' that could not be found.\n\nThe injection point has the following annotations:\n\t- @javax.inject.Inject()\n\n\nAction:\n\nConsider defining a bean of type 'anjana.wrapper.IBAC' in your configuration.\n","exception":""}

The application is getting successfully deployed in another environment, Why does it show two different behaviors in different environments, Jenkins build and Junits are running successfully.

Simon
  • 4,251
  • 2
  • 24
  • 34
Anjana Ouseph
  • 31
  • 2
  • 10

1 Answers1

1

Your spring-boot application cannot start successfully that's why kubernetes tries to restart and make it work but fails again..

A CrashloopBackOff means that you have a pod starting, crashing, starting again, and then crashing again.

You have a misconfiguration in your application, checkout similar problems like this 'Field required a bean of type that could not be found.' error spring restful API using mongodb

efdestegul
  • 617
  • 3
  • 6
  • Hi, the JUnits worked fine, Jenkins build is successful, and the pod was successfully deployed in another environment. If this was a code related issue it would have failed in Build stage and in the other environment as well where it worked fine. – Anjana Ouseph Jun 08 '21 at 15:53
  • 1
    In the error it says `Consider defining a bean of type 'anjana.wrapper.IBAC' in your configuration.` maybe you don't have that configuration in kubernetes? Double check it. – efdestegul Jun 08 '21 at 15:56