-
1. Re: JBoss AS 7 Embedded?
hwellmann.de Dec 6, 2011 9:36 AM (in response to hwellmann.de)Bump.
I still haven't found any documentation on the Embedded API. By looking at the sources of the artifact mentioned above and by trial and error, I ended up with the following which seems to work:
System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
File jbossHomeDir = new File("/path/to/my/jboss-as-7.0.2");
StandaloneServer server = EmbeddedServerFactory.create(jbossHomeDir, System.getProperties(), System.getenv());
server.start();
server.deploy(myWar);
I'm just wondering if this is really the recommended way of using Embedded JBoss. The server.deploy() method is marked as deprecated, but the alternative is not clearly indicated.
I don't really like the fact that this way of starting the server depends on an existing installation, that's not what you'd expect of an "embedded server". Isn't there a self-contained Maven artifact for an embedded JBoss? (This is how it works for GlassFish or Resin.)
Best regards,
Harald