<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    JBoss:EJB is not creating table in MySQL DB
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/gurubg">Gurubg G</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/580992#580992">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello Folks, </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have a strange problem, I am not receiving any error when I deploy my <a class="jive-link-external-small" href="http://www.coderanch.com/forums/f-11/EJB-JEE" target="_new">EJB</a> project to <a class="jive-link-external-small" href="http://www.coderanch.com/forums/f-63/JBoss" target="_new">JBoss</a> . I have a single entity bean defined and expecting it to be created in MySQL DB. But strangely I do not see any table created . Has anyone faced the same problem before ?</p><p>I am using Eclipse IDE, MySQL server 51.1 and JBoss 5.0.1 server..</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Please find the log attached&#160; .. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>And I am posting the configuration files I have used.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"><tbody><tr><th align="center" style="background-color: #6690bc;; border: 1px solid #000000;background-color: #6690bc;" valign="middle"><span style="color: #ffffff;"><strong>Peristence.xml</strong></span></th></tr><tr><td style="border: 1px solid #000000;"><p>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; </p><p><span>&lt;persistence version="2.0" xmlns="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence" target="_blank">http://java.sun.com/xml/ns/persistence</a><span>" </span></p><p><span>&#160;&#160; xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>" </span></p><p><span>&#160;&#160; xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence" target="_blank">http://java.sun.com/xml/ns/persistence</a><span> </span><a class="jive-link-external-small" href="http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" target="_blank">http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd</a><span>"&gt;</span></p><p> &lt;persistence-unit name="LessonDS-PU" transaction-type="JTA"&gt;</p><p> &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;</p><p>&#160; &lt;jta-data-source&gt;java:/lessonds&lt;/jta-data-source&gt; </p><p>&#160; &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;</p><p>&#160;&#160;&#160; &lt;properties&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;property name="hibernate.hbm2ddl.auto" value="create-drop"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/&gt; </p><p>&#160;&#160;&#160; &lt;/properties&gt;</p><p>&#160; &lt;/persistence-unit&gt;</p><p>&lt;/persistence&gt;</p></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"><tbody><tr><th align="center" style="background-color: #6690bc;; border: 1px solid #000000;background-color: #6690bc;" valign="middle"><span style="color: #ffffff;"><strong>mysql-ds.xml</strong></span></th></tr><tr><td style="border: 1px solid #000000;"><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;!-- $Id: mysql-ds.xml 41017 2006-02-07 14:26:14Z acoliver $ --&gt;</p><p>&lt;!--&#160; Datasource config for MySQL using 3.0.9 available from:</p><p><a class="jive-link-external-small" href="http://www.mysql.com/downloads/api-jdbc-stable.html" target="_blank">http://www.mysql.com/downloads/api-jdbc-stable.html</a></p><p>--&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;datasources&gt; </p><p>&#160; &lt;local-tx-datasource&gt; </p><p>&#160; &lt;jndi-name&gt;lessonds&lt;/jndi-name&gt; </p><p>&#160; &lt;connection-url&gt;jdbc:mysql://localhost:3306/lessonds&lt;/connection-url&gt; </p><p>&#160; &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt; </p><p>&#160; &lt;user-name&gt;root&lt;/user-name&gt; </p><p>&#160; &lt;password&gt;guru&lt;/password&gt; </p><p>&lt;!--&#160;&#160;&#160; &lt;connection-property name="autoReconnect"&gt;true&lt;/connection-property&gt; --&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160; &lt;metadata&gt; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;type-mapping&gt;mySQL&lt;/type-mapping&gt; </p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/metadata&gt; </p><p>&#160;&#160;&#160; &lt;/local-tx-datasource&gt; </p><p>&lt;/datasources&gt; </p></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have placed the DB conenctor file mysql-connector-java-5.1.14-bin.jar in \server\default\lib folder .. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is my code for Entity which I am trying to create </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"><tbody><tr><th align="center" style="background-color: #6690bc;; border: 1px solid #000000;background-color: #6690bc;" valign="middle"><span style="color: #ffffff;"><strong>Entity bean</strong></span></th></tr><tr><td style="border: 1px solid #000000;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>package com.lessonejb.entities;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import java.io.Serializable;</p><p>import java.util.Set;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import javax.persistence.CascadeType;</p><p>import javax.persistence.Entity;</p><p>import javax.persistence.GeneratedValue;</p><p>import javax.persistence.Id;</p><p>import javax.persistence.ManyToMany;</p><p>import javax.persistence.Table;</p><p>import javax.persistence.OneToMany;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>//@SuppressWarnings("serial")</p><p>@Entity</p><p>@Table(name="lessonuser")</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>public class User implements Serializable {</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private static final CascadeType[] ALL = null;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private String email;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private String password;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private String name;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private String surname;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private int role;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private long userID;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private Set &lt;Course&gt; coursesCreated;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private Set &lt;Course&gt; coursesEnrolled;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private Set &lt;Test&gt; testsCreated;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;private Set &lt;Test&gt; testsTaken;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/**</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; * Gets the analysis unique identifier.</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; * This field is used as primary key for persistence.</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; * @return analysis unique identifier</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; */</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;@Id</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public String getEmail()</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return email;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/**</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; * Sets the analysis unique identifier</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; * @param id unique identifier to set</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; */</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void setEmail(String email)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.email = email;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/** Password */</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public String getPassword()</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return password;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void setPassword(String email)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.password = password;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/** Name of the user */</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public String getName()</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return name;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void setName(String name)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.name = name;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/** Surname of the user */</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public String getSurname()</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return surname;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void setSurname(String surname)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.surname = surname;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/** Role of the user 1-Trainer, 2-Trainee, 3-Assistant*/</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public int getRole()</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return role;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void setRole(int role)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.role = role;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;/** Role of the user 1-Trainer, 2-Trainee, 3-Assistant*/</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public long getUserID()</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return userID;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;public void setUserID(long userID)</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;{</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.userID = userID;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;}</p>}</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But I do not see any table named "lessonuser" created in the "lessonds" database. </p><p>Can someone point out if I am going wrong somewhere ? </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks in advance .. </p><p>Guru</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/580992#580992">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>