sixeyed / diamol

Code samples for the book "Learn Docker in a Month of Lunches"
https://www.manning.com/books/learn-docker-in-a-month-of-lunches
Creative Commons Attribution Share Alike 4.0 International
497 stars 263 forks source link

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans #10

Open eliassal opened 4 years ago

eliassal commented 4 years ago

Hi Elton, I followed instructions in the book for creating the container image-of-the-day(windows 10), when I issue the command

docker container run --name iotd -d -p 3000:80 --network nat image-of-the-day

Container starts and stops, in the logs, I can see the following error:

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.1.3.RELEASE)

2020-06-05 19:49:02.733 INFO 1384 --- [ main] iotd.Application : Starting Application v0.1.0 on 97c574e91764 with PID 1384 (C:\app\iotd-service-0.1.0.jar started by ContainerUser in C:\app) 2020-06-05 19:49:02.733 INFO 1384 --- [ main] iotd.Application : No active profile set, falling back to default profiles: default 2020-06-05 19:49:03.077 WARN 1384 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [iotd.Application]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'imageController' for bean class [iotd.ImageController] conflicts with existing, non-compatible bean definition of same name and class [iotd.controllers.ImageController] 2020-06-05 19:49:03.562 ERROR 1384 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [iotd.Application]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'imageController' for bean class [iotd.ImageController] conflicts with existing, non-compatible bean definition of same name and class [iotd.controllers.ImageController]

I am not a Java expert, can you help please, here is a snaphot diamol

aswro commented 2 years ago

I am also running into the same issue. were you able to address it?

eliassal commented 2 years ago

Not really, since no response from Elton, I did not follow