Getting exception
tnektpb Jan 28, 2008 5:28 AMHi,
I'm having trouble getting the Embedded JBoss EJB 3.0 container to work. I've bashed my head against this problem for a while now and I can't seem to get it to work. I hope that someone here is able to help me out. :-/
To set Embedded JBoss up I:
Downloaded and extracted embedded-jboss-beta3.zip to a local folder
Added hibernate-all.jar, jboss-embedded-all.jar, jboss-embedded.jar, thirdparty-all.jar to my classpath using the Eclipse Java Build Path project dialog
Added everything in bootstrap to my classpath by creating a new source directory in Eclipse and copying everything from bootstrap into that new directory
And to try it out I then:
Created a new JUnit 4 test case where I just try to bootstrap the embedded container*.
I get an exception when I try EJB3StandaloneBootstrap.boot(null); with the message java.lang.RuntimeException: java.lang.RuntimeException: Cannot find embedded-jboss-beans.xml.
Stack trace for the exception:
java.lang.RuntimeException: java.lang.RuntimeException: Cannot find embedded-jboss-beans.xml at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:386) at se.tpb.nds.archive.bookstock.business.BookManagerEJBTest.setUpBeforeClass(BookManagerEJBTest.java:17) 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:585) at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74) at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.lang.RuntimeException: Cannot find embedded-jboss-beans.xml at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:372) ... 15 more
*Source code for my little test which raises the exception:
package se.tpb.nds.archive.bookstock.business; import static org.junit.Assert.*; import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class BookManagerEJBTest { @BeforeClass public static void setUpBeforeClass() throws Exception { EJB3StandaloneBootstrap.boot(null); // EXCEPTION LINE // EJB3StandaloneBootstrap.scanClasspath(); } @AfterClass public static void tearDownAfterClass() throws Exception { EJB3StandaloneBootstrap.shutdown(); } }
Thank you for your time reading my post. I hope that you're able and willing to help me. Even giving me a hint would be immensely useful.