org.springframework.beans.factory.BeanCreationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • jpa with spring orm console application
    via Stack Overflow by Teja
    ,
  • Persistence transaction-type value?
    via Stack Overflow by pierre tautou
    ,
  • GitHub comment 33#54051685
    via GitHub by scanbit
    ,
  • Can't set up simple JPA
    via Stack Overflow by Amin
    ,
  • While developping, we had some table names generated by the naming strategy more than 64 chars. However, PostGRESQL truncate by default everything over the 63rd character. During the validation process of Hibernate (we have turned on <entry key="hibernate.hbm2ddl.auto" value="validate" /> in our spring configuration), the hibernate failed to validate because it's trying to match the long name (more than > 64chars) with the trunacted one. Here is an example of the stacktrace we have at the start of our application javax.persistence.PersistenceException: [PersistenceUnit: GHXPU] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:268) ~[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) ~[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] ... 39 common frames omitted Caused by: org.hibernate.HibernateException: Missing table: surgery_case_catalog_and_pricing_completion_after_item_list_assignation at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1272) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:500) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] ... 45 common frames omitted It seems something is wrong with the Dialect, the DatabaseMetadata or the Configuration.validateSchema method. As if there was a miss in using DatabaseMetadata.maxTableNameLength or something like that.
    via by Martin Braure de Calignon,
  • While developping, we had some table names generated by the naming strategy more than 64 chars. However, PostGRESQL truncate by default everything over the 63rd character. During the validation process of Hibernate (we have turned on <entry key="hibernate.hbm2ddl.auto" value="validate" /> in our spring configuration), the hibernate failed to validate because it's trying to match the long name (more than > 64chars) with the trunacted one. Here is an example of the stacktrace we have at the start of our application javax.persistence.PersistenceException: [PersistenceUnit: GHXPU] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:268) ~[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) ~[spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ~[spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE] ... 39 common frames omitted Caused by: org.hibernate.HibernateException: Missing table: surgery_case_catalog_and_pricing_completion_after_item_list_assignation at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1272) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:500) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744) ~[hibernate-core-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) ~[hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final] ... 45 common frames omitted It seems something is wrong with the Dialect, the DatabaseMetadata or the Configuration.validateSchema method. As if there was a miss in using DatabaseMetadata.maxTableNameLength or something like that.
    via by Martin Braure de Calignon,
  • java - Página não encontrada eclipse
    via by Unknown author,
    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build EntityManagerFactory at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:973) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:750) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at hu.daniel.hari.learn.spring.orm.main.SpringOrmMain.main(SpringOrmMain.java:16) Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:318) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) ... 12 more Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:97) at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:67) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:170) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77) at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2283) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2279) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1748) at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) ... 18 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    nasimknasimk
    2 times, last one,
    Unknown UserUnknown User
    8 times, last one,
    davidvanlaatumdavidvanlaatum
    5 times, last one,
    12 more bugmates