Adempiere Install WinXp

From AdempiereWiki

Jump to: navigation, search

Contents

Introduction

This tutorial is for PostgreSQL Installation in Windows (with PL/Java) for ADempiere

The installation can take as little as 15 or 20 minutes if you start with the required downloads and do everything correctly. 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)

Platform

- Windows XP SP2

Setup Pre-Requisite

Step 1

NOTE: if you are using Windows VISTA, make sure UAC is turned off through user accounts.

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

  • Download & install the Java SE Development Kit (JDK) from http://java.sun.com/javase/downloads/index.jsp
  • Note: you also need the JRE (for pljava) which comes with the JDK but just the JRE alone is not sufficient! You want something like JDK 5 Update 14 (Although JDK 6 works, Postgresql and pljava can be incompatible so it is best to use JDK 5 for now). You do not need the NetBeans download, which is twice the size of the plain JDK!
  • Open Explorer and navigate to the C:\Program Files\Java directory (or where-ever your Java is installed) and carefully note the JDK directory you just installed. Note that you may have a number of jdk and jre directories.
  • On your Desktop (or using Start button / My Computer) right click My Computer and select System Properties / Advanced / Enviromental Variables

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

  • Add a new System Variable for your new JDK directory:

JAVA_HOME = C:\Program Files\Java\jdk1.5.0_14

(or whatever your JDK directory is called)

  • Add a new System Variable for your new JRE directory:

JRE_HOME = C:\Program Files\Java\jre1.5.0_14

(or whatever your JRE directory is called)

  • Open a DOS shell with Start Button / Run / Open: cmd
  • Type "echo %JAVA_HOME%" (without the quotes)
  • Carefully check the result to ensure the path to the JDK is correct
  • Type "echo %JRE_HOME%" (without the quotes)
  • Carefully check the result to ensure the path to the JRE is correct
  • Close the shell

Step 2

Still 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.2\bin)

International Version

C:\Program Files\Java\jre1.5.0_14\bin;C:\Program Files\Java\jre1.5.0_14\bin\client;C:\Program Files\PostgreSQL\8.2\bin

Italian Version

C:\Programmi\Java\jre1.5.0_14\bin;C:\Programmi\Java\jre1.5.0_14\bin\client;C:\Programmi\PostgreSQL\8.2\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

Step 4

  • Download to your Desktop the PostgreSQL binary from http://www.postgresql.org/ (note: at the time of writing pljava doesn't work in version 8.3, so it is best to use the latest 8.2.x)
  • Unzip the PostgreSQL binary to a directory Postgres on your desktop (you can delete this and the zip file later)
  • Install PostgreSQL using the Windows msi installer. If you are re-installing Postgresql then you need to remove Postgresql with Control Panel, then remove the directory C:\Program Files\Postgresql\ then remove the user postgres with "net user postgres /delete".
  • Make sure you install the PL/Java files and on the setup screen for activating Programming Languages in the database choose both the PL/pgsql and PL/Java tick boxes. This is an essential step so do not miss it. Note: if your JRE cannot be found, the PL/Java tick box will be greyed-out and you cannot select it. In this case, you must exit the install and make sure the required paths to the JRE are properly set in your Path as in Step 2 above.
  • Install as a Service (later you can set the service to manual start if you don't want PostgreSQL to run when you start-up)
  • Allow a Windows user to be created with name postgres and password postgres (or whatever you want - but write it down!)
  • Instead of C select your local language
  • Instead of SQL-ANSI select UTF8
  • Allow a database administrator to be created with name postgres and password postgres (again, or whatever you want - but write it down!)


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

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

Establish Adempiere

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 & 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:

psql -U adempiere -d adempiere -c "drop schema sqlj cascade"

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

Notes:

  • You may need to review the file dump_errors.log to ensure no errors occur during import
  • To quickly check whether pljava is working issue the following command in pgAdmin III query window against your adempiere database: select * from rv_openitem

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

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

You may also need to change the following:

  • Adempiere Home to C:\Adempiere (if somehow it has been set to the wrong location)
  • Database Server from <your-computer-name> to localhost
  • 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, click the Save button at the bottom right and wait until the deployment is finished

More details, in case it is not working: ServerSetupHelp

Common Reasons for errors during setup

  • Error on JDK: install JDK (the JRE is not sufficient!)
  • Java 6 (such as update 4) does not work with some versions of Adempiere. If there are application server or other errors it may be better to use the older Java 5 JDK and JRE, say 1.5.0_14. 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"
  • Sometimes pljava is broken in Postgresql, for example in version 8.3.0. You will not know this until you try to locate Products in Adempiere (see Step 11 below). If you have problems you will need to use the latest of version Postgresql 8.2
  • Make sure you follow every instruction exactly because there are many small details that must be correct!
  • Java Home: in My Computer / System Properties / Advanced / Environmental Variables create a System Variable JAVA_HOME for the location of your JDK
  • 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.2\bin , then at Step 7 you will need to replace the psql command with:

International Version

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

Italian Version

C:\Programmi\PostgreSQL\8.2\bin\psql

German Version

C:\Programme\PostgreSQL\8.2\bin\psql

Step 9 :

Import the Adempiere data. 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'

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

Otherwise:

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

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:

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_Adempiere

Otherwise:

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

Continuing ...

  • On the first Login Screen labelled Connection, the Server will probably be a pink line. Click the pink line so the Adempiere Connection window opens
  • Enter <your-computer-name> for the Application Host. Click Test Application Server and it should result in a green tick as well as sort out the Database parameters.\
  • Click Test Database, which should result in a green tick (Vista Users may need to sort out security as in the Note below)
  • Select the green tick to close the Adempiere Connection window.

Note for Vista users: If when you Test Application Server you get a green tick but a red cross for Test Database 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-> 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, for Test Application server use your computer name (ie Gregs_PC) but for the Database use localhost

Step 12 Create a Purchase Order to check that PL/Java is working:

  • Login to Adempiere as GardenAdmin with password GardenAdmin. On the next screen accept the defaults and click the green tick. The Java Client will open!
  • Select Menu tab
  • Select Requisition-to-Invoice / Purchase Order
  • A new record will open with the Business Partner field in pink
  • Click the icon at the end of the Business Partner and a Business Partner Info window will open
  • Press Enter and all the Business Partners will show
  • Highlight Tree Farm or another partner, and click the green tick
  • On the left menu, select PO Line
  • Click icon on the end of the Product field and the Product Info window will open
  • Press Enter and all the Products should appear. If the Products do appear the PL/Java is operational. If the Products do not appear then your PL/Java is not working and you need to check that you have activated PL/Java in the method above!

To Exit:

  • Click the red cross to Exit
  • Close the Purchase Order window to Exit this PL/Java confirmation test.

Step 13 Congratulations!!!:

You might want to check for patches though. See Patches_Installation for a manual on how to install them.

Personal tools