-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate not creating tables
PostPosted: Mon Jul 21, 2014 6:28 am 
Newbie

Joined: Mon Jul 21, 2014 6:19 am
Posts: 1
Hello,

I'm using Hibernate to create mysql tables automatically within a maven JBoss project. When I deploy I get this info msg:
13:48:24,415 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-7) HHH000206: hibernate.properties not found

and this error:
13:50:44,880 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mydb.my_table' doesn't exist


I've included these properties in my persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="primary">
<!-- If you are running in a production environment, add a managed
data source, the example data source is just for development and testing! -->
<jta-data-source>java:jboss/datasources/mydb</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>

and the appropriate dependencies in pom.xml:
hibernate-validator, hibernate-jpamodelgen, hibernate-validator-annotation-processor, hibernate-entitymanager and mysql-connector-java

the datastore is successfully bounded, but the tables are never created. What can I do?


One more info: I've deleted my *-ds.xml file under Deployed Resources/webapp/WEB-INF because it was causing two errors: Duplicate resources & Failed to process phase INSTALL of deployment *.war

I appreciate your help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.