1 Reply Latest reply on Dec 6, 2011 9:36 AM by hwellmann.de

    JBoss AS 7 Embedded?


      I can't find any documentation or code samples for JBoss AS 7 Embedded. Is https://repository.jboss.org/nexus/content/repositories/releases/org/jboss/as/jboss-as-embedded/7.0.2.Final/ the correct artifact to use? Do older docs referring to AS 6 or AS 5 still apply? Any pointers welcome...




        • 1. Re: JBoss AS 7 Embedded?



          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());




          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,