0

I am new to spring boot project. Recently I was requested to add new functionalities to a spring boot project. I was given the source code of the project. Surprisingly, the pom.xml was missing in the project structure. Moreover, lib directory is missing. Not external .jar were provided.

How can I know the required version and suitable jar files without the pom.xml?

I was trying to add some related spring jar files, but unfortunately I can't run the spring application. Here's the error message:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

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

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.abc.abcXmlApiService.abcxmlapiserviceApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'emailValidator' for bean class [com.abc.web.validator.EmailValidator] conflicts with existing, non-compatible bean definition of same name and class [com.abc.admin.web.validator.EmailValidator]
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:181)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
    at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:61)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
    at com.abc.abcXmlApiService.abcxmlapiserviceApplication.main(abcxmlapiserviceApplication.java:25)
Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'emailValidator' for bean class [com.abc.web.validator.EmailValidator] conflicts with existing, non-compatible bean definition of same name and class [com.abc.admin.web.validator.EmailValidator]
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:348)
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:286)
    at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:287)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:242)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
    ... 13 more
8
  • Most likely the project uses Gradle instead of Maven. Is there a build.gradle file? Commented Nov 19, 2020 at 9:11
  • lib directory is missing ... a lib directory isn't mandatory, nor required.
    – Stultuske
    Commented Nov 19, 2020 at 9:13
  • 1
    There should not be a lib directory at all. Without a POM or build.gradle you cannot progress on this project. If there is no build file for maven or gradle you're screwed and need to talk to your manager. Commented Nov 19, 2020 at 9:21
  • @Jeroen Steenbeeke There are no any gradle build script (build.gradle) exist. Commented Nov 19, 2020 at 9:27
  • How about build.xml (Ant) or ivy.xml (Apache Ivy)? Bit of a long shot considering this is a Spring Boot project so I wouldn't expect anything other than Maven or Gradle Commented Nov 19, 2020 at 9:29

1 Answer 1

-1

The error message Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'emailValidator' for bean class [com.abc.web.validator.EmailValidator] conflicts with existing, non-compatible bean definition of same name and class [com.abc.admin.web.validator.EmailValidator] clearly indicates, emailValidator duplicates in your project, please cross check the name if any duplicates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.