Skip to main content

jPOS-EE setup HOWTO

· 2 min read
Alejandro Revilla
jPOS project founder

/by apr When you first get to see jPOS-EE it looks like a puzzle, which is great for our business :) but you can find here very simple instructions to get you going with a basic jPOS-EE UI setup. The basic idea behind the jPOS-EE build system is that we have modules that get merged at compile time, enabling and fostering code reuse among different jPOS-EE applications. We have some standard modules (you can find those in the modules directory) and optional modules (those are in the opt directory). In order to create your application, you need to either copy or symlink selected modules from the opt directory and you obviously need to add your own modules. This step-by-step instructions use MySQL, you can use other RDBMS but we suggest that you get the system going with MySQL and then change it to use your preferred one.

  • Get jPOS-EE using subversion

    svn checkout http://jposee.googlecode.com/svn/trunk/ jposee

  • Copy or symlink the following optional modules into your modules directory:

    commons -> ../opt/commons eecore3 -> ../opt/eecore3 eeweb3 -> ../opt/eeweb3 hibernate3 -> ../opt/hibernate3 hibernate3_mysql -> ../opt/hibernate3_mysql jetty6 -> ../opt/jetty6 jpublish4 -> ../opt/jpublish4 status -> ../opt/status status_ui -> ../opt/status_ui

  • Create the database and grant permissions
    You can review the file devel.properties and change dbname, dbuser and dbpass or you can pick the defaults for this little exercise, i.e:

    CREATE DATABASE jposee; GRANT ALL PRIVILEGES ON jposee.* TO 'sa'@'localhost';

  • Build jPOS-EE
    Call ant (you need a recent version of ant, we are using 1.70 but 1.6.5+ would do

  • Use a little Java or BeanShell script to create your DB and initial user
    You can use bin/bsh to invoke a Beanshell. If you are on Windows you may want to use cygwin or create yourself a BSH.BAT based on our unix based bin/bsh script and run:

    import java.util.; import org.jpos.ee.; import org.hibernate.*;

    DB db = new DB(); db.createSchema (null, true);

    db.open();

    Transaction tx = db.beginTransaction(); User user = new User(); // user='admin', password='test' user.setNick ("admin"); user.setPassword ("66d4aaa5ea177ac32c69946de3731ec0"); user.setName ("System Administrator"); user.grant ("login"); user.grant ("operator"); user.grant ("useradmin"); user.grant ("sysconfig"); user.grant ("admin"); db.session().save (user);

    tx.commit(); db.close();

  • Start jPOS-EE
    You can either call bin/q2, move to the build directory and call java -jar jposee.jar or call ant run

  • Point your browser to http://localhost:8080/jpoeee