[jboss-user] [JBoss Seam] - Re: TestNG and Seam Documentation 12.1. Unit testing Seam co
gemel
do-not-reply at jboss.com
Wed Feb 7 10:50:19 EST 2007
I had this failure too and I could solve it I hope I can help you.
Dou you have a datasource defined in your persistence.xml file like this?
<jta-data-source>java:/SeamRcAdfDatasource</jta-data-source>
if yes --> Try this
1- Take the <jta-data-source> definition away from the persistence.xml file
2- As the test runs outside JBoss, the datasource you defined in xxx-ds.xml is not bound.
So you have to create the EntityManagerFactory like this:
HashMap<String, String> map = new HashMap<String, String>();
map.put("hibernate.show_sql", "true");
...
map.put("hibernate.hbm2ddl.auto", "create-drop");
map.put("hibernate.connection.driver_class", "oracle.jdbc.driver.OracleDriver");
map.put("hibernate.connection.username", "username");
map.put("hibernate.connection.password", "pwd");
map.put("hibernate.connection.url", "connectionUrl");
...
EntityManagerFactory emf = Persistence.createEntityManagerFactory("unitname", map);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012501#4012501
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012501
More information about the jboss-user
mailing list