Case sensitivity issue in Spring application

I have been given a Java Spring application to containerize. I am using a Tomcat8/Java8 base image. When it boots, it fails to deploy with the following error:

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'controller3P' for bean class [com.******.******.brand3P.controller.Controller3P] conflicts with existing, non-compatible bean definition of same name and class [com.******.******.Brand3P.controller.Controller3P]

The problem here seems to that Spring is finding 2 conflicting classes, differentiated by “brand3P” and “Brand3P”.

  • Connection Refused Docker Run
  • Enable external network access from my docker swarm
  • npm install error with docker - kurento application
  • Sklearn parallel processing not working in docker container
  • How to deploy django 1.8 on Elastic Beanstalk using Docker
  • how to set file and dir permissions on docker when developing
  • However, in the source code, I can find no reference to a class “Brand3P”, only a class “brand3P”.

    Can anyone explain what Spring is doing here?

    (Be nice, I’m Ops, not Dev)

  • Deploy nginx official image, the volumn mount incorrectly
  • Connect from a Docker container to port of another docker container
  • Using Docker through proxy ssh error
  • How to configure docker-compose for storing data of Elastic search out-side of docker container?
  • Phalcon doesnt work properly on nginx
  • Docker workflow design with Jenkins on production
  • 2 Solutions collect form web for “Case sensitivity issue in Spring application”

    1. Package name should be all lower cased, checkout here oracle doc

    2. Package name is not included in spring definition name.

    3. My guess is someone changed the package name in Git, because git is by default case insensitive, so you will run into this situation, if it is this case, remove the file and create it again will fix this problem.

    4. Hi Ops, please work with Devs together 😉

    Turns out it was an issue with the build in Jenkins. The code had changed (Brand3P -> brand3P) but the older class name was hanging around in the Jenkins workspace, and being bundled into the Docker image.

    We deleted the workspace, re-ran the build, and all was fine.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.