Wednesday, November 24, 2010

Install Apache Geronimo (as service) on Ubuntu Linux

Apache Geronimo is an Open Source J2EE server. And it can be installed rather easily on Ubuntu Linux (10.04).

As a reminder, the following instructions presume that one uses its current ubuntu account. For an enterprise environment it is recommended to create a new user account, for example g_user, that will own all the geronimo files and will start and stop the server (will be referred from now on as GERONIMO_OWNER and ${user}) and add this user to the sudoers as needed.


- First step is to install sun java.
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk


- Second step is to download and extract (install) Geronimo:
Download from :
http://geronimo.apache.org/apache-geronimo-v22-release.html
I downloaded the latest stable release with tomcat:
geronimo-tomcat6-javaee5-2.2-bin.tar.gz

Then md5sum it (to gain problem-solving time):
md5sum geronimo-tomcat6-javaee5-2.2-bin.tar.gz
and crosscheck it with the md5 sum on the site.

Extract the archive:
tar -xvzf geronimo-tomcat6-javaee5-2.2-bin.tar.gz

Rename the extracted directory to something smaller:
mv geronimo-tomcat6-javaee5-2.2 geronimo.2.2
From now on when we will refer to the full path of the geronimo.2.2 directory as ${GERONIMO_HOME}.
 
Open .bashrc file:
gedit /home/${user}/.bashrc

Add JAVA_HOME, JRE_HOME and JAVA_OPTS at the end of .bashrc:
export JAVA_HOME=/usr/lib/jvm/java-6-sun   
export JRE_HOME=/usr/lib/jvm/java-6-sun/jre
export JAVA_OPTS="-Xmx256m -XX:MaxPermSize=128m"
Run .bashrc (just this once):
. .bashrc
Or close the terminal and open a new one.

- Last step is to start the server:
cd ${GERONIMO_HOME}/bin
./geronimo start

And the server is up and running!
You can browse the Administration console at
http://localhost:8080/
Click the link "Administration -> console" on the left.
Provide the default credentials :
system/manager
And geronimo is at your disposal!

To maximize security, it is time to change the default admin username and password. You need to stop geronimo:
cd ${GERONIMO_HOME}/bin
./geronimo.sh stop --user system --password manager
Open user/passwords file
gedit ${GERONIMO_HOME}/var/security/users.properties
and add a new line with the new administrator user and his password like this:
g_admin=g_admin_pass
Next time you start the server the password will be automatically encrypted.
Open permission/groups file:
gedit ${GERONIMO_HOME}/var/security/groups.properties
Assign administration and monitoring privileges only to the new user. Change the two uncommented lines like this:
admin=g_admin
monitor=g_admin
Lastly you should change the file permissions on these files:
chmod -R 600 ${GERONIMO_HOME}/var/security

To create a service in order to automate startup open/create the following file:
sudo gedit /etc/init.d/geronimo2
Add the following code. You only need to set correctly for your system the variables GERONIMO_HOME, GERONIMO_OWNER, GERONIMO_ADMIN and GERONIMO_PASS inside the script.

#!/bin/bash
# chkconfig: 234 20 80
# description: Geronimo Server start/stop script
# processname: geronimo2

JAVA_HOME=/usr/lib/jvm/java-6-sun
JRE_HOME=/usr/lib/jvm/java-6-sun/jre
JAVA_OPTS="-Xmx256m -XX:MaxPermSize=128m"

GERONIMO_HOME=/home/gfuser/geronimo.2.2
GERONIMO_OWNER=g_user
GERONIMO_ADMIN=g_admin
GERONIMO_PASS=g_admin_pass

export JAVA_HOME JRE_HOME JAVA_OPTS GERONIMO_HOME GERONIMO_OWNER GERONIMO_ADMIN GERONIMO_PASS

start() {
  geronimo_state=`ps -ef | grep "geronimo" | grep "/bin/server.jar" | grep -v grep | wc -l`
  if [ $geronimo_state -gt 0 ]; then
    echo "Geronimo is already UP!"
  else 
    echo -n "Starting geronimo: "
    cd $GERONIMO_HOME/bin
    su $GERONIMO_OWNER -c "$GERONIMO_HOME/bin/geronimo.sh start"
    sleep 20
    echo "done."
  fi
}

stop() {
  geronimo_state=`ps -ef | grep "geronimo" | grep "/bin/server.jar" | grep -v grep | wc -l`
  if [ $geronimo_state -gt 0 ]; then
    echo -n "Gracefully stoping geronimo: "
    su $GERONIMO_OWNER -c "$GERONIMO_HOME/bin/geronimo.sh stop --user $GERONIMO_ADMIN --password $GERONIMO_PASS"
    sleep 10
    echo "done."
  else
    echo "Geronimo is already DOWN!"
  fi
}

force_stop() {
  geronimo_state=`ps -ef | grep "geronimo" | grep "/bin/server.jar" | grep -v grep | wc -l`
  if [ $geronimo_state -gt 0 ]; then
    echo -n "Forcefully stoping geronimo: "
    su $GERONIMO_OWNER -c "$GERONIMO_HOME/bin/geronimo.sh stop --force --user $GERONIMO_ADMIN --password $GERONIMO_PASS"
    echo "done."
  else
    echo "Geronimo is already DOWN!"
  fi
}

status() {
  geronimo_state=`ps -ef | grep "geronimo" | grep "/bin/server.jar" | grep -v grep | wc -l`
  if [ $geronimo_state -gt 0 ]; then
    echo "Geronimo is UP!"
  else
    echo "Geronimo is DOWN!"
  fi
}

case "$1" in
  start)
    start
;;
  stop)
    stop
;;
  status)
    status
;;
  force_stop)
    force_stop
;;
  restart)
    stop
    sleep 2
    start
;;
  *)
  echo "Usage: $0 {start|stop|force_stop|restart|status}"
esac

exit 0

Now you need to change the file permissions:
sudo chmod 755 /etc/init.d/geronimo2

Next create the upstart conf file:
sudo gedit /etc/init/geronimo2.conf
and add the following code

# geronimo2

start on runlevel [2345]
stop on runlevel [16]

respawn

pre-start exec /etc/init.d/geronimo2 start
post-stop exec /etc/init.d/geronimo2 stop


Reload upstart configuration:
sudo initctl reload-configuration
Start geronimo service :
sudo initctl start geronimo2

And the geronimo service is securely installed and will be started on every boot.

p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.

Sunday, November 21, 2010

GlassFish 2 Cluster Configuration on the Same Machine

This tutorial will guide you through a GlassFish 2.1.1 Cluster with two instances on the same machine. We are going to use the CLI interface to make our life simpler.
[Whenever you encounter the \ symbol in one of the commands, it means that the command continues on the following line. So you have to copy both lines (including the \ symbol) at your terminal.]
After a successful installation of glassfish with cluster profile (setup-cluster.xml), as explained on the download page:

https://glassfish.dev.java.net/downloads/v2.1.1-final.html

Go to directory ${GF_HOME}/bin and delete default domain domain1 (or you can just ignore it).
asadmin delete-domain domain1
and create a new domain with adminport 4000, name das :
asadmin create-domain --adminport 4000 --profile cluster das
Use the following credentials (or your own, just make sure to make the changes on the password file later on)
Admin user : admin
Admin pass : admin111
Master pass : admin111
We are going to use a password file inside ${GF_HOME}/bin in order to make the steps quicker with the following three lines :
AS_ADMIN_ADMINPASSWORD=admin111
AS_ADMIN_PASSWORD=admin111
AS_ADMIN_MASTERPASSWORD=admin111
You should better change the file preferences so that no one else can view this file except the GF admin:
chmod 600 passwords
First step is to start the new domain:
asadmin start-domain --user admin --passwordfile passwords das
Create the first node agent, connecting on DAS at 4000 port, (and then start it):
asadmin create-node-agent --user admin --port 4000 \
   --passwordfile passwords agent1
asadmin start-node-agent --user admin --passwordfile passwords agent1
Create the cluster farm named cl1 (connecting on DAS at 4000 port) that will group both of the clustered instances:
asadmin create-cluster --user admin --passwordfile passwords \
   --port 4000 cl1
Create the first instance (gf1 on http port 9080) and the second instance (gf2 on http port 9090) that communicate to the domain (DAS on port 4000) through the node agent (agent1) and reference our cluster (cl1):
asadmin create-instance --user admin --passwordfile passwords \
   --port 4000 --nodeagent agent1 --systemproperties \
   HTTP_LISTENER_PORT=9080 --cluster cl1 gf1
and
asadmin create-instance --user admin --passwordfile passwords \
   --port 4000 --nodeagent agent1 --systemproperties \
   HTTP_LISTENER_PORT=9090 --cluster cl1 gf2
Last step is to start the cluster and the instances with the following command:
asadmin start-cluster --user admin --port 4000 \
   --passwordfile passwords cl1
Now when you point your browser to http://localhost:4000/ and login as admin/admin111 you will see on your left the "Clusters" Task, with cl1 child. And cl1 will have two children gf1 and gf2. To deploy an application to the cluster, all you need to do is remove the target "server" and add the target "cl1" (either at deployment or after deployment).
You will also see the "Node Agents" Task that has the agent1 node agent.
Here are the startup commands :
asadmin start-domain --user admin --passwordfile passwords das
asadmin start-node-agent --user admin --passwordfile passwords agent1
asadmin start-cluster --port 4000 --passwordfile passwords cl1
and the shutdown commands:
asadmin stop-cluster --user admin --passwordfile passwords cl1
asadmin stop-node-agent agent1 
asadmin stop-domain das


p.s.
Here are all the commands one after another in order to run them as a script:

asadmin create-node-agent --user admin --port 4000 --passwordfile passwords agent1
asadmin start-node-agent --user admin --passwordfile passwords agent1
asadmin create-cluster --user admin --passwordfile passwords --port 4000 cl1
asadmin create-instance --user admin --passwordfile passwords --port 4000 \
  --nodeagent agent1 --systemproperties HTTP_LISTENER_PORT=9080 --cluster cl1 gf1
asadmin create-instance --user admin --passwordfile passwords --port 4000 \
  --nodeagent agent1 --systemproperties HTTP_LISTENER_PORT=9090 --cluster cl1 gf2
asadmin start-cluster --user admin --port 4000 --passwordfile passwords cl1
And the shutdown-delete commands in order to clean up your installation.

asadmin stop-cluster --user admin --passwordfile passwords cl1
asadmin stop-node-agent agent1 
asadmin delete-instance --user admin --passwordfile passwords --port 4000 gf1
asadmin delete-instance --user admin --passwordfile passwords --port 4000 gf2
asadmin delete-cluster --port 4000 --user admin --passwordfile passwords cl1
asadmin delete-node-agent agent1
asadmin delete-node-agent-config --port 4000 --user admin --passwordfile passwords agent1
asadmin stop-domain das
asadmin delete-domain das


p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.

Thursday, October 7, 2010

Compile apache 2 with mod_deflate on Linux


I have always had trouble finding a simple "How to" to compile apache with exactly what I needed, meaning the common modules plus the mod_deflate. It turns out it is very simple. And that is probably why no one has bothered putting down the steps.

This installation will install apache 2.0.63 and zlib 1.2.5, on an ubuntu 10.04 machine. But I can rather safely presume, that the following steps will be the same for any *nix that has already installed the c compiler.

First of all, I downloaded the latest apache source package from httpd.apache.org [ http-2.0.63.tar.gz ].

Next , I downloaded the latest zlib source package from zlib.net [ zlib-1.2.5.tar.gz ].

I copied both packages inside /opt/packages and run the following commnads from a terminal:

cd /opt/packages
tar -xvf httpd-2.0.63.tar.gz
tar -xvf zlib-1.2.5.tar.gz

cd zlib-1.2.5
./configure –prefix=/usr/local/zlib
make
sudo make install

cd ../httpd-2.0.63

(The following three lines is one command. Just copy it with the slashes and it will run correctly. Slash tells the terminal that the command will continue in the next line!)
./configure --prefix=/usr/local/apache2 \
--enable-mods-shared="all" --enable-deflate \
–with-z="/usr/local/zlib"

make
sudo make install

So zlib is now installed in /usr/local/zlib and apache inside /usr/local/apache2 which are the default install locations.

And now to enable mod_deflate for most common files by editing httpd.conf:

LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css application/javascript application/x-javascript

I hope this little "how to" will save you a lot of time and trouble.
Especially for all of you making your first steps with apache.
 

p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.
 

Saturday, July 17, 2010

Configure MySQL Connection Pool in Glassfish V3

The MySQL connection pool in GlassFish V3, is actually as easy as it was in V2!

First of all, we need to download from www.mysql.com the latest jdbc driver:

http://dev.mysql.com/downloads/connector/j/5.1.html

Extract the downloaded archive and take the mysql-connector-java-x.x.x-bin.jar from the compressed archive and put it in {glassfish_installation}/glassfish/lib directory and restart glassfish (from {glassfish_installation}/glassfish/bin directory):

asadmin stop-domain domain1
asadmin start-domain domain1

Now we need to navigate to the administrator application:
http://localhost:4848/
 
Open the 'Resources' -> 'JDBC' -> 'Connection Pools' and select 'New'.
Fill in the Connection Pool 'Name' with a suitable name like MySQLPool.
Select 'Resource Type' : 'javax.sql.DataSource'.
Select 'Database Vendor' : 'MySQL'.
Select 'Next'.

At the next page go down at the additional Properties.
Find and edit the following properties :
Fill in property 'User' with the 'Value' : {db_user}
Fill in property 'Password' with the 'Value' : {db_user_pass}
Fill in property 'URL' with the 'Value' :
jdbc:mysql://[host]:[port]/[database name]
Select 'Finish'.

Navigate to Connection Pools and select the pool you just created.
Click Ping to test that it is working. If it is not, it is probably because you have mistyped the connection credentials. Go to 'Additional Properties' tab of the connection pool detail page and correct any errors. Try ping again.

Open the 'Resources' -> 'JDBC' -> 'JDBC Resources' and select 'New.
Fill the JNDI Name like 'jdbc/myconnnection'.
Select from 'Pool Name' combo box the pool we just created.
And select 'OK'.

The Connection Pool is ready!


p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.

Tuesday, May 18, 2010

Cuda 3.0 installation on Ubuntu Linux 10.04

I need to point out, that it is somewhat appalling the need to write a new tutorial for every time either a linux version or a product (pick your favourite) version is released. That said, I am off to provide the tutorial.

I had to read many tutorials and walkthroughs, as well as forum threads to succeed in the installation. So some parts might look very familiar!

First of all we will need to install the cuda graphics driver. Afterwards the cuda toolkit, followed by the cuda sdk. Finally we 'll install gcc 4.3 beacuse Cuda cannot cooperate with gcc 4.4 with which Ubuntu 10.04 ships. The linux version I am using is i386. I presume the instructions will work as well with x86_64 kernel.

Go to the official nvidia-CUDA download page:
http://developer.nvidia.com/object/cuda_3_0_downloads.html#Linux

Download the CUDA Toolkit and the CUDA SDK:

CUDA Toolkit for Ubuntu Linux 9.04 (32-bit)
GPU Computing SDK code samples and more

-----------------------------
Installing the NVIDIA driver:
-----------------------------
We'll need the latest cuda development driver available (195.xx), but first we'll uninstall the existing drivers.

1. Uninstall existing NVIDIA drivers and nvidia-glx.

(if you have enabled nvidia in system->administration->hardware drivers, then disable them first and possibly reboot)

sudo apt-get purge nvidia-*

2. Stop gdm service by running

sudo service gdm stop

3. Install drivers from nvidia repository

sudo add-apt-repository ppa:nvidia-vdpau/ppa
sudo apt-get update
sudo apt-get install nvidia-185-modaliases nvidia-glx-185 nvidia-settings
sudo nvidia-xconfig

4. Reboot and log back in.

5. Run

nvidia-settings

to verify that your driver version is at least 195. Look for the driver version in the window:
The 195.xx NVIDIA Driver for use with CUDA.

----------------------------
Installing the CUDA Toolkit:
----------------------------

After having installed the driver we now need to install the CUDA toolkit itself.

1. Run:

sudo sh cudatoolkit_3.0_linux_32_ubuntu9.04.run

2. Press enter to install at the default location.

/usr/local/cuda

3. Register the new library files:

sudo gedit /etc/ld.so.conf.d/cuda.conf &

and add the following to the empty file

/usr/local/cuda/lib

Save the file and close gedit.
Then run:

sudo ldconfig

Create a link to the libcuda.so library:

cd /usr/lib
sudo ln -s nvidia-current/libcuda.so libcuda.so

Also add to the end of your ~/.bashrc file.

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib

restart bash

----------------------------------------------------------
Installing the CUDA SDK and Compiling the Example Programs
----------------------------------------------------------

We will now install the CUDA SDK to our own home directory (we can experiment with the supplied demos):

1. Install SDK to the default location

sh gpucomputingsdk_3.0_linux.run

2. As CUDA does not yet work with GCC 4.4 we will have to install gcc-4.3:

sudo apt-get install gcc-4.3 g++-4.3 g++-4.4
sudo update-alternatives --remove-all gcc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 43 --slave /usr/bin/g++ g++ /usr/bin/g++-4.3 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.3
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 44 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4 --slave /usr/bin/gcov gcov /usr/bin/gcov-4.4
sudo update-alternatives --config gcc ### choose gcc 4.3

3. Install CUDA SDK requirements

sudo apt-get install libglut3-dev libxi-dev libxmu-dev

4. Go to SDK source dir:

cd ~/NVIDIA_GPU_Computing_SDK/C$

5. You should now be able to compile everything by running

make

This should now compile all the examples in the SDK without errors.

---------------------------------------------
Verify Installation
---------------------------------------------

We can now verify that everything is working:

1. Run (from ~/NVIDIA_GPU_Computing_SDK/C):

bin/linux/release/deviceQuery

On my machine I get the following output (depending on your harware, you output may be different. mine is a GeForce 8500 GT):

------------------------------------------------
bin/linux/release/deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

There is 1 device supporting CUDA

Device 0: "GeForce 8500 GT"
CUDA Driver Version: 3.0
CUDA Runtime Version: 3.0
CUDA Capability Major revision number: 1
CUDA Capability Minor revision number: 1
Total amount of global memory: 536150016 bytes
Number of multiprocessors: 2
Number of cores: 16
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
Warp size: 32
Maximum number of threads per block: 512
Maximum sizes of each dimension of a block: 512 x 512 x 64
Maximum sizes of each dimension of a grid: 65535 x 65535 x 1
Maximum memory pitch: 2147483647 bytes
Texture alignment: 256 bytes
Clock rate: 1.57 GHz
Concurrent copy and execution: Yes
Run time limit on kernels: Yes
Integrated: No
Support host page-locked memory mapping: No
Compute mode: Default (multiple host threads can use this device simultaneously)

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 134566327, CUDA Runtime Version = 3.0, NumDevs = 1, Device = GeForce 8500 GT


PASSED

Press to Quit...
-----------------------------------------------------------
-----------------------------------------------------------

That was it. It was a little hard, but it is worth the effort.

Let us only hope that we will not be obligated to write a new one for every release!!!

Monday, May 17, 2010

Load Oracle OCI driver on GlassFish (linux)

I had a really hard time finding the way to load the Oracle native libraries (Oracle runtime 10gR2 installation) on GlassFish (2.1.1) in linux (CentOS 5.4). Apparently GlassFish ignores the famous LD_LIBRARY_PATH variable for unknown reasons. I even tried setting it at the system wide profile. Nothing worked.

The java error was :
java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path

I wrote a small java class that loaded the oci driver successfully. I was sure the parameters were correct. GlassFish still ignored them. I realised that GlassFish was the problem. I tried setting -Djava.library.path. It still didn't work.

To make a long story short the answer is to set it at the GlassFish Admin GUI :
Configuration -->
server-config -->
JVM-settings -->
Tab: Path Settings -->
Native Library Path Prefix : /path/to/oracle/client/installation/lib

I hope this will save you the time I spent searching fruitlessly the internet.
Cheers

p.s.Do not forget to give the Oracle native libraries the rx permissions to the FlassFish Admin user!

p.s.2
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.

Tuesday, March 16, 2010

Run php pages on tomcat!

Today I feel the urge to congratulate some of our colleagues that strive to bring helpful extensions to our favourite open source software. The subject at hand is Tomcat and it's capability to run php!

As a java based server, tomcat serves jsp and java servlets. It has also embedded libraries for cgi should anyone would like to use it. But now an open source project called php-java-bridge brings php web projects to Tomcat. The installation is rather simple for a single php application, while making tomcat run php by default is hardly difficult!

I am not going to write any kind of tutorial this time, because the original tutorial that I have found here is complete.

Good job boys.
Keep Tomcat the best application server!

P.S.
I only need to add one thing missing from the tutorial mentioned. In my ubuntu box I needed first to install php5 and php-cgi (along with all its dependencies!) with:
sudo apt-get install php5 php-cgi


p.s.2
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.

Sunday, March 7, 2010

Nmon on ubuntu 9.10

My favourite operating system is linux. At home I use ubuntu 9.10. A colleague of mine introduced me to a monitoring tool that can monitor almost anything! It is called nmon and it is provided by ibm as open source for linux. The latest binaries are for ubuntu 8.10 which do not work, so I had to compile from the source. I run onto a couple of problems and since I could not find anywhere a complete walkthrough for installing nmon in ubuntu, I decided to write one!

What we are going to need is g++, ncurses and nmon. What we are going to do is install g++, download ncurses, compile them and install them, and lastly we are going to compile nmon.

1) Open a terminal and run :
sudo apt-get install g++
2) download latest ncurses release (the moment this was written the ncurses-5.7.tar.gz was the latest) from ftp://ftp.gnu.org/gnu/ncurses/ and save it in a directory. For this example it will be inside /downloads
3) open a terminal and cd to the directory :
cd /downloads
4) Unzip and then untar the ncurses
gunzip ncurses-5.7.tar.gz
tar -xvf ncurses-5.7.tar
5) cd to the ncurses directory
cd ncurses-5.7
6) run configure and make
./configure
make
7) install as root
sudo make install
8) browse for nmon source code at http://nmon.sourceforge.net/pmwiki.php?n=Site.CompilingNmon
and
9) save lmon13d.c (or the latest source code) and makefile in /downloads
10) rename lmon13d.c to lmon.c
mv lmon13d.c lmon.c
11) make
make nmon_x86_ubuntu810
12) rename nmon_x86_ubuntu810
mv nmon_x86_ubuntu810 nmon
13) copy nmon to /usr/bin in order to be available in the path (or any other directory in the $PATH variable).

That is all. nmon is a rather complete tool for monitoring a linux system.
I hope you like it.

Wednesday, January 27, 2010

Comparing GlassFish and OAS costs

I made a comparison in one of my previous posts that needs some corrections. So I'll just start the comparison from the beginning to avoid any confusion.

The purpose of this post is to compare, from an application server administrator's perpspective, GlassFish and OAS. Say we have 55.000 Euros to spend for a linux application server, hardware and software.

In case we buy oas enterprise edition 10g, its price goes to about 25.000 Euros per core (More like per two cores according to Oracle). So with 50.000 Euros we get a dual core (4 cores) license and with the remaining 5.000 we can get a machine with the best quad core in the market, and 8GB of memory. Let's assume that the rest of the hardware will be the same.

In case we choose glassfish, the oracle ADF Framework licensing amounts to 4000 Euros per core (per two cores). So, with 40.000 Eurow we get a 10 core (20 cores) licensing and with the remaining 15.000 Euros we get a machine (from dell's site) with 20 cores (2x6cores + 2X4cores) and 40GB memory.

With both servers we get clustering and support. And I need to add that glassfish community support is as good as oracle's.

It doesn't matter how fast OAS is compared to GlassFish. It may even be twice as fast (which isn't true). With those money and GlassFish one can buy 5 times more cpu power and memory.

And as a last stroke, I need to add the yearly support fee to Oracle. Instead of paying support and licensing fees, which amount to about 20% the initial cost per year. If we save this money, we can invest them in a new system every four or five years. (And the rest of the money can go to seminars!)

A clear win for open source and glassfish against oracle application server!

Sunday, January 10, 2010

GlassFish and Toplink ( ..continued )

My experience with GlassFish has increased since my last post.

There is already an ADF Faces - JPA eclipselink application that runs smoothly now for a few weeks on GlassFish. The only problem that came up after the successful code tests, was the Connection Pool leakage. There are some differences between the OAS and the GlassFish Connection Pooling. As a result, I had to tweak the preferences a little. In the 'General' tab I disabled the 'Connection Validation Required' checkbox to save time on connection gets. Also, at the 'Advanced' tab I set the 'Leak Reclaim' to true and the 'Leak Timeout' to 120 secs. The leak timeout may vary depending on the application. These two tweaks have stabilized the application.

The other important thing that I need to mention, is the difficulty that I found in installing two different versions of toplink. So the workaround is to install a new GlassFish installation for every toplink version (because the toplink libraries are installed in the installations's lib directory). I am lucky to have only two toplink versions (10.1.3.5 and 10.1.3.3) to handle!

But it is a serious thing to be considered in the following GlassFish versions: The library loader per version and the grouping of libraries. It is the one thing that I miss OAS for!


p.s.
You can find me on fiverr for more personalized requests on any java app server configuration problem or java error that you encounter, with deliverance of less than a day (true!) and money back guarantee if not satisfied.