Download sources - http://www.redmine.org/
# Install commands, Ubuntu - specific, not from official instruction:
sudo apt-get install ruby ruby-dev
sudo apt-get install postgresql libpq-dev
sudo apt-get install imagemagic libmagickwand-dev ruby-rmagick
# Install commands, universal:
sudo gem install bundler
cd redmine-2.3
sudo bundle install --without development test mysql
sudo gem install pg
cp config/database.yml.example config/database.yml
Edit config/database.yml:
production:
adapter: postgresql
database: redmine
host: localhost
username: postgres
password: "postgres"
rake generate_secret_token
createdb -E UTF8 redmine
# Restore Redmine from backup:
pg_restore -d redmine -Fc -O redmine.backup
rake db:migrate RAILS_ENV=production
rake tmp:cache:clear
rake tmp:sessions:clear
# Startup script redmine.sh:
#!/bin/bash
cd /opt/redmine-2.3
export RAILS_ENV=production
nohup ruby script/rails server webrick -e production &
Thursday, July 11, 2013
Tuesday, November 27, 2012
Java VM GC optimization
First, you can try the latest G1 Garbage collection in JDK 7u4 and later:
-XX:+UseG1GC (JDK 1.7u4) -
G1 GC give more predictable pauses and latency with large heaps.
-Xloggc:/some/relative/or/absolute/path/gc.log
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-XX:+PrintTenuringDistribution
Other rich variant:
-verbose:gc
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-XX:+PrintTenuringDistribution
-XX:+PrintPromotionFailure
-XX:+PrintClassHistogramBeforeFullGC
-XX:+PrintClassHistogramAfterFullGC
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCApplicationStoppedTime
-Xloggc:memory/gc.log
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=memory/heap.dump
-XX:+UnlockDiagnosticVMOptions
-XX:+PrintAssembly
-XX:+CheckJNICalls
-server
-Xms2048m
-Xmx2048m
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+AggressiveOpts
-XX:+CMSParallelRemarkEnabled
-XX:+CMSScavengeBeforeRemark
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=65
-XX:CMSWaitDuration=300000
-XX:GCTimeRatio=19
-XX:+DisableExplicitGC
-XX:NewSize=128m
-XX:MaxNewSize=128m
-XX:PermSize=64m
-XX:MaxPermSize=64m
-XX:SurvivorRatio=88
-XX:TargetSurvivorRatio=88
-XX:MaxTenuringThreshold=15
-XX:MaxGCMinorPauseMillis=1
-XX:MaxGCPauseMillis=5
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=./gc_heap_dump/
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
-XX:+PrintTenuringDistribution
-Xloggc:./gc_log.log
-XX:+AggressiveHeap
-XX:+UseCompressedOops
-XX:+CompactFields
-XX:+CMSClassUnloadingEnabled
-XX:+UseSharedSpaces
-XX:-UseLoopPredicate
Max number of opened files
/etc/security/limits.conf
your_username soft nofile 32768
your_username hard nofile 65536
-XX:+UseG1GC (JDK 1.7u4) -
G1 GC give more predictable pauses and latency with large heaps.
Print GC statistics
In order to be informed of any latencies caused by gc, you need to turn on gc logging. This is the magic combination of switches that works well:
-Xloggc:/some/relative/or/absolute/path/gc.log
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-XX:+PrintTenuringDistribution
Other rich variant:
-verbose:gc
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-XX:+PrintTenuringDistribution
-XX:+PrintPromotionFailure
-XX:+PrintClassHistogramBeforeFullGC
-XX:+PrintClassHistogramAfterFullGC
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGCApplicationStoppedTime
-Xloggc:memory/gc.log
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=memory/heap.dump
-XX:+UnlockDiagnosticVMOptions
-XX:+PrintAssembly
-XX:+CheckJNICalls
Good latency pattern
Here is the list of the recommended JVM settings for low latency & high throughput (JDK 1.6):
-server
-Xms2048m
-Xmx2048m
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+AggressiveOpts
-XX:+CMSParallelRemarkEnabled
-XX:+CMSScavengeBeforeRemark
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=65
-XX:CMSWaitDuration=300000
-XX:GCTimeRatio=19
-XX:+DisableExplicitGC
-XX:NewSize=128m
-XX:MaxNewSize=128m
-XX:PermSize=64m
-XX:MaxPermSize=64m
-XX:SurvivorRatio=88
-XX:TargetSurvivorRatio=88
-XX:MaxTenuringThreshold=15
-XX:MaxGCMinorPauseMillis=1
-XX:MaxGCPauseMillis=5
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=./gc_heap_dump/
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
-XX:+PrintTenuringDistribution
-Xloggc:./gc_log.log
Aggressive memory and execution settings
-server
-XX:+AggressiveHeap
-XX:+UseCompressedOops
-XX:+CompactFields
-XX:+CMSClassUnloadingEnabled
-XX:+UseSharedSpaces
-XX:-UseLoopPredicate
Linux system tuning
Max number of opened files
/etc/security/limits.conf
your_username soft nofile 32768
your_username hard nofile 65536
Thursday, August 11, 2011
Install Bonita BPMS 5.4.2 with JBoss 6
(also tested with Bonita 5.5)
Bonita API tutorials
http://www.bonitasoft.org/blog/tutorial/building-your-applications-with-bonita-runtime-part-1/
http://www.bonitasoft.org/blog/tutorial/building-your-applications-with-bonita-runtime-part-2/
http://www.bonitasoft.org/blog/tutorial/building-your-applications-with-bonita-runtime-%E2%80%93-part-3/
Bonita installation tutorials
http://www.bonitasoft.org/wiki/doku.php
http://www.bonitasoft.org/wiki/doku.php?id=install_bos5.3_in_jboss
==============================
Installation:
- download Bonita 5.4.2 + JBoss 5.1 bundle
- copy bonita-app.war bonita.ear bonita.war to JBOSS_HOME/server/default/deploy/
- rename bonita.war to bonita-web.war
new administration path - http://127.0.0.1:8080/bonita-web/
(otherwise JBoss 6 generate exception because two appication with similar name.)
copy folders bonita/client bonita/server/ from bundle to JBOSS_HOME/
add Bonita configuration lines to JBOSS_HOME/bin/run.conf
#Sets Bonita configuration variables
BONITA_OPTS="-DBONITA_HOME=../bonita -Dorg.ow2.bonita.api-type=EJB3 "
MEMORY_OPTS="-Xshare:auto -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError"
LOG_OPTS="-Djava.util.logging.config.file=../external/logging/logging.properties"
JAVA_OPTS="$JAVA_OPTS $BONITA_OPTS $MEMORY_OPTS $LOG_OPTS"
export JAVA_OPTS
- if your start directory is not $JBOSS_HOME/bin then you must add absolute path to BONITA_HOME, for example -DBONITA_HOME=/opt/jboss-6.0.0.Final/bonita
- add security configuration to JBoss:
Add to $asDomain\conf\login-config.xml inside <policy> tags:
<!-- Config for Bonita -->
<application-policy name="BonitaAuth">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.BonitaIdentityLoginModule" flag="required"/>
</authentication>
</application-policy>
<application-policy name="BonitaStore">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.BonitaRemoteLoginModule" flag="required"/>
<login-module code="org.jboss.security.ClientLoginModule" flag="required">
<module-option name="password-stacking">useFirstPass</module-option>
</login-module>
</authentication>
</application-policy>
<!-- End config for bonita -->
==============================
Libraries:
- add
bonita-client-5.4.2.jar
jaxrs-api-1.2.1.GA.jar
to $JBOSS_HOME/client
- replace slf4j-api with version 1.6.1 (latest)
- replace hibernate-search with version 3.4.Final (latest) and move to /common/lib/
- replace lucene-core with version 3.1 (latest) and move to /common/lib/
- replace lucene-analyzers with version 3.1 (latest) and move to /common/lib/
bonita.war
- remove asm.jar
commons-codecs
commons-io
commons-logging
slfj
xstream
remove all hibernate & lucene libraries from bonita.ear WEB-INF/lib
(I removed all libraries from bonita.ear WEB-INF/lib)
==============================
Source code changes:
- make 2 changes in org.ow2.bonita.search.SearchUtil java class:
1 - recompile SearchUtil with hibernate-search-3.4.jar in dependencies
2 - remive (comment) all hibernate search hanlers regishtations
You can find SearchUtil.java here:
http://svn.bonitasoft.org/bonita-runtime/tags/bonita-runtime-5.4/bonita-server/src/main/java/org/ow2/bonita/search/SearchUtil.java
and SearchUtil.class in bonita.ear:bonita-ejbjar.jar
rebuild with hibernate-search-3.4.jar in dependencies and pack back to bonita.ear:bonita-ejbjar.jar
==============================
Switch from H2 to PostgreSQL database (optional):
- create PostgreSQL Bonita databases:
createdb -h localhost -U postgres -E UTF8 bonita_journal
createdb -h localhost -U postgres -E UTF8 bonita_history
(Bonita will self-create tables)
- copy postgresql JDBC driver jar file to JBOSS_HOME/server/default/lib/
- remove $JBOSS_HOME/server/default/deploy/h2-ds.xml
- create Bonita database configuration file $JBOSS_HOME/server/default/deploy/postgres-ds.xml
with text:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<no-tx-datasource>
<jndi-name>bonita/default/journal</jndi-name>
<connection-url>jdbc:postgresql://localhost/bonita_journal</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password></password>
<idle-timeout-minutes>0</idle-timeout-minutes>
</no-tx-datasource>
<no-tx-datasource>
<jndi-name>bonita/default/history</jndi-name>
<connection-url>jdbc:postgresql://localhost/bonita_history</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password></password>
<idle-timeout-minutes>0</idle-timeout-minutes>
</no-tx-datasource>
</datasources>
Edit these files (comment H2 parts and uncomment PostgreSQL parts)
jboss-6.0.0.Final/bonita/server/default/conf/bonita-history.properties
jboss-6.0.0.Final/bonita/server/default/conf/bonita-journal.properties
(there is bug - PostgreSQL port 5432 written as 5433 - you must replace to 5432)
....
Profit!
Bonita API tutorials
http://www.bonitasoft.org/blog/tutorial/building-your-applications-with-bonita-runtime-part-1/
http://www.bonitasoft.org/blog/tutorial/building-your-applications-with-bonita-runtime-part-2/
http://www.bonitasoft.org/blog/tutorial/building-your-applications-with-bonita-runtime-%E2%80%93-part-3/
Bonita installation tutorials
http://www.bonitasoft.org/wiki/doku.php
http://www.bonitasoft.org/wiki/doku.php?id=install_bos5.3_in_jboss
==============================
Installation:
- download Bonita 5.4.2 + JBoss 5.1 bundle
- copy bonita-app.war bonita.ear bonita.war to JBOSS_HOME/server/default/deploy/
- rename bonita.war to bonita-web.war
new administration path - http://127.0.0.1:8080/bonita-web/
(otherwise JBoss 6 generate exception because two appication with similar name.)
copy folders bonita/client bonita/server/ from bundle to JBOSS_HOME/
add Bonita configuration lines to JBOSS_HOME/bin/run.conf
#Sets Bonita configuration variables
BONITA_OPTS="-DBONITA_HOME=../bonita -Dorg.ow2.bonita.api-type=EJB3 "
MEMORY_OPTS="-Xshare:auto -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError"
LOG_OPTS="-Djava.util.logging.config.file=../external/logging/logging.properties"
JAVA_OPTS="$JAVA_OPTS $BONITA_OPTS $MEMORY_OPTS $LOG_OPTS"
export JAVA_OPTS
- if your start directory is not $JBOSS_HOME/bin then you must add absolute path to BONITA_HOME, for example -DBONITA_HOME=/opt/jboss-6.0.0.Final/bonita
- add security configuration to JBoss:
Add to $asDomain\conf\login-config.xml inside <policy> tags:
<!-- Config for Bonita -->
<application-policy name="BonitaAuth">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.BonitaIdentityLoginModule" flag="required"/>
</authentication>
</application-policy>
<application-policy name="BonitaStore">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.BonitaRemoteLoginModule" flag="required"/>
<login-module code="org.jboss.security.ClientLoginModule" flag="required">
<module-option name="password-stacking">useFirstPass</module-option>
</login-module>
</authentication>
</application-policy>
<!-- End config for bonita -->
==============================
Libraries:
- add
bonita-client-5.4.2.jar
jaxrs-api-1.2.1.GA.jar
to $JBOSS_HOME/client
- replace slf4j-api with version 1.6.1 (latest)
- replace hibernate-search with version 3.4.Final (latest) and move to /common/lib/
- replace lucene-core with version 3.1 (latest) and move to /common/lib/
- replace lucene-analyzers with version 3.1 (latest) and move to /common/lib/
bonita.war
- remove asm.jar
commons-codecs
commons-io
commons-logging
slfj
xstream
remove all hibernate & lucene libraries from bonita.ear WEB-INF/lib
(I removed all libraries from bonita.ear WEB-INF/lib)
==============================
Source code changes:
- make 2 changes in org.ow2.bonita.search.SearchUtil java class:
1 - recompile SearchUtil with hibernate-search-3.4.jar in dependencies
2 - remive (comment) all hibernate search hanlers regishtations
You can find SearchUtil.java here:
http://svn.bonitasoft.org/bonita-runtime/tags/bonita-runtime-5.4/bonita-server/src/main/java/org/ow2/bonita/search/SearchUtil.java
and SearchUtil.class in bonita.ear:bonita-ejbjar.jar
rebuild with hibernate-search-3.4.jar in dependencies and pack back to bonita.ear:bonita-ejbjar.jar
==============================
Switch from H2 to PostgreSQL database (optional):
- create PostgreSQL Bonita databases:
createdb -h localhost -U postgres -E UTF8 bonita_journal
createdb -h localhost -U postgres -E UTF8 bonita_history
(Bonita will self-create tables)
- copy postgresql JDBC driver jar file to JBOSS_HOME/server/default/lib/
- remove $JBOSS_HOME/server/default/deploy/h2-ds.xml
- create Bonita database configuration file $JBOSS_HOME/server/default/deploy/postgres-ds.xml
with text:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<no-tx-datasource>
<jndi-name>bonita/default/journal</jndi-name>
<connection-url>jdbc:postgresql://localhost/bonita_journal</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password></password>
<idle-timeout-minutes>0</idle-timeout-minutes>
</no-tx-datasource>
<no-tx-datasource>
<jndi-name>bonita/default/history</jndi-name>
<connection-url>jdbc:postgresql://localhost/bonita_history</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password></password>
<idle-timeout-minutes>0</idle-timeout-minutes>
</no-tx-datasource>
</datasources>
Edit these files (comment H2 parts and uncomment PostgreSQL parts)
jboss-6.0.0.Final/bonita/server/default/conf/bonita-history.properties
jboss-6.0.0.Final/bonita/server/default/conf/bonita-journal.properties
(there is bug - PostgreSQL port 5432 written as 5433 - you must replace to 5432)
....
Profit!
Thursday, July 7, 2011
Mercurial Version Control CheatSheet
Tutorial: http://hgbook.red-bean.com/read/
create a new repository in the given directory:
hg init
Making a local copy of a repository:
hg clone http://hg.serpentine.com/tutorial/hello
A tour through history:
hg log
Viewing specific revisions:
hg log -r 3
hg log -r 0272e0d5a517
hg log -r 4:2 (from 2 to 4 revision)
display the latest changeset (HEAD revision):
hg tip
tell what Mercurial knows about the files in the repository:
hg status
review changes:
hg diff
create a new changeset:
hg commit
use the hg pull command to bring changes from remote repository to local (hg pull does not (by default) touch the working directory files):
hg pull [remote repository]
command to tell us what changes the hg pull command would pull into the repository, without actually pulling the changes in:
hg incoming [remote repository]
update working files to latest repository revision:
hg update tip
The hg outgoing command tells us what changes would be pushed into another repository
(it simply lists any changes in the current repository that aren’t in the another repository):
hg outgoing [remote repository]
And the hg push command does the actual push into another repository:
hg push [remote repository]
Make patch from single revision:
hg export 3 > ../changes.diff
or
hg export tip > patch.diff
Apply patch (single revision):
hg import ../changes.diff
Create branch:
hg clone -r mybranchname
List activerepository branches:
hg branches -a
List actual repository branch head revisions:
hg heads
Merge heads:
hg merge
hg commit -m "merge"
Tag version:
hg tag Version-1.0
Init new project:
hg init myproject
Import Subversion repository
(Mercurial will automatically detect the trunk, tags and branches layout that Subversion projects usually use):
hg convert http://python-nose.googlecode.com/svn
To start tracking working files:
hg add
Undo changes that you have made to your working directory:
hg revert
Undo revision:
hg rollback
Undo entire changeset:
hg backout --merge
Finding the source (revision) of a bug:
hg bisect
Repository backup (The -U option doesn't check out a working directory after the clone completes):
hg clone -U myrepo myrepo.bak
Sign code (GPG extension):
hg sign [REVISION]
Check signature:
hg sigcheck REVISION
List signed revisions:
hg sigs
create a new repository in the given directory:
hg init
Making a local copy of a repository:
hg clone http://hg.serpentine.com/tutorial/hello
A tour through history:
hg log
Viewing specific revisions:
hg log -r 3
hg log -r 0272e0d5a517
hg log -r 4:2 (from 2 to 4 revision)
display the latest changeset (HEAD revision):
hg tip
tell what Mercurial knows about the files in the repository:
hg status
review changes:
hg diff
create a new changeset:
hg commit
use the hg pull command to bring changes from remote repository to local (hg pull does not (by default) touch the working directory files):
hg pull [remote repository]
command to tell us what changes the hg pull command would pull into the repository, without actually pulling the changes in:
hg incoming [remote repository]
update working files to latest repository revision:
hg update tip
The hg outgoing command tells us what changes would be pushed into another repository
(it simply lists any changes in the current repository that aren’t in the another repository):
hg outgoing [remote repository]
And the hg push command does the actual push into another repository:
hg push [remote repository]
Make patch from single revision:
hg export 3 > ../changes.diff
or
hg export tip > patch.diff
Apply patch (single revision):
hg import ../changes.diff
Create branch:
hg clone -r mybranchname
List activerepository branches:
hg branches -a
List actual repository branch head revisions:
hg heads
Merge heads:
hg merge
hg commit -m "merge"
Tag version:
hg tag Version-1.0
Init new project:
hg init myproject
Import Subversion repository
(Mercurial will automatically detect the trunk, tags and branches layout that Subversion projects usually use):
hg convert http://python-nose.googlecode.com/svn
To start tracking working files:
hg add
Undo changes that you have made to your working directory:
hg revert
Undo revision:
hg rollback
Undo entire changeset:
hg backout --merge
Finding the source (revision) of a bug:
hg bisect
Repository backup (The -U option doesn't check out a working directory after the clone completes):
hg clone -U myrepo myrepo.bak
Sign code (GPG extension):
hg sign [REVISION]
Check signature:
hg sigcheck REVISION
List signed revisions:
hg sigs
Friday, May 27, 2011
OpenERP 6.0 installation instruction (Debian 5)
Please read my previous post http://enterprise-soft.blogspot.com/2011/05/openerp-60-installation-instruction.html
Here are only Debian 5 specific differences
# install system dependencies
apt-get install python
apt-get install python-lxml
apt-get install python-mako
apt-get install python-egenix-mxdatetime
apt-get install python-dateutil
apt-get install python-psycopg2
apt-get install python-pychart
apt-get install python-pydot
apt-get install python-tz
apt-get install python-reportlab
apt-get install python-yaml
apt-get install python-vobject
apt-get install python-setuptools
apt-get install python-matplotlib # for client
apt-get install python-hippocanvas # for client
# configuration file for Debian - /usr/share/doc/openerp-server-6.0.2/openerp-server.conf
adduser openerp
su openerp
cd
#run for testing:
python /usr/lib/python2.5/site-packages/openerp-server/openerp-server.py
# run standalone server:
nohup python /usr/lib/python2.5/site-packages/openerp-server/openerp-server.py &
Postinstall steps
1. OpenERP client - change superadministrator password
2. OpenERP client - create database for your company
Here are only Debian 5 specific differences
# install system dependencies
apt-get install python
apt-get install python-lxml
apt-get install python-mako
apt-get install python-egenix-mxdatetime
apt-get install python-dateutil
apt-get install python-psycopg2
apt-get install python-pychart
apt-get install python-pydot
apt-get install python-tz
apt-get install python-reportlab
apt-get install python-yaml
apt-get install python-vobject
apt-get install python-setuptools
apt-get install python-matplotlib # for client
apt-get install python-hippocanvas # for client
# configuration file for Debian - /usr/share/doc/openerp-server-6.0.2/openerp-server.conf
adduser openerp
su openerp
cd
#run for testing:
python /usr/lib/python2.5/site-packages/openerp-server/openerp-server.py
# run standalone server:
nohup python /usr/lib/python2.5/site-packages/openerp-server/openerp-server.py &
Postinstall steps
1. OpenERP client - change superadministrator password
2. OpenERP client - create database for your company
OpenERP 6.0 installation instruction (Ubuntu)
# download openerp-server and openerp-client sources from official site http://www.openerp.com/
# create database user
sudo su postgres
createuser openerp
psql template1 -c "alter role openerp with password 'postgres'";
exit
# install system dependencies
sudo apt-get install python-lxml
sudo apt-get install python-mako
sudo apt-get install python-egenix-mxdatetime
sudo apt-get install python-dateutil
sudo apt-get install python-psycopg2
sudo apt-get install python-pychart
sudo apt-get install python-pydot
sudo apt-get install python-tz
sudo apt-get install python-reportlab
sudo apt-get install python-yaml
sudo apt-get install python-vobject
sudo apt-get install python-setuptools
sudo apt-get install python-webdav # for client
sudo apt-get install python-matplotlib
sudo apt-get install python-hippocanvas
# test server:
tar -xzf openerp-server-6.0.0.tar.gz
cd openerp-server-6.0.0/bin
python openerp-server.py
# install server:
tar -xzf openerp-server-6.0.0.tar.gz
cd openerp-server-6.0.0
sudo python setup.py install
# run server:
openerp-server
#GTK client v. 5.0.14:
sudo apt-get install openerp-client
Open ERP Folder:
/usr/local/share/doc/openerp-server-6.0.2
# You can find the OpenERP server configuration file at ~/openerp-server-6.0.0/doc/openerp-server.conf
/usr/local/share/doc/openerp-server-6.0.2/doc/openerp-server.conf
(Debian - /usr/share/doc/openerp-server-6.0.2/openerp-server.conf )
Database Configuration:
1. configure openerp-server.conf
2. run server (openerp-server)
3. install GTK client
4. configure client to server path
5. create database from client menu
To create database from command line:
openerp-server -d DB_NAME -r DB_USER -w DB_PASSWORD --init=модули [--without-demo=all]
# create database user
sudo su postgres
createuser openerp
psql template1 -c "alter role openerp with password 'postgres'";
exit
# install system dependencies
sudo apt-get install python-lxml
sudo apt-get install python-mako
sudo apt-get install python-egenix-mxdatetime
sudo apt-get install python-dateutil
sudo apt-get install python-psycopg2
sudo apt-get install python-pychart
sudo apt-get install python-pydot
sudo apt-get install python-tz
sudo apt-get install python-reportlab
sudo apt-get install python-yaml
sudo apt-get install python-vobject
sudo apt-get install python-setuptools
sudo apt-get install python-webdav # for client
sudo apt-get install python-matplotlib
sudo apt-get install python-hippocanvas
# test server:
tar -xzf openerp-server-6.0.0.tar.gz
cd openerp-server-6.0.0/bin
python openerp-server.py
# install server:
tar -xzf openerp-server-6.0.0.tar.gz
cd openerp-server-6.0.0
sudo python setup.py install
# run server:
openerp-server
#GTK client v. 5.0.14:
sudo apt-get install openerp-client
Open ERP Folder:
/usr/local/share/doc/openerp-server-6.0.2
# You can find the OpenERP server configuration file at ~/openerp-server-6.0.0/doc/openerp-server.conf
/usr/local/share/doc/openerp-server-6.0.2/doc/openerp-server.conf
(Debian - /usr/share/doc/openerp-server-6.0.2/openerp-server.conf )
Database Configuration:
1. configure openerp-server.conf
2. run server (openerp-server)
3. install GTK client
4. configure client to server path
5. create database from client menu
To create database from command line:
openerp-server -d DB_NAME -r DB_USER -w DB_PASSWORD --init=модули [--without-demo=all]
Friday, May 6, 2011
jBPM 5 Tips
From jBoss advertisement (http://www.jboss.org/jbpm/components/core-engine.html):
- From a spring based web application for a grocery store on Tomcat over a top scale banking application to a plain standalone Java application.
- The jBPM engine can be used as a remote service.
- Simple API
- Human tasks
- Integrated with rules engine
- Transactional execution, timers and asynchronous continuations
Reality:
0. jBPM & Drools source code & documentation quality
- no comments in source code
- no Java API with any comments. (What do fireAllRuless() function while I start BPMN2 process?).
jBPM only:
- no developer documentation
- no typical deployment configurations (only Tomcal+hibernate. No typical GlassFish or JBoss configurations).
- no examples. Test cases only. Developer need read Drools documentation & source code for BPMN programming!
- absolutly unusefull API for Business Process Management. jBPM 5.0 have only API for Rules in simple drools-flow session, but it is nontrivial task to find active tasks for user "myuser" avtivity.
- no usefull remote API. Remote application can set tast "completed" or "aborted" but it cannot find tasks for execution! It must already now the Task ID for set it "completed", but without search! JBoss group said it is "Simple API" and "The jBPM engine can be used as a remote service." :)
- now any user authorithation internally (in source code)
- TCP port for MinaTaskServer "Human Task" without any authorithation. JBoss group said it is "top scale banking application" - ready :) Banks are welcome:)
- The community of previous versions of jBPM migrated from JBoss to Activiti fork project.
Guvner only:
- No any way to integrate with Subversion or other version control or build system for developers.
2. Do you want to use JPA persistence?
- You need add persistence.xml + orm.cml to META-INF folder.
- You need catch exception ProcessInstancesWaitingForEvent, then use google, then find ProcessInstancesWaitingForEvent named query in GWT (http://community.jboss.org/thread/162854), then manually add ProcessInstancesWaitingForEvent named query to orm.xml.
ProcessInstancesWaitingForEvent named query:
<named-query name="ProcessInstancesWaitingForEvent">
<query>
select
processInstanceInfo.processInstanceId
from
ProcessInstanceInfo processInstanceInfo
where
:type in elements(processInstanceInfo.eventTypes)
</query>
</named-query>
jBPM 5.0 Final user documentation said, for persistance:
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);
It is not work with JPA, of course.
In reality (work example from jBPM JUnit test):
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory","org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, config, env);
- For PostgreSQL, after Hibernate create database structure, developer must run database modification script to fix metadata bug:
ALTER TABLE sessioninfo DROP COLUMN rulesbytearray;
ALTER TABLE sessioninfo ADD COLUMN rulesbytearray bytea;
ALTER TABLE workiteminfo DROP COLUMN workitembytearray;
ALTER TABLE workiteminfo ADD COLUMN workitembytearray bytea;
There is same bug in processinstanceinfo table - processinstancebytearray column, but ORM mapping do not allow fix it by simple database modification.
So, yes! It is 5.0 FINAL version! :)
3. Do you want to use JBoss JPA?
- Use this persistence.xml configuration:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/jdbc/jbpmDS</jta-data-source>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Delegation</class>
<class>org.jbpm.task.Escalation</class>
<class>org.jbpm.task.Group</class>
<class>org.jbpm.task.I18NText</class>
<class>org.jbpm.task.Notification</class>
<class>org.jbpm.task.EmailNotification</class>
<class>org.jbpm.task.EmailNotificationHeader</class>
<class>org.jbpm.task.PeopleAssignments</class>
<class>org.jbpm.task.Reassignment</class>
<class>org.jbpm.task.Status</class>
<class>org.jbpm.task.SubTasksStrategy</class>
<class>org.jbpm.task.Task</class>
<class>org.jbpm.task.TaskData</class>
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.jdbc.batch_size" value="20"/>
<property name="hibernate.default_schema" value="public"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
Still you want to use jBPM and DRools now?
- From a spring based web application for a grocery store on Tomcat over a top scale banking application to a plain standalone Java application.
- The jBPM engine can be used as a remote service.
- Simple API
- Human tasks
- Integrated with rules engine
- Transactional execution, timers and asynchronous continuations
Reality:
0. jBPM & Drools source code & documentation quality
- no comments in source code
- no Java API with any comments. (What do fireAllRuless() function while I start BPMN2 process?).
jBPM only:
- no developer documentation
- no typical deployment configurations (only Tomcal+hibernate. No typical GlassFish or JBoss configurations).
- no examples. Test cases only. Developer need read Drools documentation & source code for BPMN programming!
- absolutly unusefull API for Business Process Management. jBPM 5.0 have only API for Rules in simple drools-flow session, but it is nontrivial task to find active tasks for user "myuser" avtivity.
- no usefull remote API. Remote application can set tast "completed" or "aborted" but it cannot find tasks for execution! It must already now the Task ID for set it "completed", but without search! JBoss group said it is "Simple API" and "The jBPM engine can be used as a remote service." :)
- now any user authorithation internally (in source code)
- TCP port for MinaTaskServer "Human Task" without any authorithation. JBoss group said it is "top scale banking application" - ready :) Banks are welcome:)
- The community of previous versions of jBPM migrated from JBoss to Activiti fork project.
Guvner only:
- No any way to integrate with Subversion or other version control or build system for developers.
1. Experimental & unstable dependencies in "stable" releases.
jBPM 5.0 FINAL is based on Drool Flow and include drools, drools-flow 5.2.0.M1 (Milestome 1) library, with unfixed database bugs, etc. It is Drools/jBPM practice. It is fact.
2. Do you want to use JPA persistence?
- You need add persistence.xml + orm.cml to META-INF folder.
- You need catch exception ProcessInstancesWaitingForEvent, then use google, then find ProcessInstancesWaitingForEvent named query in GWT (http://community.jboss.org/thread/162854), then manually add ProcessInstancesWaitingForEvent named query to orm.xml.
ProcessInstancesWaitingForEvent named query:
<named-query name="ProcessInstancesWaitingForEvent">
<query>
select
processInstanceInfo.processInstanceId
from
ProcessInstanceInfo processInstanceInfo
where
:type in elements(processInstanceInfo.eventTypes)
</query>
</named-query>
jBPM 5.0 Final user documentation said, for persistance:
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);
It is not work with JPA, of course.
In reality (work example from jBPM JUnit test):
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory","org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, config, env);
- For PostgreSQL, after Hibernate create database structure, developer must run database modification script to fix metadata bug:
ALTER TABLE sessioninfo DROP COLUMN rulesbytearray;
ALTER TABLE sessioninfo ADD COLUMN rulesbytearray bytea;
ALTER TABLE workiteminfo DROP COLUMN workitembytearray;
ALTER TABLE workiteminfo ADD COLUMN workitembytearray bytea;
There is same bug in processinstanceinfo table - processinstancebytearray column, but ORM mapping do not allow fix it by simple database modification.
So, yes! It is 5.0 FINAL version! :)
3. Do you want to use JBoss JPA?
- Use this persistence.xml configuration:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/jdbc/jbpmDS</jta-data-source>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Delegation</class>
<class>org.jbpm.task.Escalation</class>
<class>org.jbpm.task.Group</class>
<class>org.jbpm.task.I18NText</class>
<class>org.jbpm.task.Notification</class>
<class>org.jbpm.task.EmailNotification</class>
<class>org.jbpm.task.EmailNotificationHeader</class>
<class>org.jbpm.task.PeopleAssignments</class>
<class>org.jbpm.task.Reassignment</class>
<class>org.jbpm.task.Status</class>
<class>org.jbpm.task.SubTasksStrategy</class>
<class>org.jbpm.task.Task</class>
<class>org.jbpm.task.TaskData</class>
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.jdbc.batch_size" value="20"/>
<property name="hibernate.default_schema" value="public"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
Still you want to use jBPM and DRools now?
Subscribe to:
Posts (Atom)