Thursday, August 11, 2011

Build JBoss Application Server 7.x

JBoss AS 7 - Final?

Recently we decided to give JBoss AS 7 a try. The first release was 7.0.0.Final and like expected there where some bugs. A major factor for the decision to evaluate JBoss AS 7 was not the 4 second startup time if you don't deploy or use anything (the main reason for this is lazy loading of modules on usage) but was the fact that JBoss switched back to a more open development. We really had a problem with the quality of JBoss AS 5.0/5.1/6.0 GA in combination with the changed Red Hat business model from the post-4.x era:
General Availability (GA) releases are feature releases, not bugfix release.
In opposition to this policy there will be a JBoss AS 6.1 bugfix release and we can now even find the development source repositories at GitHub (only GA source code was really open in the past, not even patches). Something has changed for good. After all we are not going to to use our heavily patched JBoss AS 4.2.3 for another 4 years and where already looking for alternatives.

Checkout from Git


The easiest solution to me for checking out code from a Git-based version control system is using Eclipse with the EGit plugin.
  • Help / Install new Software...
  • Work with: Indigo - http://download.eclipse.org/releases/indigo
  • Collaboration / Eclipse EGit
  • ...Install / Restart...
  • It works similar to the CVS / SVN plugins:
  • Open Perspective "Git Repository Exploring"
  • Clone a Git Repository...
  • URI: https://github.com/jbossas/jboss-as.git
  • master
  • adjust Directory path and Finish
  •  
     




      So this is simple and working - but we only checkout code here. I don't know how usable EGit is for everyday work after my experiences with the Eclipse Subversion Plugins. You can also download Git and use the shell commands but I had problems with Windows and my profile name (known MinGW problems).

        Building

        The JBoss AS build tool is Maven 3 and it's as easy as that:
        andre@entwsnb11 /cygdrive/D/Data/git/jboss-as
        $ mvn clean install -DskipTests=true
        You only need some time, especially for the first run because Maven must download all necessary dependencies. You can also download all sources for the used Maven dependencies for later debugging:
        $ mvn dependency:sources
        The ready to use Application Server is here:
        .../git/jboss-as/build/target/jboss-as-7.1.1.Final-SNAPSHOT
        Copy this folder to any location and call
        bin/standalone.bat
        The application server should be up and running after seconds: http://localhost:8080/

        If you have port conflicts (e.g. Oracle XE database blocks 8080 with an admin web app...oh my) than you can change ports here:
        ...jboss-as-7.../standalone/configuration/standalone.xml
        You will notice that JBoss AS 7 differs heavily from previous versions. It has a new folder and configuration structure and you will find nothing where you expect it. This could be a problem for your administrators and should be considered. I would say switching from JBoss 4/5/6 to 7 is like switching from JBoss AS to Glassfish or other products.

        Start via Eclipse


        We use the Eclipse plugins from JBoss Tools for web development (in addition to Eclipse JEE / WTP). This plugins have nice support for JBoss Seam and CDI / Weld. The current milestone 3.3.0 (JBoss Tools - Core 3.3.0.M5 :: Eclipse 3.7.1) supports JBoss AS 7.1 as runtime environment.

        Yo can register the server as usual and start it. An interesting observation is that JBoss AS 7.0.0.Final is endlessly starting and at sometime the startup  timeout triggers. There seem to be problems with the management port 9999. I hadn't this problems with this own build - so this is one problem we can (unexpectedly) resolve with this own build.

        Certainly you shouldn't use this in production yet. If you have a release date at least 6 month from now on, than this may be an interesting option.



        Building JBoss App Server isn't a "kudos to the great wizard" anymore. That was easy - not even worth a blog post. I think sometimes people only have to see how astonishing simple some things are.

        You might also be interested in

        • Oracle Datasource in JBoss AS 7 - The next step could be the configuration of a JDBC data source. This Oracle DB specific description works for other DBs too.

        2 comments:

        1. Its great to see JBoss Application Server for java from Redhat. I think they recently moved source repository too

          ReplyDelete
        2. It is very useful information about Jboss Application Development for all and it is very simple to understand.

          Thanks!

          ReplyDelete