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”.

  • Docker-compose: Copying files from local env to EC2 instance
  • Packaging Docker on OpenWrt
  • Why doesn´t docker-compose env_file work but environment does?
  • change db:5432 to in docker-compose file
  • Missing Gemfile when using Docker on Heroku
  • What is Docker storage driver
  • 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)

  • Installing netstat on docker linux container
  • How to launch an app via Docker on every Pull Request?
  • Docker image created by Bazel does not have repository/tag, files are packed with strange names and do not run
  • Jupyter R crashes when plotting in docker container
  • Docker port mapping not working
  • Can't use yum inside Docker container running on CentOS
  • 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.