org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/budget/configs/DatabaseConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Class name must not be null

Stack Overflow | M.Sz | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Spring boot, mvc, hibernate and mysql configuration - sessionFactory error

    Stack Overflow | 5 months ago | M.Sz
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [com/budget/configs/DatabaseConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Class name must not be null
  2. 0

    Error in bean creation

    Stack Overflow | 8 months ago | Sp1
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/test/authflow/config/DatabaseConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Class name must not be null

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Class name must not be null

      at org.springframework.util.Assert.notNull()
    2. Spring Core
      ClassUtils.convertClassNameToResourcePath
      1. org.springframework.util.Assert.notNull(Assert.java:115)[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.util.ClassUtils.convertClassNameToResourcePath(ClassUtils.java:960)[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    3. Spring ORM
      LocalSessionFactoryBean.afterPropertiesSet
      1. org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.scanPackages(LocalSessionFactoryBuilder.java:282)[spring-orm-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:434)[spring-orm-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      9. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:732)[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      9 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    6. Spring Boot
      SpringApplication.run
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      3. org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      4. org.springframework.boot.SpringApplication.run(SpringApplication.java:315)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      5. org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      6. org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      6 frames
    7. com.budget
      HomeBudgetApplication.main
      1. com.budget.HomeBudgetApplication.main(HomeBudgetApplication.java:15)[classes/:na]
      1 frame