[jboss-user] [JBoss Seam] - Error while testing using external database
hubaghdadi
do-not-reply at jboss.com
Wed Jan 30 05:16:15 EST 2008
Hi.
I'm trying to write tests for my Seam application.
This application uses PostgreSQL database not HSQL.
Here are my configurations:
ArmadaBookStore-ds.xml:
| <datasources>
| <local-tx-datasource>
| <jndi-name>ArmadaSeamProjectDatasource</jndi-name>
| <connection-url>jdbc:postgresql:ArmadaBookStore</connection-url>
| <driver-class>org.postgresql.Driver</driver-class>
| <user-name>puser</user-name>
| <password>ppaswd</password>
| </local-tx-datasource>
| </datasources>
|
and hibernate.cfg.xml:
| <hibernate-configuration>
| <session-factory name="java:/ArmadaBookStore">
| <property name="connection.url">jdbc:postgresql:ArmadaBookStore</property>
| <property name="connection.username">puser</property>
| <property name="connection.password">ppaswd</property>
| <property name="connection.driver_class">org.postgresql.Driver</property>
| <property name="show_sql">true</property>
| <property name="connection.datasource">ArmadaSeamProjectDatasource</property>
| <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
| <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
| <property name="transaction.flush_before_completion">true</property>
| <property name="connection.release_mode">after_statement</property>
| <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
| <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
| <!-- mappings -->
| </session-factory>
| </hibernate-configuration>
|
Running the integration test, I got:
| Could not find datasource
|
| org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
| at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
| at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
| at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414)
| at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
| at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
| at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
| at org.jboss.seam.persistence.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:165)
| at org.jboss.seam.persistence.HibernateSessionFactory.startup(HibernateSessionFactory.java:79)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
| at org.jboss.seam.Component.callComponentMethod(Component.java:2074)
| at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
| at org.jboss.seam.Component.newInstance(Component.java:1968)
| at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
| at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
| at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
| at org.jboss.seam.init.Initialization.init(Initialization.java:555)
| at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:939)
| at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
| at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
| at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
| at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
| at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
| at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
| at org.testng.TestRunner.runWorkers(TestRunner.java:678)
| at org.testng.TestRunner.privateRun(TestRunner.java:624)
| at org.testng.TestRunner.run(TestRunner.java:495)
| at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
| at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
| at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
| at org.testng.SuiteRunner.run(SuiteRunner.java:190)
| at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
| at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
| at org.testng.TestNG.run(TestNG.java:699)
| at org.testng.TestNG.privateMain(TestNG.java:824)
| at org.testng.TestNG.main(TestNG.java:802)
| 1 lines not shown
| Caused by ArmadaSeamProjectDatasource not bound
|
I copied ArmadaBookStore-ds.xml to bootstrap/deploy dir, but I got the same exception.
Any ideas?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4124704#4124704
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4124704
More information about the jboss-user
mailing list