Hibernate does not create tables in MySql.

spring-hibernate.xml

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd"> <tx:annotation-driven transaction-manager="transactionManager" /> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactoryBean" /> </bean> <bean id="sessionFactoryBean" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.hbm2ddl.auto">create</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.charSet">UTF-8</prop> </props> </property> <property name="packagesToScan"> <list> <value>az.inventar.model</value> </list> </property> 

spring-database.xml

 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="url" value="jdbc:mysql://localhost:3306/inventardb" /> <property name="username" value="root" /> <property name="password" value="123456" /> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> </bean> 

dispatcher-servlet.xml

 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd"> <context:annotation-config /> <context:component-scan base-package="az.inventar.*" /> <mvc:annotation-driven /> <import resource="spring-database.xml" /> <import resource="spring-hibernate.xml" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/" /> <property name="suffix" value=".jsp" /> </bean> 

multiple entities

 @Entity @Table(name = "branch") public class Branch { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private String name; @OneToOne(fetch = FetchType.LAZY) @PrimaryKeyJoinColumn private Employee employee; public Branch() { super(); // TODO Auto-generated constructor stub } public Branch(int id, String name, Employee employee) { super(); this.id = id; this.name = name; this.employee = employee; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Employee getEmployee() { return employee; } public void setEmployee(Employee employee) { this.employee = employee; } 

and

 @Entity @Table(name = "employee") public class Employee { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private String name; private String surname; @OneToOne @PrimaryKeyJoinColumn private Users user; @OneToOne(fetch = FetchType.LAZY, mappedBy = "branch", cascade = CascadeType.ALL) private Branch branch; @OneToMany(fetch = FetchType.LAZY, mappedBy = "equip", cascade = CascadeType.ALL) private List<Equip> equip; public Employee() { super(); // TODO Auto-generated constructor stub } public Employee(int id, String name, String surname, Users user, Branch branch, List<Equip> equip) { super(); this.id = id; this.name = name; this.surname = surname; this.user = user; this.branch = branch; this.equip = equip; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public Users getUser() { return user; } public void setUser(Users user) { this.user = user; } public Branch getBranch() { return branch; } public void setBranch(Branch branch) { this.branch = branch; } public List<Equip> getEquip() { return equip; } public void setEquip(List<Equip> equip) { this.equip = equip; } 

Hibernate logs:

10: 54: 58,515 INFO DispatcherServlet: 489 - FrameworkServlet 'dispatcher': initialization started 10: 54: 58,546 INFO XmlWebApplicationContext: 578 - Refreshing WebApplicationContext for namespace 'dispatcher-servlet': start date [Mon Apr 04 10:54:58 AZST 2016 ]; root of context hierarchy 10: 54: 58,612 INFO XmlBeanDefinitionReader: 317 - Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] 10: 54: 59,203 INFO XmlBeanDefinitionReader: 317 - Loading XML beanings fory [/WEB-INF/spring-database.xml] 10: 54: 59,241 INFO XmlBeanDefinitionReader: 317 - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-hibernate.xml] 10: 54: 59,952 INFO RequestMappingHandlerAdapter: 500 - Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Apr 04 10:54:58 AZST 2016]; root of context hierarchy 10: 55: 00,079 INFO RequestMappingHandlerAdapter: 532 - Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Apr 04 10:54:58 AZST 2016]; root of context hierarchy 10: 55: 00,245 INFO DriverManagerDataSource: 133 - Loaded JDBC driver: com.meql.jdbc.Driver 10: 55: 00,679 DEBUG BasicTypeRegistry: 146 - Adding type registration boolean -> org.hibernate.type.BooleanType@3f224 10: 55: 00,680 DEBUG BasicTypeRegistry: 146 - Adding type registration boolean -> org.hibernate.type.BooleanType@3f224eff 10: 55: 00,680 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Boolean -> org.hibernate.type .BooleanType @ 3f224eff 10: 55: 00,684 DEBUG BasicTypeRegistry: 146 — Adding type registration .TrueFalseType @ 7250b542 10: 55: 00,698 DEBUG BasicTypeRegistry: 146 - Adding type registration yes_no -> org.hibernate.type.YesNoType@19fb9663 10: 55: 00,706 DEBUG BasicTypeRegistry: 146 - Adding type creating, for example, for example, for example, for example, for example, for example, for example, for example, for example, for example. .ByteType @ 4cbbf7f4 10:55: 00,707 DEBUG BasicTypeRe gistry: 146 - Adding type registration byte -> org.hibernate.type.ByteType@4cbbf7f4 10: 55: 00,708 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Byte -> org.hibernate.type.ByteType@4cbbf7f4 10: 55: 00,712 DEBUG BasicTypeRegistry: 146 - Adding the type of registration character -> org.hibernate.type.CharacterType@19fb7a3c 10: 55: 00,712 DEBUG BasicTypeRegistry: 146 - Adding type registration char -> org.hibernate.type.CharacterType, 0, chartter, 0.hf. 55: 00,713 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Character -> org.hibernate.type.CharacterType@19fb7a3c 10: 55: 00,724 DEBUG BasicTypeRegistry: 146 - Adding type registration short -> org.hibernate. @ 3efdd686 10:55: 00,724 DEBUG BasicTypeRegistry: 146 - Adding type registration short-> org.hibernate.type.ShortType@3efdd686 10: 55: 00,725 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Short -> org.hibernate .type.ShortType @ 3efdd686 10: 55: 00,727 DEBUG BasicTypeRegistry: 146 - Adding type registrati on integer -> org.hibernate.type.IntegerType@6b38579e 10: 55: 00,727 DEBUG BasicTypeRegistry: 146 - Adding type registration int -> org.hibernate.type.IntegerType@6b38579e 10: 55: 00,727 DEBUG BasicTypeRegistry: 6: 06383879e 10: 55: 00,727 DEBUG registration java.lang.Integer -> org.hibernate.type.IntegerType@6b38579e 10: 55: 00,732 DEBUG BasicTypeRegistry: 146 - Adding type registration long -> org.hibernate.type.LongType@726c21e5 10: 55: 00.732 DEBUG BasicTypeTypeTypeType@726c21e5 10: 55: 00.732 146 - Adding type registration long -> org.hibernate.type.LongType@726c21e5 10: 55: 00,733 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Long -> org.hibernate.type.LongType@726c21e5 10:55: 00,738 DEBUG BasicTypeRegistry: 146 - Adding type registration float -> org.hibernate.type.FloatType@4ab9bc66 10: 55: 00,738 DEBUG BasicTypeRegistry: 146 - Adding type registration float -> org.hibernate.type.FloatType@4ab94cccFateType@4ab9cccfypeTypeRegistry: 146 00,739 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Float -> org.hibernate.type.FloatType@4ab9bc6 6 10: 55: 00,746 DEBUG BasicTypeRegistry: 146 - Adding type registration double -> org.hibernate.type.DoubleType@28031121 10: 55: 00,747 DEBUG BasicTypeRegistry: 146 - Adding type registration double -> org.hibernate.type.DoubleType @ 28031121 10: 55: 00,747 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Double -> org.hibernate.type.DoubleType@28031121 10: 55: 00,759 DEBUG BasicTypeRegistry: 146 - Adding type registration big_decimal -> org.hibernate. type.BigDecimalType@2ab937ac 10: 55: 00,759 DEBUG BasicTypeRegistry: 146 - Adding type registration java.math.BigDecimal -> org.hibernate.type.BigDecType@2ab937ac 10: 55: 00,764 DEBUG BasicTypeRegistry: 146 app ad rate: 146 app rate: 2b937ac 10: 55: 00,764 deBUG BasicTypeRegistryType@2ab937ac 10: 55: 00.764 org.hibernate.type.BigIntegerType@2b1390c9 10: 55: 00,765 DEBUG BasicTypeRegistry: 146 - Adding type registration java.math.BigInteger -> org.hibernate.type.BigIntegerType@2b1390c9 10: 55: 00,769 DEBUG BasicTyzeyTypeTypeType@2b1390c9 10: 55: 00.769 DEBUG BasicTypeTypeTypeType@2b1390c9 10: 55: 00.769 DEBUG BasicTypeTypeType@yb.ge registration string -> org.hibernate.type.StringType@6ec5f31 e 10: 55: 00,770 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.String -> org.hibernate.type.StringType@6ec5f31e 10: 55: 00,772 DEBUG BasicTypeRegistry: 146 - Adding type registration nstring -> org.hibernate. type.StringNVarcharType@194b899d 10: 55: 00,778 DEBUG BasicTypeRegistry: 146 - Adding type of registration ncharacter -> org.hibernate.type.CharacterNCharType@5177bcb 10: 55: 00,780 DEBUG BasicTypeRegistry: 16, 6 months, and it will be in the last 6 months; type.UrlType@28dbcc4d 10: 55: 00,781 DEBUG BasicTypeRegistry: 146 - Adding type registration java.net.URL -> org.hibernate.type.UrlType@28dbcc4d 10: 55: 00,788 DEBUG BasicTypeRegistry: 146 - Adding type registration date ->> org.hibernate.type.DateType@a33c98c 10: 55: 00,789 DEBUG BasicTypeRegistry: 146 - Adding type registration java.sql.Date -> org.hibernate.type.DateType@a33c98c 10: 55: 00,796 DEBUG BasicTypeRegistry: 146 - Adding type registration time -> org.hibernate.type.TimeType@49cda1d4 10:55: 00,796 DEBUG BasicTypeRegistry: 146 - Adding type registration java.sql.Time -> org.hibernate.type.TimeType@49cda1d4 10: 55: 00,804 DEBUG BasicTypeRegistry: 146 - Adding type registration timestamp -> org.hibernate.type.TimestampType@4b8fa058 10: 55: 00,804 DEBUG BasicTypeRegistry: 146 - Adding type registration java.sql.Timestamp -> org.hibernate.type.TimestampType@4b8fa058 10:55: 00,805 DEBUG BasicTypeRegistry: 146 - Adding type registration java.util.Date -> org.hibernate.type. TimestampType @ 4b8fa058 10:55: 00,807 DEBUG BasicTypeRegistry: 146 ->> iber iber h B B B B B B b b b b b b b b b b b b b 10: 55: 00,816 DEBUG BasicTypeRegistry: 146 Ad calendar calendar 10: 55: 00,816 DEBUG CalendarType @ 64b24f1 10:55:00 00 DEBUG BasicTypeRegistry: 146 - Adding type registration java.util.Calendar -> org.hibernate.type.CalendarType@64b24f1 10: 55: 00,817 DEBUG BasicTypeRegistry: 146 - Adding type registration java.util. -> org.hibernate.type.CalendarType@64b24f1 10:55: 00,825 DEBUG BasicTypeRegistry: 146 - Adding type registration calendar_date -> org.hibernate.type.CalendarDateType@49574f22 10: 55: 00,828 DEBUG BasicTypeRegistry: 146 - Adding type registration locale -> org.hibernate.type.LocaleType@6ebe10dd 10), you will be in the form of a 16: 15 in the submission of the following:, you will be in the form of the following: BasicTypeRegistry: 146 - Adding type registration java.util.Locale -> org.hibernate.type.docaleType@6ebe10dd 10:55:00 0031 DEBUG 55: 00,831 DEBUG BasicTypeRegistry: 146 - Adding type registration java.util.Currency -> org.hibernate.type.CurrencyType@386fd9f1 10: 55: 00,834 DEBUG BasicTypeRegistry: 146 - Adding type registration timezone -> org.hibernate.e. @ 4bb217b8 10:55: 00,834 DEBUG BasicTypeRegistry: 146 - Adding type registration java.util.TimeZone -> org.hibernate.type.TimeZoneType@4bb217b8 10: 55: 00,836 DEBUG BasicTypeRegistry: 146 - Adding type registration class chord 2017/8: 00.836 .type.ClassType @ fedb05d 10: 55: 00,836 DEBUG BasicTyp eRegistry: 146 - Adding type registration java.lang.Class -> org.hibernate.type.ClassType@fedb05d 10: 55: 00,843 DEBUG BasicTypeRegistry: 146 - Adding type registration uuid-binary -> org.hibernate.type.UUIDBinaryType@31eedb3 10:55: 00,843 DEBUG BasicTypeRegistry: 146 - Adding type registration java.util.UUID -> org.hibernate.type.UUIDBinaryType@31eedb3f 10:55: 00,844 DEBUG BasicTypeRegistry: 146 - Adding type registration uuid-char -> org.hibernate .type.UUIDCharType @ 63ba4c7c 10: 55: 00,846 DEBUG BasicTypeRegistry: 146 - Adding type registration pg-uuid -> org.hibernate.type.PostgresUUIDType@172d56f6 10: 55: 00,850 DEBUG BasicTypeRegistry 0, 556 00650 DEBUG BasicTypeRegistry 088.56 .hibernate.type.BinaryType @ 834f782 10:55: 00,851 DEBUG BasicTypeRegistry: 146 - Adding type registration byte [] -> org.hibernate.type.BinaryType@834f782 10: 55: 00,851 DEBUG BasicTypeRegistry: 146 - Adding type registration [B -> org.hibernate.type.BinaryType@834f782 10:55:00 00 DEBUG BasicTypeRegistry: 146 - Adding type reg istration wrapper-binary -> org.hibernate.type.WrapperBinaryType@3785babe 10: 55: 00,854 DEBUG BasicTypeRegistry: 146 - Adding type registration Byte [] -> org.hibernate.type.WrapperBinaryType@3785babe 10: 55: 00.855 and 5.85 we need you have to have the cost control settings in 146 - Adding type registration [Ljava.lang.Byte; -> org.hibernate.type.WrapperBinaryType@3785babe 10: 55: 00,857 DEBUG BasicTypeRegistry: 146 - Adding type registration image -> org.hibernate.type.ImageType@71c19bf7 10: 55: 00.865 DEBUG BasicTypeRegistry: 146 - 166 - 196 DEBUG BasicTypeRegistry: 146 - 166 DEBUG BasicTypeRegistry: 146 555 -> org.hibernate.type.CharArrayType@7b4ff56a 10: 55: 00,865 DEBUG BasicTypeRegistry: 146 - Adding type registration char [] -> org.hibernate.type.CharArrayType@7b4ff56a 10: 55: 00.865 DEBUG basicTypeypeypeypeypeypeypeypeypeype_rrayType@7b4ff56a 10: 55: 00: 75: 00: 15eytheypeArrayType@7b4ff56a registration [C -> org.hibernate.type.CharArrayType@7b4ff56a 10: 55: 00,867 DEBUG BasicTypeRegistry: 146 - Adding type registration wrap-characters -> org.hibernate.type.CharacterArrayType@277c2b4e 10: 55: 00.867; - Adding type registration [Ljava.lang.Character; -> org.hibernate.type.CharacterArrayType@277c2b4e 10: 55: 00,868 DEBUG BasicTypeRegistry: 146 - Adding type registration Character [] -> org.hibernate.type.CharacterArrayType@277c2b4e 10: 55: 00.872 DEGRA-17: -08: -10: 08: 17: 17/17/17/17/17 H.GARTrayArrayType@277c2b4e 10: 55: 00.872 DEGRAPH I use the current version. registration text -> org.hibernate.type.TextType@75e64723 10: 55: 00,873 DEBUG BasicTypeRegistry: 146 - Adding type of registration ntext -> org.hibernate.type.NTextType@54ff1aab 10: 55: 00,890 DEBUG registration blob -> org.hibernate.type.BlobType@7e1fa11d 10: 55: 00,891 DEBUG BasicTypeRegistry: 146 - Adding type of registration java.sql.Blob -> org.hibernate.type.BlobType@7e1fa11d10: 55: 00.892 DEBUG basicTypepeteype: 146 - Adding type registration materialized_blob -> org.hibernate.type.MaterializedBlobType@75fa563e 10: 55: 00,904 DEBUG BasicTypeRegistry: 146 - Adding type registration clob -> org.hibernate.type.ClobType@2a839255 I have not got the answer to you for the answer over: 146 - Adding type registration java.sql.Clob -> org.hibernate.type.Cl obType @ 2a8392b5 10: 55: 00,913 DEBUG BasicTypeRegistry: 146 - Adding type registration nclob -> org.hibernate.type.NClobType@772f11c2 10: 55: 00,914 DEBUG BasicTypeRegistry: 146 - Adding type registration java.sctl. d.ct.r.1414 DEBUG BasicTypeRegistry: 146 - Adding type registration java.s. o d.ct.d. hibernate.type.NClobType@772f11c2 10: 55: 00,914 DEBUG BasicTypeRegistry: 146 - Adding type registration materialized_clob -> org.hibernate.type.MaterializedClobType@5939eded6 10: 55: 00.915 DEBUG BasicTypeRegistry - 2008 and you will be using - in a mode that you should have been at your permission - 74. 55: 55: 00,915 DEBUG BasicTypeRegistryWD6TBype@5939fed6 hibernate.type.MaterializedNClobType@131dda2d 10: 55: 00,918 DEBUG BasicTypeRegistry: 146 - Adding type registration serialized -> org.hibernate.type.SerializableType@28c61629 10: 55: 00.927 DEBUG BasicTypeRegistry of 6460060029 10: 55: 00,927 DEBUG BasicTypeRegistry of 2660029; hibernate.type.ObjectType@6f14d1b5 10: 55: 00,927 DEBUG BasicTypeRegistry: 146 - Adding type registration java.lang.Object -> org.hibernate.type.ObjectType@6f14d1b5 10: 55: 00.928 DEBUG BasicTypeHegnthentmetmetmetmet-themethythemetmetHyrate@6f14d1b5 10: 55: 00.928 DEBUG BasicTypeHegnthmethemethemetheythemethypeHeology@yf@gf14d1b5 -> org.hibernate. type.AdaptedImmutableType@1f5198d0 10:55: 00,929 DEBUG BasicTypeRegistry: 146 - Adapter registration registration type imm_time -> org.hibernate.type.AdaptedImmutableType@26078fc0 10: 55: 00,929 DEBUG BasicTypeRegistryOn-the-way o-update-304, 4y.ac.tape.Type@26078fc0 10: 55: 00,929 DEBUG BasicTypeRegistryOn-the-file omethysthetoy642fc0 10 55 type.AdaptedImmutableType@3a6e99c1 10:55: 00,929 DEBUG BasicTypeRegistry: 146 - Adding registration number imm_dbtimestamp -> org.hibernate.type.AdaptedImmutableType@33306bdf 10: 55: 00,930 DEBUG BasicTyzestHystHytheSthyme@y3e99c1 10Br. type.AdaptedImmutableType@2ffa17ba 10:55: 00,930 DEBUG BasicTypeRegistry - 146 - Adding type registration imm_calendar_date -> org.hibernate. type.AdaptedImmutableType@4f9c0948 10: 55: 00,930 DEBUG BasicTypeRegistry: 146 - Type registration imm_serializable -> org.hibernate.type.AdaptedImmutableType@d257ecd 10: 55: 01,001 INFO Type: 66 - HCANN000001: Hibernate Commons Annotations {4.0.5.Final} 10: 55: 01,032 INFO Version: 54 - HHH000412: Hibernate Core {4.3.8.Final} 10: 55: 01,043 INFO Environment: 239 - HHH000206: hibernate.properties not found 10: 55: 01,047 INFO Environment: 346 - HHH000021: Bytecode provider name: javassist 10: 55: 01,983 INFO Dialect: 145 - HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 10: 55: 02.447 WARN XmlWebApplicationContext: 546 - Exception encountered during context initialization - canceling the refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with the name of the transaction resource defined in ServletContext resource [/WEB-INF/spring-hibernate.xml] 'sessionFactoryBean' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error created bean with session name session defined in ServletContext resource [/WEB-INF/spring-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: az.inventar.model.UserRoles 10: 55: 02,480 ERROR DispatcherServlet: 502 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error AC bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/spring-hibernate.xml]: Cannot be 'sessionFactoryBean' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error created bean with session name session defined in ServletContext resource [/WEB-INF/spring-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate. factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues ​​(AbstractAutowireCapableBeanFactory.java:1481) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( AbstractAutowireCapableBeanFactory.java:1226) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:482) at org .springframework.beans.factory.support.AbstractBeanFa ctory $ 1.getObject (AbstractBeanFactory.java:306) at org.springframework.pat.php.pdf.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java-Around30) at org.springframework.beans.factory.gf.sh. : 302) at org.springframework.beans.factory. context.support online to make it safe 668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext (FrameworkServlet.java:634) at org.spri ngfrcd java: 494) at org.springframework.web.servlet. (StandardWrapper.java:1231) at org.apache.catalina.core.StandardWrapper.loadServlet (StandardWrapper.java:1144) at org.apache.catalina.core.StandardWrapper.load (StandardWrapper.java:1031) at org.apache. catalina.core.StandardContext.loadOnStartup (StandardContext.java:4914) at org. 150) at org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java : 1408) at org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java:1398) at java.util.concurrent.FutureTask.run (FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor. runWorker (ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:615) at java.lang.Thread.run (Thread.java:745) Caused by: org.springframework.bels .factory.BeanCreationException: Error creating bean with sessionFactoryBean defined in ServletContext resource [/WEB-INF/spring-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate. AnnotationException: No identifier factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject (AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBehantus of ours of your own org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:197) at org.springframework.be ans.factory.support.BeanDefinitionValueResolver.resolveReference (BeanDefinitionValueResolver.javaUX51) ... 31 more Caused by: org.hibernate.AnnotationException: No identifier specified for entity: az.inventar.model.UserRoles at org.hiber.ir InheritanceState.determineDefaultAccessType (InheritanceState.java:277) at org.hibernate.cfg.InheritanceState.getElementsToProcess (InheritanceState.java:224) at org.hibernate.cfg.AnnotationBinder.bindChard our an account an account our account is an affiliate account of affection account. .Configuration $ MetadataSourceQueue.processAnnotatedClassesQueue (Configuration.java:3845) at org.hibernate.cfg.Configuration $ MetadataSourceQueue.processMetadata (Configuration.java:3799) at org.hibernate.cfg.Configuration.secondPass.cfcl.cfile.processMetadata (Configuration.java:3799) at org.hibernate.cfg. org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1846) at org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1930) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFa ctory (LocalSessionFactoryBuilder.javaUE72) at org.springframework.orm.hibernatee.e.l.kl.developed.developed.developed.developed.dept.developed.dept.dex.sexp.dex.edu.edu.dex.dex.sexpl.dex.sexp.dex.dex.dex.delirox.dex.sexp.dex.sexp.dex.sexp.dex.sexp.dex.sexp.dex.sexpx .beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1637) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactra.de.a.dash.a.rahhhhhhhhhhhhhf.pex.ab.abstractAutowireCapableBeanFactory.

Why are tables not created in the database?

The problem was solved by changing the bindings. Fields were not created due to annotations by @OneToMany and others.

Closed due to the fact that off-topic party Nick Volynkin 5 Apr '16 at 5:21 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Nick Volynkin
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Problem solved. The problem was in essence. - Farik013

2 answers 2

All in the logs.

Caused by: org.hibernate.AnnotationException: No identifier specified for entity: az.inventar.model.UserRoles at

You have a UserRoles class, marked with the @Entity annotation, but without a field playing the role of a primary key, with the @Id annotation.

  • Added '@Id' but nothing has changed - Farik013
 <prop key="hibernate.hbm2ddl.auto">true</prop> 

or

 <prop key="hibernate.hbm2ddl.auto">update</prop> 

In addition, not all fields are marked with annotations. Such as username and several others. Add: @JoinColumn(name="") And in one enterprise there are two primary key . Need to completely rewrite the connection.

  • Do I need to annotate all fields? Some suit me by default. And about the bindings, I tried without annotations (bindings), but the tables were not created anyway. - Farik013
  • @ Farik013 you first need to figure out how the hibernate works) - raviga
  • I deleted all entities and created one, without annotations. Everything worked, yet the problem was in the bindings. But even without annotations it works)) - Farik013
  • it works without annotation only if the field name is the same as the column name in the table. - raviga
  • I have no field and column. I want to create and without changing anything, so that he creates tables with the same name. - Farik013