Doing Persistence under JBOSS

Just learnt EJB for half month. Just learnt how to create Entity class. When deploys, JBOSS always give me error. Now I found a solution, The problem is sometimes persistence.xml lost the XML Schema, the full persistence.xml can be like this:

<?xml version=”1.0″ encoding=”UTF-8″?>

<persistence
    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_1_0.xsd”
    version=”1.0″>
    <persistence-unit name=”calculator”>
    <jta-data-source>java:/DefaultDS</jta-data-source>
    <properties>
        <property name=”hibernate.hbm2ddl.auto” value=”create-drop” />
    </properties>
    </persistence-unit>
</persistence>

Hope anyone who faced this problem can solve your problem.

Author: fyhao

Jebsen & Jessen Comms Singapore INTI University College Bsc (Hon) of Computer Science, Coventry University

Leave a Reply