[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: no persistent classes found for query class

igor007 do-not-reply at jboss.com
Wed May 6 15:37:49 EDT 2009


there are two files under src/META_INF/persistence.xml and web-hibernate.xml

persistence.xml is as below:

<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="bank" transaction-type="RESOURCE_LOCAL">     
      org.hibernate.ejb.HibernatePersistence
     <non-jta-data-source>java:/MSSQLDS</non-jta-data-source>
               
            
    
      
   </persistence-unit>


web-hibernate.xml

<?xml version="1.0" encoding="UTF-8"?>
<hibernate-configuration xmlns="urn:jboss:hibernate-deployer:1.0">
<session-factory name="hibernateJNDI" bean="jboss.har:service=Hibernate">
java:/hibernateJNDI
org.hibernate.dialect.SQLServerDialect
</session-factory>
</hibernate-configuration>

also there exists two hibernate xml files

one is hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory name="SessionFactoryName">
    true
  
    org.hibernate.dialect.SQLServerDialect 
    com.microsoft.sqlserver.jdbc.SQLServerDriver
    java:/MSSQLDS
    jdbc:sqlserver://localhost\SQLEXPRESS3:1433;DatabaseName=bank
    sa
    12345678 
     
</session-factory>
</hibernate-configuration>

User.hbm.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>







</hibernate-mapping>






                    




View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229168#4229168

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229168



More information about the jboss-user mailing list