help with Maven 2 and SeamTest (part 2)
bsmithjj Jun 27, 2006 3:00 PMHello,
I have had some success in getting SeamTest tests to run under maven 2. However, now, when SeamTest tries to load the JBoss Microcontainer, it complains that it cannot find embedded-jboss-beans.xml. Here is the exception:
14:41:36,499 DEBUG org.jboss.seam.Component.(debug:84) - instantiating Seam component: org.jboss.seam.core.ejb 14:41:36,499 INFO org.jboss.seam.core.Ejb.(info:94) - starting the embedded EJB container 14:41:36,546 DEBUG org.jboss.kernel.KernelFactory.(assembleNewKernel:86) - Starting JBoss Kernel construction... 14:41:36,764 DEBUG org.jboss.kernel.KernelFactory.(assembleNewKernel:112) - Completed JBoss Kernel construction. Durati on: 218 milliseconds 14:41:36,764 DEBUG org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.(loadMBeanServer:408) - !!loadMBeanServer servers 0 14:41:36,764 DEBUG org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.(loadMBeanServer:411) - !!loadMBeanServer creating... java.lang.RuntimeException: java.lang.RuntimeException: Cannot find embedded-jboss-beans.xml at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:391) at org.jboss.seam.core.Ejb.startup(Ejb.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.seam.util.Reflections.invoke(Reflections.java:13) at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32) at org.jboss.seam.Component.callComponentMethod(Component.java:1334) at org.jboss.seam.Component.callCreateMethod(Component.java:1322) at org.jboss.seam.Component.newInstance(Component.java:1312) at org.jboss.seam.Component.getInstance(Component.java:1263) at org.jboss.seam.Component.getInstance(Component.java:1253) at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:125) at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:104) at org.jboss.seam.init.Initialization.init(Initialization.java:196) at org.jboss.seam.mock.SeamTest.init(SeamTest.java:321) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:318) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:152) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:88) at org.testng.TestRunner.privateRun(TestRunner.java:682) at org.testng.TestRunner.run(TestRunner.java:566) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220) at org.testng.SuiteRunner.run(SuiteRunner.java:146) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:713) at org.testng.TestNG.runSuitesLocally(TestNG.java:676) at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75) at org.apache.maven.surefire.Surefire.run(Surefire.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747) Caused by: java.lang.RuntimeException: Cannot find embedded-jboss-beans.xml at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:379) ... 39 more Tests run: 5, Failures: 1, Errors: 0, Skipped: 4, Time elapsed: 2.437 sec <<< FAILURE!
the microcontainer jars are in my class path (via the pom.xml). Also the microcontainer configuration files (*.xml) are in the class path of the test runner under target/test-classes/conf (here is a listing).
bash-2.05b$ ls -l target/test-classes/conf/ total 49 -rwxrwxrwx 1 A428302 mkgroup-l-d 1020 Jun 27 08:17 default.persistence.properties -rwxrwxrwx 1 A428302 mkgroup-l-d 23397 Jun 27 08:17 ejb3-interceptors-aop.xml -rwxrwxrwx 1 A428302 mkgroup-l-d 4101 Jun 27 08:17 embedded-jboss-beans.xml -rwxrwxrwx 1 A428302 mkgroup-l-d 1907 Jun 27 14:41 jboss-beans.xml -rwxrwxrwx 1 A428302 mkgroup-l-d 11461 Jun 27 08:17 jboss-jms-beans.xml -rwxrwxrwx 1 A428302 mkgroup-l-d 1446 Jun 27 08:17 log4j.xml -rwxrwxrwx 1 A428302 mkgroup-l-d 2212 Jun 27 08:17 login-config.xml -rwxrwxrwx 1 A428302 mkgroup-l-d 502 Jun 27 08:17 security-beans.xml
Here are the microcontainer jars listed as dependencies in my pom.xml:
<!-- JBoss EJB3 Microcontainer for testing --> <dependency> <groupId>org.jboss.ejb3.microcontainer</groupId> <artifactId>jboss-ejb3-all</artifactId> <version>Alpha8.P2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.ejb3.microcontainer</groupId> <artifactId>hibernate-all</artifactId> <version>Alpha8.P2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.ejb3.microcontainer</groupId> <artifactId>thirdparty-all</artifactId> <version>Alpha8.P2</version> <scope>test</scope> </dependency>
Has anyone else been able to get the microcontainer to come up for test purposes with Maven 2? If so, can you share your pom.xml and any other information you need to know about this?
Thanks