java.lang.IllegalStateException: Failed to load ApplicationContext

GitHub | jaideepmehta | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    GitHub comment 7013#249978919

    GitHub | 6 months ago | wilkinsona
    java.lang.IllegalStateException: Failed to load ApplicationContext
  2. 0

    GitHub comment 7013#250065794

    GitHub | 6 months ago | jaideepmehta
    java.lang.IllegalStateException: Failed to load ApplicationContext
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    GitHub comment 5351#248987397

    GitHub | 6 months ago | jaideepmehta
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
  5. 0

    Perform failure analysis of DataSourceBeanCreationException

    GitHub | 1 year ago | wilkinsona
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 1: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException

      Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

      at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName()
    2. Spring Boot AutoConfigure
      DataSourceConfiguration$Tomcat.dataSource
      1. org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:229)
      2. org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:174)
      3. org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:42)
      4. org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat.dataSource(DataSourceConfiguration.java:53)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
      2. org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      7. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      8. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      9. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      11. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751)
      11 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
      2 frames
    6. Spring Boot
      SpringApplication.run
      1. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
      2. org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
      3. org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
      3 frames
    7. org.springframework.boot
      SpringBootContextLoader.loadContext
      1. org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:111)
      1 frame
    8. org.springframework.test
      DefaultCacheAwareContextLoaderDelegate.loadContext
      1. org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
      2. org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
      2 frames
    9. Spring TestContext
      DefaultTestContext.getApplicationContext
      1. org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
      1 frame
    10. org.springframework.boot
      SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance
      1. org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:47)
      1 frame
    11. Spring TestContext
      SpringJUnit4ClassRunner$1.runReflectiveCall
      1. org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
      2. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
      3. org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
      3 frames
    12. JUnit
      ReflectiveCallable.run
      1. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      1 frame
    13. Spring TestContext
      SpringJUnit4ClassRunner.runChild
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
      2. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
      3. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
      3 frames
    14. JUnit
      ParentRunner$2.evaluate
      1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      5 frames
    15. Spring TestContext
      RunAfterTestClassCallbacks.evaluate
      1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
      2 frames
    16. JUnit
      ParentRunner.run
      1. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      1 frame
    17. Spring TestContext
      SpringJUnit4ClassRunner.run
      1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
      1 frame
    18. JUnit4 Provider
      JUnit4Provider.invoke
      1. org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
      2. org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
      3. org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      4. org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
      4 frames
    19. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
      2. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
      3. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      3 frames