Tuesday, July 10, 2007

Installation of JBoss on Suse 10 with IBM p5

SuSe 10.2 on IBM P 520 with Apache2 ,Tomcat 6 ,JSDK 1.4.2 and Jboss 4.0.5.GA
Reference for known problems
http://entropy.brneurosci.org/linuxsetup82.html

Installed SUSE 10
Patitiions
/dev/sda1 is of type PReP.And its size is 10 MB

/dev/sda5 9.9G 1003M 8.4G 11% /
/dev/sda2 99M 18M 77M 19% /boot
/dev/sda8 26G 345M 25G 2% /home
/dev/sda6 9.9G 1.7G 7.7G 18% /usr
/dev/sda7 20G 291M 19G 2% /var

1. X display system was not working during the Installation and after installation.
An error message describing about insufficient memory was displayed at the startup of
installation.But its not able to get into BIOS settings.
But it is working remotely through SSH.So the problem is it is not having the
proper driver for the monitor connected.
Tried
a. xf86config
b. xorgcfg
3. yast -i xorg-x11*

2. useradd won't work
We can add a user called USER by
1. mkdir /home/USER
2. useradd -d /home/USER -g USER USER
Default group is "users" Group ID will be "100"
But in this way no SKEL files like .profile get created inside /home/USER
So it is wise to add users through YaST.

3.Instead of this we can use YaST to add new users.But here also the primary group wil
be "users"
4. Installed Postgresql,MySQL,Java,Qt,Apache and related dependancies through YaST
interface.
5.Downloaded apache-tomcat-6.0.13-src.tar.gz from http://tomcat.apache.org
Added user tomcat
Extracted apache-tomcat-6.0.13-src.tar.gz into /home/tomcat
Changed the ownership.
chown tomcat.tomcat apache-tomcat-6.0.13-src

Set up CATALINA_HOME=/home/tomcat/apache-tomcat-6.0.13-src
Exported CATALINA_HOME.
6.systemp5:~ # rpm -qa java*
java-1_4_2-ibm-jdbc-1.4.2.s4-23.4
java-1_4_2-ibm-devel-1.4.2.s4-23.4
java-1_4_2-ibm-1.4.2.s4-23.4
systemp5:~ # which java
systemp5:~ #

The Jboss application need JDK 1.4.2 or above and all of the Projects by our team are based on this. So I decided to update Java to 1.4.2

systemp5:~ # rpm -e java-1_4_2-ibm-jdbc-1.4.2.s4-23.4
systemp5:~ # rpm -e java-1_4_2-ibm-devel-1.4.2.s4-23.4
systemp5:~ # rpm -e java-1_4_2-ibm-1.4.2.s4-23.4
systemp5:~ # rpm -e IBMJava2-142-ppc64-JRE-1.4.2-8.0
systemp5:~ #

7.Added user jboss with HOME dir as "/home/jboss" and primary group as “users”
through YaST
8. Downloaded IBMJava2-142-ppc64-JRE-1.4.2-8.0.ppc64.rpm and IBMJava2-SDK-
1.4.2-8.0.ppc64.tgz from

https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?
source=lxdk&S_PKG=ip64142sr8&cp=UTF-8&S_TACT=105AGX05&S_CMP=JDK

Reference : http://e-docs.bea.com/platform/suppconfigs/configs81/
sles9_powerpc/81sp2.html#92397

9. Installed IBMJava2-142-ppc64-JRE-1.4.2-8.0.ppc64.rpm

systemp5:/home/jboss # rpm -ivh IBMJava2-142-ppc64-JRE-1.4.2-8.0.ppc64.rpm
Preparing... ########################################### [100%]
Checking the Kernel Version.....
1:IBMJava2-142-ppc64-JRE ########################################### [100%]

Copied and IBMJava2-SDK-1.4.2-8.0.ppc64.tgz to /home/jboss
then extracted IBMJava2-SDK-1.4.2-8.0.ppc64.tgz

jboss@systemp5:~> tar xzf IBMJava2-SDK-1.4.2-8.0.ppc64.tgz


10. Downloaded jboss jboss-4.0.5.GA.zip from
http://sourceforge.net

Reference : http://www.novell.com/coolsolutions/feature/14912.html#1.0

Documentation for installation is available at
http://labs.jboss.com/jbossas/docs
11. Then extracted jboss-4.0.5.GA.zip inside /home/jboss
systemp5:/home/jboss # pwd
/home/jboss
systemp5:/home/jboss #
systemp5:/home/jboss # unzip jboss-4.0.5.GA.zip



inflating: jboss-4.0.5.GA/server/minimal/conf/jndi.properties
inflating: jboss-4.0.5.GA/server/minimal/conf/log4j.xml
inflating: jboss-4.0.5.GA/server/minimal/lib/jboss-management.jar
inflating: jboss-4.0.5.GA/server/minimal/lib/jboss-minimal.jar
inflating: jboss-4.0.5.GA/server/minimal/lib/jnpserver.jar
inflating: jboss-4.0.5.GA/server/minimal/lib/log4j.jar
systemp5:/home/jboss # cd jboss-4.0.5.GA/

systemp5:/home/jboss/jboss-4.0.5.GA # cd bin/
Then tried to nitialize jboss

systemp5:/home/jboss/jboss-4.0.5.GA/bin # ./jboss_init_suse.sh start
JBOSS_HOME does not exist as a valid directory : /opt/jboss
systemp5:/home/jboss/jboss-4.0.5.GA/bin #
systemp5:/home/jboss/jboss-4.0.5.GA/bin # ./jboss_init_suse.sh start
Starting JBoss application server: -su: /opt/jboss/log/jboss.log: No such file or directory
done
systemp5:/home/jboss/jboss-4.0.5.GA/bin #


systemp5:/home/jboss/jboss-4.0.5.GA/bin # mkdir /opt/jboss
systemp5:/home/jboss/jboss-4.0.5.GA/bin # mkdir /opt/jboss/log


systemp5:/home/jboss/jboss-4.0.5.GA/bin # ./jboss_init_suse.sh start
Starting JBoss application server: -su: /opt/jboss/log/jboss.log: Permission denied
done
systemp5:/home/jboss/jboss-4.0.5.GA/bin #

systemp5:/home/jboss/jboss-4.0.5.GA/bin # chmod 777 /opt/jboss/log
systemp5:/home/jboss/jboss-4.0.5.GA/bin # ./jboss_init_suse.sh start
Starting JBoss application server: done
systemp5:/home/jboss/jboss-4.0.5.GA/bin #


systemp5:/home/jboss/jboss-4.0.5.GA/bin # ./jboss_init_suse.sh stop
Shutting down JBoss application server: -su: java: command not found
failed


systemp5:/home/jboss/jboss-4.0.5.GA/bin # echo $JAVA_HOME
/usr/lib/jvm/java
systemp5:/home/jboss/jboss-4.0.5.GA/bin # echo $JRE_HOME
/usr/lib/jvm/java/jre

systemp5:/home/jboss/jboss-4.0.5.GA/bin # which java
systemp5:/home/jboss/jboss-4.0.5.GA/bin #


11 . Set up JAVA_HOME and PATH

systemp5:/opt/jboss # export
PATH=/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bi
n:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/
lib/mit/sbin:/usr/local/IBMJava2-ppc64-142/bin/

systemp5:/opt/jboss # export JAVA_HOME=/home/jboss/IBMJava2-ppc64-142/
systemp5:/opt/jboss # export JRE_HOME=/home/jboss/IBMJava2-ppc64-142/jre


systemp5:/opt/jboss/bin # ./jboss_init_suse.sh stop
Shutting down JBoss application server: -su: java: command not found
failed
systemp5:/opt/jboss/bin # ./jboss_init_suse.sh start
Starting JBoss application server: done
systemp5:/opt/jboss/bin # ./jboss_init_suse.sh stop
Shutting down JBoss application server: -su: java: command not found
failed
systemp5:/opt/jboss/bin #

After reading the readme.html it is found that this "jboss_init" script won't work .we have to execute the "run.sh" script

It is said that
"The -server flag is not supported by the IBM JVM, so it now conditionally set by the run.sh/run.bat scripts"




systemp5:/home/jboss/jboss-4.0.5.GA/bin # pwd
/home/jboss/jboss-4.0.5.GA/bin


systemp5:/home/jboss/jboss-4.0.5.GA/bin # ./run.sh
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /home/jboss/jboss-4.0.5.GA

JAVA: /home/jboss/IBMJava2-ppc64-142/bin/java

JAVA_OPTS: -Dprogram.name=run.sh -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

CLASSPATH: /home/jboss/jboss-4.0.5.GA/bin/run.jar:/home/jboss/IBMJava2-ppc64-142/lib/tools.jar

=========================================================================

17:26:06,463 INFO [Server] Starting JBoss (MX MicroKernel)...
17:26:06,465 INFO [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
17:26:06,467 INFO [Server] Home Dir: /home/jboss/jboss-4.0.5.GA
17:26:06,467 INFO [Server] Home URL: file:/home/jboss/jboss-4.0.5.GA/
17:26:06,468 INFO [Server] Patch URL: null
17:26:06,468 INFO [Server] Server Name: default
17:26:06,469 INFO [Server] Server Home Dir: /home/jboss/jboss-4.0.5.GA/server/default
17:26:06,469 INFO [Server] Server Home URL: file:/home/jboss/jboss-4.0.5.GA/server/default/
17:26:06,469 INFO [Server] Server Log Dir: /home/jboss/jboss-4.0.5.GA/server/default/log
17:26:06,470 INFO [Server] Server Temp Dir: /home/jboss/jboss-4.0.5.GA/server/defau

This will bring the JBoss Server Up and Running

The service can be stopped by quitting by Ctrl-C or by “shutdown.sh -S”
Thereafter it was possible to get the sample page at
http://192.168.10.200:8080

Then I tried to create a custom .WAR folder with "Hello World" JSP file

jboss@systemp5:~> cd /home/jboss
jboss@systemp5:~> mkdir HelloWorld
jboss@systemp5:~> cd HelloWorld/
jboss@systemp5:~/HelloWorld> ls
jboss@systemp5:~/HelloWorld> vi index.jsp
jboss@systemp5:~/HelloWorld> mkdir WEB-INF
jboss@systemp5:~/HelloWorld> cd WEB-INF/
jboss@systemp5:~/HelloWorld/WEB-INF> vi web.xml
jboss@systemp5:~/HelloWorld/WEB-INF> cho $JAVA_HOME
-bash: cho: command not found
jboss@systemp5:~/HelloWorld/WEB-INF> echo $JAVA_HOME
/usr/local/IBMJava2-ppc64-142
jboss@systemp5:~/HelloWorld/WEB-INF> $JAVA_HOME/bin/jar -cvf HelloWorld.war *.jsp WEB-INF/
*.jsp : no such file or directory
WEB-INF : no such file or directory
added manifest
jboss@systemp5:~/HelloWorld/WEB-INF> cd ..
jboss@systemp5:~/HelloWorld> $JAVA_HOME/bin/jar -cvf HelloWorld.war *.jsp WEB-INF/
added manifest
adding: index.jsp(in = 247) (out= 163)(deflated 34%)
adding: WEB-INF/(in = 0) (out= 0)(stored 0%)
adding: WEB-INF/web.xml(in = 68) (out= 50)(deflated 26%)
adding: WEB-INF/HelloWorld.war(in = 335) (out= 178)(deflated 46%)
jboss@systemp5:~/HelloWorld>


jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy> cd /home/jboss/jboss-4.0.5.GA/server/default/deploy
jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy>
jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy> cp ~/HelloWorld/HelloWorld.war .

cp: cannot create regular file `./HelloWorld.war': Permission denied

jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy>

boss@systemp5:~/jboss-4.0.5.GA/server/default/deploy> su -
Password:

systemp5:/home/jboss # chown -R jboss.jboss jboss-4.0.5.GA
systemp5:/home/jboss # logout
jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy>


jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy> cp ~/HelloWorld/HelloWorld.war .
jboss@systemp5:~/jboss-4.0.5.GA/server/default/deploy>


Then opened the URL

http://192.168.10.200:8080/HelloWorld

Got the right Web Page

Status
everything works fine
Thereafter set the JAVA_HOME in /home/jboss/.profile
jboss@systemp5:~> echo 'export JAVA_HOME=/home/jboss/IBMJava2-ppc64-142' >> .profile

No comments: