For AS 5.1 you can use the EJB 3.1 Embeddable prototype
http://www.jboss.org/community/wiki/EJB31Embeddable
The latest version can also deploy datasources and JPA entities.
Properties properties = new Properties();
| container = EJBContainer.createEJBContainer(properties);
|
| on(container).deploy(
| deployment(resource("explicit/ds-deployers-beans.xml")),
| deployment("default-ds",
| NonXADataSourceDeploymentMetaData.class,
| localDataSource()
| .connectionURL("jdbc:hsqldb:mem:defaultdb")
|
.driverClass("org.jboss.ejb3.embedded.test.common.HSQLDBService")
| .jndiName("java:/DefaultDS")
| .user("sa")
| .password("")
| .getMetaData()
| ));
|
| on(container).deploy(
| deployment(
| pkg("org.jboss.ejb3.embedded.test.stateless"),
| persistence(
| unit("tempdb")
| .jtaDataSource("java:/DefaultDS")
| .property("hibernate.hbm2ddl.auto",
"create-drop")
| )));
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4235087#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...