• Configure JBoss service

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #9943  by seanwhe
 
http://wiki.openkm.com/index.php/Config ... ss_service

I can install and start OpenKM as an Application and access over internet but am having problem when I try to use a setup where JBoss is a service.
Code: Select all
/home/openkm/jboss-4.2.3.GA # vim /etc/init.d/jboss 
/home/openkm/jboss-4.2.3.GA # ls -la /etc/init.d/jboss 
-rwxr-xr-x 1 root root 1232 2011-03-29 21:01 /etc/init.d/jboss
/home/openkm/jboss-4.2.3.GA # update-rc.d jboss defaults
 Adding system startup for /etc/init.d/jboss ...
   /etc/rc0.d/K20jboss -> ../init.d/jboss
   /etc/rc1.d/K20jboss -> ../init.d/jboss
   /etc/rc6.d/K20jboss -> ../init.d/jboss
   /etc/rc2.d/S20jboss -> ../init.d/jboss
   /etc/rc3.d/S20jboss -> ../init.d/jboss
   /etc/rc4.d/S20jboss -> ../init.d/jboss
   /etc/rc5.d/S20jboss -> ../init.d/jboss
/home/openkm/jboss-4.2.3.GA # service jboss start
Starting JBoss.
/home/openkm/jboss-4.2.3.GA # 
Seems all good. But when I bring up the URL http://F.Q.D.N:8080/OpenKM/
It returns

ERROR
The requested URL could not be retrieved

The following error was encountered while trying to retrieve the URL: http://F.Q.D.N:8080/OpenKM/

Connection to XX.XX.XX.XX failed.
Code: Select all
The system returned: (111) Connection refused

The remote host or network may be down. Please try the request again.

Your cache administrator is webmaster.

Generated Tue, 29 Mar 2011 20:12:37 GMT by squid (squid/2.7.STABLE9)
If I go up to the JBoss at http://F.Q.D.N:8080/ I see the usual Jboss interface

The ownership of folder and files in /home/openkm is openkm:openkm
Even directories such as cache and repository which were created when I tested start as an Application using run.sh

Any hints or tips appreciated.

Sean
 #9955  by seanwhe
 
Hi,

Okay I solved the problem which was between the keyboard and the chair.

Our squid proxy has cached an earlier error attempt before I had quite configured OpenKM.

After some sleep and a quick retry of he URL it works. :oops:

Sean Wheller
 #11436  by udebi
 
I have tried a lot of version, how to start openkm automaticaly, but no one worked for me (even under ubuntu former, or even nowdays debian 6). I can not start it even manualy not with the /etc/init.d/openkm start option. I get the JBOSS_CMD_START = cd /home/jboss/openkm/bin; /home/jboss/openkm/bin/run.sh -c default -b 0.0.0.0 And this is the even best result :) :( Nothing happens. Former was the problem with missing LSB (solved, now no LSB error, link to debian site deleted, becaose the forum says my post is to "spammy"), than insteed of update-rc.d openkm defaults I used insserv openkm (link to debian site deleted, becaose the forum says my post is to "spammy").
But jboss (and so openkm) automaticaly not starting after reboot.
Code: Select all
#!/bin/sh
### BEGIN INIT INFO
# Provides:          openkm
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO
# This script has been derived from the following one:
# $Id: jboss_init_redhat.sh 71252 2008-03-25 17:52:00Z dbhole $
#
# JBoss Control Script
#
# To use this script run it as root - it will switch to the specified user
#
# Here is a little (and extremely primitive) startup/shutdown script
# for Ubuntu systems. It assumes that JBoss lives in /usr/local/jboss,
# it's run by user 'jboss' and JDK binaries are in /usr/local/jdk.
# All this can be changed in the script itself. 
#
# Either modify this script for your requirements or just ensure that
# the following variables are set correctly before calling the script.
#
# Major changes from the original one:
# * usage of the shutdown.sh script instead of killing the jboss' JVM process. This simplifies the structure of the script.
# * added support for bind address change (see the JBOSS_HOST variable).

#define the JAVA_HOME
JAVA_HOME=${JAVA_HOME:-"/usr/lib/jvm/java-6-sun"}

#define where jboss is - this is the directory containing directories log, bin, conf etc
JBOSS_HOME=${JBOSS_HOME:-"/home/jboss/openkm"}

#define the user under which jboss will run, or use 'RUNASIS' to run as the current user
JBOSS_USER=${JBOSS_USER:-"jboss"}

#configuration to use, usually one of 'minimal', 'default', 'all'
JBOSS_CONF=${JBOSS_CONF:-"default"}

#bind address
JBOSS_HOST=${JBOSS_HOST:-"0.0.0.0"}

#define the script used to start jboss
JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh -c $JBOSS_CONF -b $JBOSS_HOST"}

#define the script used to stop jboss
JBOSSST=${JBOSSST:-"$JBOSS_HOME/bin/shutdown.sh -S -s jnp://$JBOSS_HOST:1099"}

#define what will be done with the console log
JBOSS_CONSOLE=${JBOSS_CONSOLE:-"/dev/null"}

if [ "$JBOSS_USER" = "RUNASIS" ]; then
SUBIT=""
else
SUBIT="su - $JBOSS_USER -c "
fi

if [ -n "$JBOSS_CONSOLE" -a ! -d "$JBOSS_CONSOLE" ]; then
# ensure the file exists
touch $JBOSS_CONSOLE
if [ ! -z "$SUBIT" ]; then
 chown $JBOSS_USER $JBOSS_CONSOLE
fi 
fi

if [ -n "$JBOSS_CONSOLE" -a ! -f "$JBOSS_CONSOLE" ]; then
echo "WARNING: location for saving console log invalid: $JBOSS_CONSOLE"
echo "WARNING: ignoring it and using /dev/null"
JBOSS_CONSOLE="/dev/null"
fi

JBOSS_CMD_START="cd $JBOSS_HOME/bin; $JBOSSSH"
JBOSS_CMD_STOP="cd $JBOSS_HOME/bin; $JBOSSST"

if [ ! -d "$JBOSS_HOME" ]; then
echo JBOSS_HOME does not exist as a valid directory : $JBOSS_HOME
exit 1
fi

case "$1" in
start)
 cd $JBOSS_HOME/bin
 echo JBOSS_CMD_START = $JBOSS_CMD_START
 if [ -z "$SUBIT" ]; then
     eval $JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &
 else
     $SUBIT "$JBOSS_CMD_START >${JBOSS_CONSOLE} 2>&1 &" 
 fi
 ;;
stop)
 cd $JBOSS_HOME/bin
 echo JBOSS_CMD_STOP = $JBOSS_CMD_STOP
 if [ -z "$SUBIT" ]; then
     eval $JBOSS_CMD_STOP >${JBOSS_CONSOLE} 2>&1 &
 else
     $SUBIT "$JBOSS_CMD_STOP >${JBOSS_CONSOLE} 2>&1 &" 
 fi
 ;;
restart)
 $0 stop
 # there must be a time between the "stop" and the "start" because the mentioned two are asynchronous operations.
 # this depends on how fast your machine is.
 sleep 3
 $0 start
 ;;
*)
 echo "usage: $0 (start|stop|restart)"
esac
 #11453  by jllort
 
The script you're using comes by default with jboss but it's for redhat, centos fedora ... with debian you'll got problems with it. I understood your OS is debian.

Sorry for the antispam filter but we received more than 10 spam post daily and must be get some rules in order stopping it, that it's a general benefits for all forum users and unfortunately has some collateral effects, specially on first post.
 #11458  by udebi
 
jllort wrote:The script you're using comes by default with jboss but it's for redhat, centos fedora ... with debian you'll got problems with it. I understood your OS is debian.
Even with ubuntu works it not. I tried autostart (openkm) jboss based other forums post, but nothing. It seems to be a good DMS (openkm), but I have to stay by ubuntu/debian.
 #11471  by jllort
 
There's no problem on ubuntu / debian simply you must write a good script and not using what comes in jboss that's for redhat.

Normally us we install on ubuntu and debian, there's no problem on it. On wiki at jboss service section we've got some scripts to installing jboss as service on ubuntu.
 #11473  by udebi
 
jllort wrote:There's no problem on ubuntu / debian simply you must write a good script and not using what comes in jboss that's for redhat.
Normally us we install on ubuntu and debian, there's no problem on it. On wiki at jboss service section we've got some scripts to installing jboss as service on ubuntu.
Thanks, really, but this solves nothing for me. In two years we do not find a good script. Since then, watching it. Give up. :? :(
(But now I looked at the Alfrescoo. First test, autostarting well, not the best for me, but it works and this is the point. :D )

Thank you for your help!

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.