JEE != Heavy!
There has been a lot of debate about JEE application servers being "heavy-weight" . However I've always been of the opinion that JEE app servers may have been a little fat in the "noughties" but with the new breed of application servers combined with JEE6 that is no longer true. So I recently received my Raspberry PI, a cheap ($25) Linux compatible ARM bare board which runs Debian. The PI comes with 256Mb RAM on board and an ARM1176JZFS and supports Java so it should be about as lightweight as you can get as a server platform. Also JBoss EAP 6 was released this week with claims that it is a lightweight JEE6 compliant application server so I decided to test how lightweight it is by getting it to run on the PI.
First things first. I decided to use Oracle's embedded Java as it supports Armv6 chips. The exact version used was ejre-7u4-fcs-b20-linux-arm-vfp-client_headless-12_apr_2012.
pi@raspberrypi:~$ gunzip ejre-7u4-fcs-b20-linux-arm-vfp-client_headless-12_apr_2012.tar.gz
pi@raspberrypi:~$ tar xvf ejre-7u4-fcs-b20-linux-arm-vfp-client_headless-12_apr_2012.tar
pi@raspberrypi:~$ cd ejre1.7.0_04/binpi@raspberrypi:~/ejre1.7.0_04/bin$ ./java -versionjava version "1.7.0_04-ea"Java(TM) SE Runtime Environment for Embedded (build 1.7.0_04-ea-b20, headless)Java HotSpot(TM) Embedded Client VM (build 23.0-b21, mixed mode)
That's it for installing Java.
Get JBoss EAP 6 Running
Now for JBoss EAP 6. I downloaded the EAP 6 zip file release from http://access.redhat.com and copied it over to the PI using SCP.
So now we have JBoss "installed". First things first JBoss EAP 6 sets its java memory settings a little high so we override it by setting our own JAVA_OPTS variable and tell JBoss where to find Java. Then we need to add a user so we can access the console later (by default JBoss has no users created).
pi@raspberrypi:~/jboss-eap-6.0/bin$ export JAVA_OPTS="-Xmx125M -XX:MaxPermSize=50M -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml"pi@raspberrypi:~/jboss-eap-6.0/bin$ export JAVA_HOME=/home/pi/ejre1.7.0_04/
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a):Enter the details of the new user to add.
Realm (ManagementRealm) :
Username : admin
Re-enter Password :
The username 'admin' is easy to guessAre you sure you want to add user 'admin' yes/no?
About to add user 'admin' for realm 'ManagementRealm'Is this correct yes/no? yesAdded user 'admin' to file '/home/pi/jboss-eap-6.0/standalone/configuration/mgmt-users.properties'Added user 'admin' to file '/home/pi/jboss-eap-6.0/domain/configuration/mgmt-users.properties'
Is this new user going to be used for one AS process to connect to another AS process e.g. slave domain controller?yes/no?
pi@raspberrypi:~/jboss-eap-6.0/bin$ ./standalone.sh -b 192.168.0.81 -bmanagement=192.168.0.81
With these settings JBoss starts up in about 60 seconds and listens on 192.168.0.81 (the IP address of the PI on the network).Browsing to the home page http://192.168.0.81:8080 we see that JBoss is ALIVE on the PI.
Browsing through the Admin Console we can see that we have JBoss running with memory to spare!
Why is this important
This may seem a bit silly but it shows that modern JEE 6 application servers are in no way heavyweight and you can easily run a full JEE6 stack in less than 100Mb of RAM on a $30 ARM board. So forget the heavyweight claims.
The second things this shows is that thanks to Oracle's release of the embedded JDK for ARM which is a full JDK as opposed to a mobile profile it is possible to run very complex Java applications on low powered ARM chips ( the PI apparently draws less than 3W power when running flat out). I can see a huge future in new server platforms containing large numbers of ARM chips running application servers like JBoss. In fact I know that Dell and HP are planning these hyperscale servers.