TestNG Fails with Seam-Gen Project
charliebarjel Jan 14, 2010 11:19 PMHi,
As per the seam framework documentation, (37.3.1 Configuration) it says that if I created my project using Seam-Gen, then it should be ready for Unit and Integration testing using TestNG.
However, I have been trying for over a week to get this to work and continue to fail.
I think the problem lies with my persistence.xml and datasource.
Do I need to copy the datasource xml file anywhere or do anything with it?
Or should I only have to run the 'test' target in the ANT script?
Please help.
Here is the stack trace I am getting when running the tests:
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State} persistence.units:unitName=koncentrator -> <UNKNOWN>{Described:** UNRESOLVED Demands 'jboss.jca:name=koncentratorDatasource,service=DataSourceBinding **} *** CONTEXTS IN ERROR: Name -> Error <UNKNOWN> -> ** UNRESOLVED Demands 'jboss.jca:name=koncentratorDatasource,service=DataSourceBinding ** at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576) at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559) at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128) at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) ... Removed 15 stack frames Click to hide stack frames org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State} persistence.units:unitName=koncentrator -> <UNKNOWN>{Described:** UNRESOLVED Demands 'jboss.jca:name=koncentratorDatasource,service=DataSourceBinding **} *** CONTEXTS IN ERROR: Name -> Error <UNKNOWN> -> ** UNRESOLVED Demands 'jboss.jca:name=koncentratorDatasource,service=DataSourceBinding ** at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576) at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559) at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128) at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) 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:607) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:417) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:154) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:88) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:284) at org.testng.SuiteRunner.run(SuiteRunner.java:204) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877) at org.testng.TestNG.runSuitesLocally(TestNG.java:842) at org.testng.TestNG.run(TestNG.java:751) at org.testng.TestNG.privateMain(TestNG.java:914) at org.testng.TestNG.main(TestNG.java:887)
Here is my test persistence xml file:
<?xml version="1.0" encoding="UTF-8"?> <!-- Persistence deployment descriptor for dev profile --> <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="koncentrator" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>koncentratorDatasource</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/> <property name="hibernate.hbm2ddl.auto" value="validate"/> <property name="hibernate.show_sql" value="false"/> <property name="hibernate.format_sql" value="true"/> <property name="hibernate.default_schema" value="CAIROTEST"/> <!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) --> <property name="hibernate.transaction.manager_lookup_class" value="@transactionManagerLookupClass@"/> </properties> </persistence-unit> </persistence>
Is it a problem with my datasource? What am i missing?
Thanks in advance.