Category: ‘Java’

Tomcat自動起動

2011年5月30日 Posted by PURGE

■Tomcat6.0 自動起動スクリプト(/etc/rc.d/init.d/tomcat)

#!/bin/bash
#
# Startup script for the tomcat
#
# chkconfig: 345 80 15
# description: Tomcat is a Servlet+JSP Engine.</code>

# Source function library.
. /etc/rc.d/init.d/functions
source /etc/profile.d/tomcat.sh

start(){
if [ ! -f /var/lock/subsys/tomcat ] ; then
echo "Starting tomcat"
$CATALINA_HOME/bin/startup.sh
touch /var/lock/subsys/tomcat
else
echo "tomcat allready running"
fi
}

stop(){
if [ -f /var/lock/subsys/tomcat ] ; then
echo "Shutting down tomcat"
$CATALINA_HOME/bin/shutdown.sh
rm -f /var/lock/subsys/tomcat
else
echo "tomcat not running"
fi
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
$CATALINA_HOME/bin/catalina.sh version
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
esac

exit 0

■環境変数設定(/etc/profile.d/tomcat.sh)

export JAVA_HOME=/usr/local/jdk1.6
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/usr/local/tomcat
export CATALINA_HOME=/usr/local/tomcat
export CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib

■自動起動設定(ランレベル)

$ chkconfig --add tomcat
$ chkconfig --list tomcat
tomcat          0:off   1:off   2:on    3:on    4:on    5:on    6:off

SAStrutsプラグイン

2011年2月17日 Posted by PURGE

Macにeclipse3.6 をインストール後、SAStrutsプラグインをインストールしようとしたら、下記のエラー。

Cannot complete the install because one or more required items could not be found.
Software currently installed: SAStrutsPlugin 0.0.14 (org.seasar.sastrutsplugin.feature.feature.group 0.0.14)
Missing requirement: SAStrutsPlugin 0.0.14 (org.seasar.sastrutsplugin 0.0.14) requires 'bundle org.eclipse.jst.jsp.core 0.0.0' but it could not be found
Cannot satisfy dependency:
From: SAStrutsPlugin 0.0.14 (org.seasar.sastrutsplugin.feature.feature.group 0.0.14)
To: org.seasar.sastrutsplugin [0.0.14]

このサイトに動作環境が書いてあるじゃん。

本当に動作しないのかな?調査中。