Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled

Tags:

spring-boot

My Autoconfiguration file is not working in Spring-Boot application. I attach my configuration application file below:

@Configuration
@EnableAutoConfiguration
@ComponentScan
@SpringBootApplication
@EnableScheduling
public class Application {

  public static void main(String[] args) {
      SpringApplication springApplication=new SpringApplication(Application.class);
      System.out.println("Spring Core Version:- " + SpringVersion.getVersion());
      springApplication.run(args);

  }
}

Thrown Exception is below. How can I fix it?

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-01-19 14:50:06.085 ERROR 7614 --- [           main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; 
nested exception is java.lang.NoClassDefFoundError: org/hibernate/boot/archive/scan/spi/ScanEnvironment
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1589) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBectBeanFactory.java:302) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at com.track.io.Application.main(Application.java:35) [classes/:na]
like image 777
ayaz kodiya Avatar asked Jan 19 '17 09:01

ayaz kodiya


People also ask

How to display the conditions of an error starting applicationcontext?

Error Starting ApplicationContext. To Display The Conditions Report Re-Run Your Application with 'Debug' Enabled. - Programmer All Error Starting ApplicationContext. To Display The Conditions Report Re-Run Your Application with 'Debug' Enabled.

How do I fix error starting application context in Maven?

Error Starting ApplicationContext. To Display The Conditions Report Re-Run Your Application with 'Debug' Enabled. Finally, remember to refresh the Maven package! ! ! Restart the program.

How to display the conditions report in Spring Boot?

To display the conditions report re-run your application with 'debug' enabled in spring-boot - Stack Overflow Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled in spring-boot

Why can't I open the application in Spring Boot?

Sometimes in spring boot it happens when you use the same port twice. Make sure you have stopped the application running somewhere else or stop the opening port. Your answer could be improved with additional supporting information.


2 Answers

I solved it by myself.

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>5.0.7.Final</version>
</dependency>
like image 58
ayaz kodiya Avatar answered Oct 18 '22 20:10

ayaz kodiya


I added @Component annotation from import org.springframework.stereotype.Component and the problem was solved.

like image 43
menoktaokan Avatar answered Oct 18 '22 21:10

menoktaokan