Adempiere Install WinXp

From AdempiereWiki

Jump to: navigation, search

Contents

Introduction

This tutorial is for PostgreSQL Installation in Windows for Adempiere

An installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly. However, in this particluar version of Adempiere 342s there are a lot of things to do and it may take 2 hours after you have downloaded the files.

Every detail in the method must be meticulously carried-out. Do not try to jump ahead or you will just need to retrace your steps and uninstall what you have done! Please briefly read Step 8 Common Reasons for errors during setup (see below)

Another alternative you might want to investigate is the developmental Windows Installer, which runs under Windows and installs everything you need. However, the following method will give you much more control over the installation including a choice of the latest packages.

Platform and Downloads

This guide has been optimised for: Windows XP SP2, Java SE Development Kit 5 (also called JDK5), Postgres 8.3.7 & Adempiere 3.42s

Download each of the Java JDK, PostgreSQL and Adempiere packages before you begin! The sites are given below.

  • Download the Java SE Development Kit JDK1.5.0_18 or later (just called JDK5 for short) from http://java.sun.com/javase/downloads/index_jdk5.jsp You only need the JDK 5 Update xx without EE or NetBeans. (Note: The performance of Adempiere with JDK6 has not yet been confirmed so you may experience errors if you use it. Also, while many people are using the runtime client JRE6, some issues have been reported such as in creating calendar periods. As Java 5 and Java 6 can happily coexist, there should be no problems in using both on your computer.)
  • Download the latest Adempiere release 342s from http://sourceforge.net/projects/adempiere/
  • From http://www.adempiere.com/wiki/index.php/Patches_Installation download the latest Adempiere patches. Save each of these to a new folder C:\adpatches
  • From http://www.adempiere.com/wiki/index.php/Release_342s go to the section Detected installation problem in postgresql 8.3.5 and download the necessary substitution files to your desktop (this is very important)
  • Again from http://adempiere.com/wiki/index.php/Release_342s pick the link to Adempiere scripts and download the latest Adempiere scripts. NOTE: Be sure to get the scripts from the postgresql sub-directory rather than the directory you first see when you click the link! For the most recent version of each script, click download and save the resulting page to a new folder C:\adscripts. The browser's Save should automatically keep the right name for you. After downloading all the scripts, rename each of the files as just <number>.sql, for example 372.sql (Additional note for clarification: you do not need the migration script from 3.4.0 to 3.4.2 for a fresh installation.)
  • Download to your Desktop postgresql-8.3.7-1.zip or later from http://www.postgresql.org/ftp/binary

Setup Pre-Requisites

Step 1

NOTE: if you are using Windows VISTA, make sure that Universal Access Control (UAC) is turned off through user accounts.

You need to get the paths in Steps 1 & 2 absolutely right otherwise nothing else will work!

  • Install the JDK1.5.0_18 (or your more recent version) with the default installation settings. Say ok to install the follow-on JRE1.5.0_18 as well
  • Open Explorer and navigate to the C:\Program Files\Java directory (or where-ever your Java is installed) and carefully note the jdk1.5.0_18 (or your more recent version) directory and the jre1.5.0_18 directory that you have just installed. There may well be a number of jdk and jre directories, so choose the right ones!
  • On your Desktop (or using Start button / My Computer) right click My Computer and select System Properties / Advanced / Environmental Variables

(Alternatively: Start > Control Panel > System > Advanced tab > Environmental Variables)

  • Add a new System Variable for your new JDK_HOME directory:
JAVA_HOME use C:\Program Files\Java\jdk1.5.0_18  (or whatever your JDK directory is called)
  • Add a new System Variable for your new JRE_HOME directory:
JRE_HOME use C:\Program Files\Java\jre1.5.0_18  (or whatever your JRE directory is called)
  • You can check you have the right variables by opening a DOS shell with Start Button / Run / Open: cmd

Run each of the following commands by selecting the text and then pasting into the shell using Right Click / Paste:

  • echo %JAVA_HOME% - carefully check the result to ensure the path to the JDK is correct
  • echo %JRE_HOME% - again, carefully check the result to ensure the path to the JRE is correct
  • exit - close the shell

Step 2

Again in My Computer / System Properties / Advanced / Environmental Variables:

  • In System Variables, scroll down to locate the Path variable and click Edit
  • Append the following JRE and PostgreSQL paths to the end of Path variable after putting in a connector semi-colon ";" (Note: do not delete or overwrite the paths that are already in the Path variable! Also, make sure you don't have an extra "\" at the end of C:\Program Files\PostgreSQL\8.3\bin)

International Version

C:\Program Files\Java\jre1.5.0_18\bin;C:\Program Files\Java\jre1.5.0_18\bin\client;C:\Program Files\PostgreSQL\8.3\bin

Italian Version

C:\Programmi\Java\jre1.5.0_18\bin;C:\Programmi\Java\jre1.5.0_18\bin\client;C:\Programmi\PostgreSQL\8.3\bin
  • Edit the commands that you just pasted to make sure that in each of the two JRE references you have referred to your latest JRE. You must do this exactly, so open Windows Explorer and navigate to C:\Program Files\Java and check the exact naming of the JRE directory!
  • Open a DOS shell with Start Button / Run / Open: cmd
  • Type PATH
  • Carefully check the result to ensure the two paths to the JRE are correct

Step 3

  • Extract the Adempiere zip file to C:\Adempiere (You must extract to the folder C:\Adempiere. Do not extract to C:\Program Files\Adempiere)
  • Make sure you have achieved that all the Adempiere files are directly in the C:\Adempiere directory and not in a chained directory like C:\Adempiere\Adempiere
  • Copy the substitution files that you downloaded above in respect to Detected installation problem in postgresql 8.3.5 from your desktop to C:\Adempiere\utils\postgresql where these new files will overwrite existing files
  • In C:\Adempiere\lib rename each of the files that will be patched with the files you have in C:\adpatches, such as patches.jar, by adding .old to the file name to get names like patches.jar.old. Note that for a new installation there may not already be a webuiOriginal.war, so an original file may not need to be renamed. Copy the patch files that you downloaded from C:\adpatches into C:\Adempiere\lib. Now rename each of these files by deleting the descriptors and date so you just have names like the original ones, such as patches.jar (for detailed instructions see http://www.adempiere.com/wiki/index.php/Patches_Installation)

Step 4

  • Unzip the PostgreSQL binary to a new directory Postgres on your desktop (you can delete this and the zip file later - see Clean Up below)
  • Install PostgreSQL by double clicking the Windows installer postgresql-8.3.msi. However, you may need to do the following things first:
    • If you are re-installing a fresh version of Postgresql then remove various files and the postgres user - see Uninstalling Postgres & Adempiere below (however, do not remove the path reference in Environmental Variables).
    • If you are using Vista then you need to deactivate User Access Control from Control Panel and install PostgreSQL using the Windows msi installer by right clicking and selecting Run AS Administrator. If you don't have "Run As Administrator" on the context menu, then install the following registry fix: http://www.symantec.com/connect/sites/default/files/MsiRunAsAdmin.zip
  • Select your language to be used in the installation

Installation options:

  • ensure psql & pgAdminIII are also set as will be installed on local hard drive, which should be the case since these are the default options (Note: PL/Java is no longer required as from Adempiere versions 342s and 351a.)

Service configuration:

  • ensure the box "install as service" is checked (which is default, later you can set the service to manual start if you don't want PostgreSQL to run when you start-up)
  • Account name: postgres
  • Account domain: accept your computer name and remember it because you will need it later (IMHO I suggest that it is best for new users to write it down)
  • Password: postgres (or whatever you want - but write your password down! - let me repeat - !!write it down!!)

Pop-up box:

  • "Yes" to creating the user <your-computer-name>\postgres
  • "No" to replacing the weak password (in a commercial implementation you would have a strong password)

Initialise database cluster:

  • Check box "Initialize database cluster"
  • Do not check the Addresses box "accept connection on all addresses" - only listen on localhost
  • Select your Locale
  • Select UTF8 for both the server and client instead of the default WIN1252 (this is important)
  • Superuser name: postgres
  • Password: postgres (again, or whatever you want - but write it down!)
  • If you receive an error message that the port is already in use, you probably have an old Postgres service running. Go to Control Panel/Administrative Tools/Services, find Postgres Database Server, Stop the service and set its startup to Manual. Try again.

Enable procedural languages:

  • ensure PL/pgsql is checked (which is the default)

Enable contrib modules: You only need the default Adminpack

Install!

  • If you receive an error, install again with the above procedure and accept the suggestion not to create a new database cluster (because you created it last time).
  • Uncheck the box "Launch Stack Builder at exit" and Finish
  • Cancel out of Stack Builder if it insists in launching
  • Start Button/All Programs/PostgreSQL 8.3/Start Service

Congratulations, you now have Postgres database running

Suggestion: while the PostgreSQL database is being installed, you can save time by creating Desktop shortcuts to:

  • C:\Adempiere\Run_Setup.bat (the bat file designation may not be showing in your Explorer)
  • C:\Adempiere\utils\RUN_ImportAdempiere.bat
  • C:\Adempiere\utils\RUN_Server2.bat
  • C:\Adempiere\utils\RUN_Server2Stop.bat

Establish an Adempiere database

Step 1

Open pgAdmin III from Start Button / PostgreSQL / pgAdmin III

Step 2

Connect to postgresql

--Right click on the Postgresql database server and connect.

--Enter password postgres (or whatever you used as the superuser password) & tick the save box

Now, expand all the database server tree by clicking the plus-sign

Step 3

Down the bottom, you will see a user called "postgres". Do not modify this user. This database username will be entered during adempiere server setup or else you will have errors in dump restore.

Right click on Login Roles and create a new user "adempiere" with password "adempiere". Check superuser rights plus all boxes below superuser rights(see image below).


Step 4

Now return to Database at the top and right click. Select create database. Name it "adempiere" and select the owner "adempiere" and encoding "UTF8" (see image below). Leave all the other variables blank.


Note! If you installed PostgreSQL 8.2.1 (or later) with PL/Java then Skip to #Step 7 below

Step 5

Steps 5 & 6 are only for PostgreSQL 8.1 or earlier and where PL/Java has not already been installed.

Edit file C:\Programmi\PostgreSQL\8.2\data\postgresql.conf (C:\Program Files\PostgreSQL\8.2\data\postgresql.conf). Add the following lines:

International Version (POSTGRESQL 8.2 version adds the first 3 lines by default during Postgresql installation)

custom_variable_classes = 'pljava'
pljava.classpath = 'C:\\Program Files\\PostgreSQL\\8.2\\share\\pljava\\pljava.jar'  
pljava.release_lingering_savepoints = true
pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48'
pljava.debug = false

Italian Version

custom_variable_classes = 'pljava'
pljava.classpath = 'C:\\Programmi\\PostgreSQL\\8.1\\share\\pljava\\pljava.jar' 
pljava.release_lingering_savepoints = true
pljava.vmoptions = '-Xmx64M -Dbackchannel.port=48'
pljava.debug = false
  • Connection Settings (* indicates listen for connections on all hosts, remember to specify the host ip addresses in pg_hba.conf file, otherwise you will get database connection refused error while installing adempiere, this option is set by postgresql installation if it this option is selected in version 8.2 during the installation)

listen_addresses = '*'


pg_hba.conf

  • TYPE DATABASE USER CIDR-ADDRESS METHOD

host all all 127.0.0.1/32 trust
host all all 192.168.1.1/24 trust

Step 6

Stop and restart PostgreSQL

Step 7

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\data
  • Run each of the following commands by selecting the text and then pasting into the shell using Right Click / Paste and running each with the password adempiere:
psql -U adempiere -d adempiere -c "drop schema sqlj cascade"

(don't worry if this gives an error because the schema doesn't exist)

psql -U adempiere -d adempiere -f Adempiere_pg.dmp >> dump_errors.log

This will take a few minutes to run and there should be no errors - if you omitted to install the substitution files above then there will be errors! If you observe errors, you can find out what went wrong by inspecting the file dump_errors.log

If you are using pljava functions you may quickly check whether pljava is working by executing the following quiery:

select * from rv_openitem

in pgAdmin III query window against your adempiere database.

Adempiere Setup

Step 8 If you installed a Desktop Shortcut as suggested while you were waiting for PostgreSQL to install, then you can just click the Desktop icon RUN_setup (which is a program that can be run in the future as many times as you want to)

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\adempiere
  • launch RUN_setup.bat

Continuing:

  • Click the Test button
  • Accept the Licence and Keys provided
  • Put in the correct parameters until the Test gives no errors and accepts 5432 as the Database Port

You will need to change:

  • Database Server from <your-computer-name> to localhost
  • Database Type from oracleXE to postgresql
  • Database Name from xe to adempiere
  • System Password to postgres (or whatever you entered above for the database administrator)
  • Database Password to adempiere
  • Don't change anything in the Mail Server settings unless you want to set-up Adempiere for production purposes

Press the Test button

You may also need to change the following:

  • Adempiere Home to C:\Adempiere (if somehow it has been set to the wrong location)
  • Application Server Web Port to 8080 (if 80 is being used by something else) and SSL to 8443 (instead of 443)

When the Test is without errors (shows OK in bottom left hand corner of form), click the Save button at the bottom right, accept the license conditions and wait a few minutes until the deployment is finished and the Adempiere Server Setup screen disappears (don't be impatient!)

More details, in case it is not working: ServerSetupHelp

Common Reasons for errors during setup

  • Make sure you follow every instruction exactly because there are many small details that must be correct!
  • Error on JDK: install JDK (the JRE is not sufficient!)
  • If you change your Java then make sure you change the Environmental Variables JAVA_HOME, JRE_HOME, the two (or three) references in PATH, and the RUN_setup.bat "Java Home"
  • Web Port: probably port 80 is already used by other web server. You can use something like 8080 or 8088 (and correspondingly 8443 for the secure port)
  • If you get "Error Database Port (DB Server Port = 5432)", change the 'Database Server' from <your-computer-name> to localhost. The alternative is to use a fixed IP address on your server or desktop and put this address in the Database Server, or if you have a laptop then you need to install a loopback adapter
  • If you move the Adempiere directory (or update Adempiere) after already executing RUN_setup.bat, then you should delete the file adempiere.properties in C:\Documents & Settings\<your-user-name>
  • If you did not include in your path C:\Program Files\PostgreSQL\8.3\bin , then at Step 7 you will need to replace the psql command with:

International Version

C:\"Program Files"\PostgreSQL\8.3\bin\psql

Italian Version

C:\Programmi\PostgreSQL\8.3\bin\psql

German Version

C:\Programme\PostgreSQL\8.3\bin\psql

Import Adempiere example data

Step 9 :

If you installed a Desktop Shortcut as suggested while you were waiting for PostgreSQL to install, then you can just click the Desktop icon RUN_ImportAdempiere.

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\utils
  • Type 'RUN_ImportAdempiere.bat'

This will take a few minutes and generate a lot of output information.

You can ignore safely WARNING and NOTICES - but check carefully if the output has ERRORS.

Migration Scripts

Now the migrations scripts need to be run. Open a shell with Start Button/Run/cmd and change to the directory where you saved these scripts with cd C:\adscripts You can use dir/w to see the scripts. Starting at the lowest number and ascending, for each of the <number>.sql files run:

 psql -f <number>.sql adempiere adempiere

You will need to enter the password adempiere each time. (Note: there should be no errors in running the migration scripts if you executed Step 7 above with no errors, which is importing the database seed, and RUN_ImportAdempiere has just run through ok.)

Run Adempiere

Step 10 Start the Application Server:

If you installed a Desktop Shortcut as suggested while you were waiting for PostgreSQL to install, then you can just click the Desktop icon RUN_Server2. To use Adempiere in the future, always start this server first.

Otherwise:

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Navigate to C:\Adempiere\utils
  • Type 'RUN_Server2.bat' and wait for the server to fully start - it will end this phase with "INFO [Server] JBoss .... Started in xx:xx:xx ms", which will be around 2 to 3 minutes

Later, to shut down the Application Server, you can either:

  • click the Desktop icon RUN_Server2Stop
  • crash the Server by just closing the shell

Step 11 Start the Adempiere Java Client: To start Adempiere, you can:

  • just click the light blue Desktop icon Adempiere
  • go to Webstart, which is the preferred method following supplementary patch upgrades that may alter the client!
    • using your browser http://<your computer name>/admin and click the blue button on the right hand side
    • Note that this admin screen will also have:
      • various HTML interfaces (see Using Adempiere's HTML Client below)
      • Point of Sale (POS) system
      • Webstore
  • otherwise:
    • Open a DOS shell with Start Button / Run / Open: cmd
    • Navigate to C:\Adempiere\
    • Type RUN_Adempiere.bat

You will see either a login screen or a connection setting window:

  • if you have a login screen labeled Connection, the Server will probably be a pink line. This normally means you need to fix some settings However, it may be pink simply because this is your first login. Try to click the green tick and proceed to login. If you can't do this then you will need to click the pink line so the Adempiere Connection window opens
  • if you find yourself at the Adempiere Connection window, enter <your-computer-name> for the Application Host. Click Test Application Server and it should result in a green tick. In addition, it will probably sort out the Database parameters.
  • click Test Database, which should also result in a green tick
    • Vista Users may need to sort out security - if when you Test Application Server you get a green tick but a red cross when you test the Test Database Server, you have a problem with PostgreSQL security on your computer. As a safety feature PostgreSQL will only let you access it if you are NOT an administrator, which helps to stop any hackers in the real world.
      • Solution for Vista users: Make a new user on your computer. Name it "postgres" and make sure its a standard user, NOT ADMIN. Now run the Setup.bat (same settings should still be there). Click save. Then run the RUN_Server2.bat and then RUN_Adempiere.bat. Do the test now and it should work. Also, make sure that your Application server has your computer name (ie Gregs_PC) and the Database server has localhost
  • Select the green tick to close the Adempiere Connection window


Step 12 Log in to check that everything is working:

  • Login to Adempiere as GardenAdmin with password GardenAdmin. As mentioned above, you should be able to simply click the green tick, which may take a few seconds to move on to the next screen. Accept the defaults (or perhaps change the printer) and click the second green tick. Hey presto - the Java Client will open!

Step 13 Congratulations!!!

Using Adempiere's HTML Client

You can use a Web Browser instead of the Java Client by pointing your browser to: http://<your-computer-name>/admin and selecting the Adempiere ZK webUI option, which will open http://<your-computer-name>/webui

  • On the first login screem enter the following parameters:
    • UserId: GardenAdmin
    • Password: GardenAdmin
  • on second login screen enter:
    • Role: GardenWorld Admin
    • Client: GardenWorld
    • Organisation: HQ (you need to select this from the dropdown box)
    • Warehouse: HQ warehouse (will come up automatically)

Very Important - An ERP system is a journey and not a destination

If you want to keep your Adempiere installation up to date then you need to continue to Patch your Adempiere. The system of migrations and patches that can be deployed so your system is fully up-to-date can be found at....

Clean Up

After a successful installation, you can delete:

  • JDK-###.exe installer
  • Postgresql zip file and extracted location on your desktop
  • Adempiere compressed file
  • C:\adscripts
  • C:\adpatches
  • Substitution files on your desktop

Uninstalling Postgres & Adempiere

Postgresql

  • Start Button / All Programs / Postgresql 8.3 /Stop Service
  • Start Button / Control Panel / Add or remove programs / Postgresql 8.3 remove
  • Delete directory C:\Program Files\Postgresql
  • Start Button / Run / cmd enter command net user postgres /delete
  • Start Button / right click My Computer / Properties / Advanced / Environmental Variables / Edit Path to remove entry for postgresql

Adempiere

  • Delete directory C:\Adempiere
  • Delete file C:\Documents and Settings\<your user name>\Adempiere.properties
  • Start Button / Control Panel / Add or remove programs / Adempiere anything remove

Java Development Kit and Runtime Environment

  • Start Button / Control Panel / Add or remove programs /
    • J2SE Development Kit 5.0 Update xx remove
    • J2SE Runtime Environment 5.0 Update xx remove
  • Start Button / right click My Computer / Properties / Advanced / Environmental Variables:
    • Remove the JAVA_HOME and JRE_HOME variables
    • Edit Path to remove entries for jre
Personal tools