[jboss-user] [JBoss Seam] - Re: PersistenceException during testNG unit test
asookazian
do-not-reply at jboss.com
Wed Jan 24 17:54:53 EST 2007
problem resolved by moving persistence.xml around into various folders in Eclipse.
now getting HibernateException: could not find datasource. I am referencing the persistence unit (Entity Manager) as follows:
@Configuration(beforeTestClass=true)
| public void init()
| {
| emf = Persistence.createEntityManagerFactory("RSDB");
| }
|
| The name of the datasource file is "loantrack-ds.xml" and is as follows:
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <datasources>
| <local-tx-datasource>
| <jndi-name>jdbc/RespaJbossDS</jndi-name>
| <jndi-name>java:jdbc/RespaJbossDS</jndi-name>
| <connection-url>jdbc:JSQLConnect://d-rtl-db-01:2233/database=RSDB/user-name=process-jboss/password=pjss986sPROD</connection-url>
| <driver-class>com.jnetdirect.jsql.JSQLDriver</driver-class>
| <user-name>process-jboss</user-name>
| <password>pjss986sPROD</password>
| </local-tx-datasource>
| </datasources>
|
| persistence.xml as follows:
|
| <?xml version="1.0" encoding="UTF-8"?>
| <persistence>
| <persistence-unit name="RSDB">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:jdbc/RespaJbossDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| <property name="hibernate.show_sql" value="true"/>
| <!-- These are the default for JBoss EJB3, but not for HEM: -->
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
| <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
| </properties>
| </persistence-unit>
| </persistence>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006067#4006067
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006067
More information about the jboss-user
mailing list