How to Install ADempiere on P-Series with IBM JAVA & SLES 64bit
Contents
Introduction
If you’re looking to install ADempiere on a P-Series machine on SLES, the guide below will take you through the required steps and any problems encountered. I'd also like to thank Terence Ng[[1]] for help in this install.
Pre-implementation Tasks
- IBM-JAVA2-PPC64-SDK-5.0. Download the required IBM Java, for PowerPC. (ibm-java2-ppc64-sdk-5.0-5.1.ppc64.rpm) You will need to sign up, but it’s free.
You can install the following GNU compilers and libraries with "yast2". Then in the Control Center -> Software -> Software Management. The following packages are required:
- The GNU C compiler and Support Files - gcc 4.1.0
- GCC-JAVA - gcc-java 4.1.0-28.4 (Must install)
- C compiler run time library - libgcc
- 64bit C compiler runtime library - libgcc-64bit
- Java Runtime Library for GCJ - libgcj
- 64bit Java Runtime Library for GCJ - libgcj-64bit
- GCC Preprocessor - cpp
- PostgreSQL (version: 8.1.x or 8.2.x is fine)
- PLJava (version I used: 1.3.1). I'd strongly recommend getting the source from PLJava CVS.
Java Installation
The most compatible Java version with the Power series is IBM Java, once downloaded run the rpm with the following:
"rpm –Uvh ibm-java2-ppc64-sdk-5.0-5.1.ppc64.rpm"
The destination directory shall be something similar to the following:
"/usr/local/bin/java2-ppc64-50"
Create a symbolic link:
"ln –s /usr/local/bin/java2-ppc64-50/bin/java /usr/bin/java"
Ensure the symbolic link has been created with a directory listing:
"ls -las /usr/bin/java" 0 lrwxrwxrwx 1 root root 38 Aug 28 16:27 /usr/bin/java -> /usr/local/bin/java2-ppc64-50/bin/java
Create a bash profile if not already done:
"vi .bashrc"
And set your JAVA_HOME:
"export JAVA_HOME=/usr/local/bin/java2-ppc64-50"
Save the file and execute:
“. .bashrc”
Check your JAVA_HOME by executing the following:
"echo $JAVA_HOME" "java –version" java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pxp64devifx-20071025 (SR6b)) IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux ppc64-64 j9vmxp6423-20071007 (JIT enabled) J9VM - 20071004_14218_BHdSMr JIT - 20070820_1846ifx1_r8 GC - 200708_10) JCL - 20071025
PostgreSQL Installation
Install Postgresql8.1.x rpm offered by SLES using YaST>Software>Software Management:
Using the command ‘yast2’ and ensuring you have an x-session available and your display has been set to your required terminal, e.g “export DISPLAY=192.128.162.253” being your computer.
The following packages are required:
- Postgresql-server
- Postgresql-dlevel
- Postgreslibs-64bit
- Postgresqllibs
- Postgresql-jdbc
You will now need to start PostgreSQL:
"/etc/init.d/postgresql start"
You will then need to set the system password for your postgres user and then login (add the user if not done so already):
"passwd postgres"
"su – postgres"
Next you will need to create a database user for PostgreSQL, there are two methods, first being external to PSQL: You will need to setup the user as a super user, select 'y' to assign role to super user.
"createuser -P adempiere"
Second method:
"psql" CREATE USER adempiere WITH PASSWORD 'adempiere'; ALTER USER adempiere WITH SUPERUSER; ALTER USER adempiere WITH LOGIN; \q
You can now create the database, there are two ways, one being the following (this creates a database external to PSQL):
createdb adempiere -E UTF8 -O adempiere -U adempiere
Second method:
"psql" CREATE DATABASE adempiere WITH OWNER adempiere ENCODING 'UTF8'; \q
PL/Java
---
If you have correctly followed the previous steps GCJ and Java should have been successfully installed, these are both necessary for the installation of PL/Java.
Make sure you are logged in as root and set the JAVA_HOME environment variable to the directory where java was installed, for example:
export JAVA_HOME=/opt/ibm/java2-ppc64-50
Download the PL/Java source code, which is available from http://pgfoundry.org/frs/?group_id=1000038
Save the archive to the /opt directory and then extract it:
cd /opt tar zxfv pljava-1.3.0.tar.gz cd pljava-1.3.0
The following steps will compile pljava and build the required object files and jar files:
make USE_GCJ=1 mkdir -p /usr/share/pljava install -m 644 build/pljava.jar /usr/share/pljava install -m 644 build/deploy.jar /usr/share/pljava install -m 755 build/objs/pljava.so /usr/share/pljava cat > /etc/ld.so.conf.d/postgresql.conf <<EOF $JAVA_HOME/jre/lib/ppc64 $JAVA_HOME/jre/bin/classic $JAVA_HOME/jre/lib $JAVA_HOME/jre/bin EOF
If you prefer you can do this step manually by creating the /usr/share/pljava directory and manually copying over 'pljava.jar deploy.jar and pljava.so' and setting the required permissions with chmod. You will then need to create a postgres.conf file in /etc/ld.so.conf.d/postgresql.conf and add required java directories as listed above.
Rebuild the library list with:
ldconfig
Ensure your 'libjvm.so' has been set with the following:
ldconfig -p |grep libjvm.so
You should get something like: libjvm.so (libc6,64bit) => /opt/ibm/java2-ppc64-50/jre/bin/classic/libjvm.so. If the command returns nothing check the /etc/ld.so.conf.d/postgresql.conf file and verify that the directories are correct.
Modify postgresql.conf in /var/lib/pgsql/data (remember to uncomment #the lines): add these lines:
custom_variable_classes = 'pljava' pljava.classpath = '/usr/share/pljava/pljava.jar'
Modify the following: listen_addresses = '*' # if you want to log in from the internet port = 5432
dynamic_library_path = '$libdir' to dynamic_library_path = '$libdir:/usr/share/pljava'
then modify pg_hba.conf in /var/lib/pgsql/data:
Please note in a production environment change the method from 'trust' to 'md5', my case has been listed below:
# TYPE DATABASE USER CIDR-ADDRESS METHOD # #local is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust host all all 127.0.0.2/32 trust # IPv6 local connections: host all all ::1/128 trust host adempiere adempiere 0.0.0.0/0 trust
Restart the postgreSQL server by running the following command:
/etc/init.d/postgresql restart
(NOTE: You will need to restart the postgresql server every time you update the ph_hba.conf file for the changes to take effect)
Then install pljava into Database by running:
java -cp /usr/share/pljava/deploy.jar:/usr/share/pgsql/postgresql-8.1-404.jdbc3.jar \ org.postgresql.pljava.deploy.Deployer -install -user adempiere -database adempiere \ -password adempiere
Adempiere Installation
Download Adempiere_320.tar.gz, extract the file to /opt, then go to /opt/Adempiere, run RUN_setup.sh by running:
"chmod -R 755 *.sh" "./RUN_setup.sh"
modify the configuration and press 'Test', if okay then press 'Save'. Please note that in Database Server>System Password, this should be the password for postgres. And Database Password should be 'adempiere'.
Then, go to /opt/Adempiere/utils and run RUN_ImportAdempiere.sh to import data into Database.
Trouble Shooting
Error Database Port
If you get "Error Database Port (DB Server Port = 5432)", change the 'Database Server' from hostname to localhost should be okay.
Error IbmX509 Key Store
This error is a result of tomcat being defaulted to the sun key store factory. The main thing is to add 'algorithm="IbmX509"' to the Factory element.
You will need to find the ‘server.xml’ Located usually in:
“Adempiere/jboss/server/adempiere/deploy/jbossweb-tomcat55.sar/server.xml”
Open with your favourite text editor:
“vi server.xml”
Find the “<Connector port=”8443” ” line and at the bottom add “algorithm="IbmX509" /> “ Similar to below:
<Connector port="8443" address="${jboss.bind.address}" maxThreads="100" strategy="ms" maxHttpHeaderSize="8192" emptySessionPath="true" scheme="https" secure="true" clientAuth="false" keystoreFile="/opt/Adempiere/keystore/myKeystore" keystorePass="myPassword" sslProtocol = "TLS" algorithm="IbmX509" />
Error JDBC
If you receive the following error, you will notice the host is trying to connect to the address 127.0.0.2, ensure you have enabled this connection in pg_hba.conf.
===========> Config.testJDBC: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.2", user "postgres", database "template1", SSL off [27]
===========> Config.testJDBC: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "127.0.0.2", user "postgres", database "template1", SSL off [27] -----------> ConfigurationData.test: Error connecting: jdbc:postgresql://p570p5:5432/template1 - postgres/postgres [27] ===========> ConfigurationPanel$1.finished: Error JDBC Connection (Error connecting: jdbc:postgresql://p570p5:5432/template1 - postgres/postgres) [12]
===========> ConfigurationPanel$1.finished: Error JDBC Connection (Error connecting: jdbc:postgresql://p570p5:5432/template1 - postgres/postgres)
--python 10:27, 5 September 2007 (EDT)