Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0597D870 for ; Fri, 24 Aug 2012 22:23:40 +0000 (UTC) Received: (qmail 72590 invoked by uid 500); 24 Aug 2012 22:23:36 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 72528 invoked by uid 500); 24 Aug 2012 22:23:36 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 72518 invoked by uid 99); 24 Aug 2012 22:23:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2012 22:23:36 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fjanon@gmail.com designates 209.85.216.52 as permitted sender) Received: from [209.85.216.52] (HELO mail-qa0-f52.google.com) (209.85.216.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2012 22:23:31 +0000 Received: by qabg14 with SMTP id g14so1008456qab.18 for ; Fri, 24 Aug 2012 15:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=rjQ4zmJQmvi1eqMteW+tBWDmTC8DwHDWmSzZgmO12Zw=; b=08CK3+Tge4CeWnlzBYQRQ1rmJhfKPB2rUWwCKtgdf0YJ40O27RpMHzjMGLdV1onGD9 29ExKwyNsbrJcTFcWiVOySHiiopAv+lXAfOf6An6rweFfbSeTBExwpZSjHu1oySjVVNQ IXUTgofbfH3vKF+Ug+Ak8wJ9VSDsTaosrsf67NKK3VcpzOFsMdioFNkLHc0vGl7NUm8u 9RI24shWAFq/ijEACMFAhOp8DgJSK90H9b3UogD4c3ud0gfJcQ/BRWcyM43ODBEAtyOs sy12R34jMyNpAh5UxApN0MLBTrZtR3MuwJ0eTBcULGgyUF3Es6E+N2SWAD5hq2HdbnnB MkaA== Received: by 10.224.39.78 with SMTP id f14mr5351049qae.54.1345846990851; Fri, 24 Aug 2012 15:23:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.219.142 with HTTP; Fri, 24 Aug 2012 15:22:50 -0700 (PDT) In-Reply-To: References: From: Fred Janon Date: Sat, 25 Aug 2012 00:22:50 +0200 Message-ID: Subject: Re: Issue building the Unix daemon (jsvc) with the "configure" script in Tomcat7 To: Tomcat Users List Content-Type: multipart/alternative; boundary=20cf3074d7dccfcfbd04c80a6bfa X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074d7dccfcfbd04c80a6bfa Content-Type: text/plain; charset=ISO-8859-1 Hi Jeff, I tried both: [ec2-user@ip-10-34-89-185 bin]$ ./daemon.sh start Cannot set group id for user 'tomcat' Error validating user 'tomcat' With sudo, I get the permissions issue. ec2-user is a sudoer. sudo ./daemon.sh start *SEVERE: Unable to create directory for deployment: /datadisk1/tomcat/conf/Catalina/localhost* Aug 24, 2012 1:29:12 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /datadisk1/tomcat/webapps/examples Aug 24, 2012 1:29:12 PM org.apache.catalina.core.StandardContext postWorkDirectory *WARNING: Failed to create work directory [/datadisk1/tomcat/work/Catalina/localhost/examples] for context [/examples] * Aug 24, 2012 1:29:13 PM org.apache.jasper.EmbeddedServletOptions *SEVERE: The scratchDir you specified: /datadisk1/tomcat/work/Catalina/localhost/examples is unusable.* I am trying to see the whole command passed to jsvc but I am not fluent in shell scripts and I can't get to echo it yet. Fred On Fri, Aug 24, 2012 at 10:45 PM, Jeff MAURY wrote: > It probably means your current user (ec2-user) has not the rights to run as > tomcat user. > Try the same command with sudo in front, if ec2-user is part of the sudoers > > Jeff > > > On Fri, Aug 24, 2012 at 4:09 PM, Fred Janon wrote: > > > Ah! Thanks Jeff, you are right, thanks. I checked and the OpenJDK > installed > > is not the full JDK (??? confusing). I had to install the OpenJDK-dev to > > get the full JDK. > > > > I managed to build the jsvc (yeah!), now I am getting an error after > > starting tomcat using daemon.sh, it seems that it runs a root, not tomcat > > as I configured setenv.sh. tomcat cannot create some dirs, reported in > > catalina-daemon.out. > > > > If I launch tomcat without being root, I get this error: > > > > [ec2-user@ip-10-34-89-185 bin]$ ./daemon.sh start > > Cannot set group id for user 'tomcat' > > Error validating user 'tomcat' > > > > Not sure what this means, I have a tomcat user in the tomcat group. > > > > If I launch tomcat using that command: > > > > sudo ./daemon.sh start > > > > with setenv.sh: > > > > export CATALINA_HOME=/datadisk1/tomcat > > export CATALINA_OPTS="-server -Xms128M -Xmx512M" > > export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre > > export TOMCAT_USER=tomcat > > > > then catalina-daemon.out shows: > > > > Aug 24, 2012 1:29:11 PM org.apache.catalina.core.AprLifecycleListener > init > > SEVERE: An incompatible version 1.1.22 of the APR based Apache Tomcat > > Native library is installed, while Tomcat requires version 1.1.24 > > Aug 24, 2012 1:29:11 PM org.apache.catalina.core.AprLifecycleListener > init > > SEVERE: An incompatible version 1.1.22 of the APR based Apache Tomcat > > Native library is installed, while Tomcat requires version 1.1.24 > > Aug 24, 2012 1:29:11 PM org.apache.catalina.core.AprLifecycleListener > init > > SEVERE: An incompatible version 1.1.22 of the APR based Apache Tomcat > > Native library is installed, while Tomcat requires version 1.1.24 > > Aug 24, 2012 1:29:11 PM org.apache.catalina.core.AprLifecycleListener > init > > SEVERE: An incompatible version 1.1.22 of the APR based Apache Tomcat > > Native library is installed, while Tomcat requires version 1.1.24 > > Aug 24, 2012 1:29:11 PM org.apache.catalina.core.AprLifecycleListener > init > > SEVERE: An incompatible version 1.1.22 of the APR based Apache Tomcat > > Native library is installed, while Tomcat requires version 1.1.24 > > Aug 24, 2012 1:29:11 PM org.apache.coyote.AbstractProtocol init > > INFO: Initializing ProtocolHandler ["http-bio-8080"] > > Aug 24, 2012 1:29:11 PM org.apache.coyote.AbstractProtocol init > > INFO: Initializing ProtocolHandler ["ajp-bio-8009"] > > Aug 24, 2012 1:29:11 PM org.apache.catalina.startup.Catalina load > > INFO: Initialization processed in 1316 ms > > Aug 24, 2012 1:29:12 PM org.apache.catalina.core.StandardService > > startInternal > > INFO: Starting service Catalina > > Aug 24, 2012 1:29:12 PM org.apache.catalina.core.StandardEngine > > startInternal > > INFO: Starting Servlet Engine: Apache Tomcat/7.0.29 > > Aug 24, 2012 1:29:12 PM org.apache.catalina.startup.HostConfig start > > *SEVERE: Unable to create directory for deployment: > > /datadisk1/tomcat/conf/Catalina/localhost* > > Aug 24, 2012 1:29:12 PM org.apache.catalina.startup.HostConfig > > deployDirectory > > INFO: Deploying web application directory > > /datadisk1/tomcat/webapps/examples > > Aug 24, 2012 1:29:12 PM org.apache.catalina.core.StandardContext > > postWorkDirectory > > *WARNING: Failed to create work directory > > [/datadisk1/tomcat/work/Catalina/localhost/examples] for context > > [/examples] > > * > > Aug 24, 2012 1:29:13 PM org.apache.jasper.EmbeddedServletOptions > > *SEVERE: The scratchDir you specified: > > /datadisk1/tomcat/work/Catalina/localhost/examples is unusable.* > > Aug 24, 2012 1:29:13 PM org.apache.catalina.startup.HostConfig > > deployDirectory > > INFO: Deploying web application directory /datadisk1/tomcat/webapps/ROOT > > Aug 24, 2012 1:29:13 PM org.apache.catalina.core.StandardContext > > postWorkDirectory > > WARNING: Failed to create work directory > > [/datadisk1/tomcat/work/Catalina/localhost/_] for context [] > > Aug 24, 2012 1:29:13 PM org.apache.jasper.EmbeddedServletOptions > > SEVERE: The scratchDir you specified: > > /datadisk1/tomcat/work/Catalina/localhost/_ is unusable. > > Aug 24, 2012 1:29:13 PM org.apache.catalina.startup.HostConfig > > deployDirectory > > INFO: Deploying web application directory /datadisk1/tomcat/webapps/docs > > Aug 24, 2012 1:29:13 PM org.apache.catalina.core.StandardContext > > postWorkDirectory > > WARNING: Failed to create work directory > > [/datadisk1/tomcat/work/Catalina/localhost/docs] for context [/docs] > > Aug 24, 2012 1:29:13 PM org.apache.jasper.EmbeddedServletOptions > > SEVERE: The scratchDir you specified: > > /datadisk1/tomcat/work/Catalina/localhost/docs is unusable. > > Aug 24, 2012 1:29:13 PM org.apache.catalina.startup.HostConfig > > deployDirectory > > INFO: Deploying web application directory > /datadisk1/tomcat/webapps/manager > > Aug 24, 2012 1:29:13 PM org.apache.catalina.core.StandardContext > > postWorkDirectory > > WARNING: Failed to create work directory > > [/datadisk1/tomcat/work/Catalina/localhost/manager] for context > [/manager] > > Aug 24, 2012 1:29:13 PM org.apache.jasper.EmbeddedServletOptions > > SEVERE: The scratchDir you specified: > > /datadisk1/tomcat/work/Catalina/localhost/manager is unusable. > > Aug 24, 2012 1:29:13 PM org.apache.catalina.startup.HostConfig > > deployDirectory > > INFO: Deploying web application directory > > /datadisk1/tomcat/webapps/host-manager > > Aug 24, 2012 1:29:13 PM org.apache.catalina.core.StandardContext > > postWorkDirectory > > WARNING: Failed to create work directory > > [/datadisk1/tomcat/work/Catalina/localhost/host-manager] for context > > [/host-manager] > > Aug 24, 2012 1:29:13 PM org.apache.jasper.EmbeddedServletOptions > > SEVERE: The scratchDir you specified: > > /datadisk1/tomcat/work/Catalina/localhost/host-manager is unusable. > > Aug 24, 2012 1:29:13 PM org.apache.coyote.AbstractProtocol start > > INFO: Starting ProtocolHandler ["http-bio-8080"] > > Aug 24, 2012 1:29:13 PM org.apache.coyote.AbstractProtocol start > > INFO: Starting ProtocolHandler ["ajp-bio-8009"] > > Aug 24, 2012 1:29:13 PM org.apache.catalina.startup.Catalina start > > INFO: Server startup in 1613 ms > > > > I am not sure my "export TOMCAT_USER=tomcat" is right, or if I am missing > > something. > > > > Regards, > > > > Fred > > > > On Fri, Aug 24, 2012 at 12:01 PM, Jeff MAURY > >wrote: > > > > > Fred, > > > > > > you are getting confused by the term OpenJDK. It comes in two flavor, > JRE > > > and JDK. I have some .h files on my Ubuntu server, but not under > > > /usr/lib/jvm/java-1.6.0-openjdk but under /usr/lib/jvm/java-6-openjdk > > > > > > Regards > > > Jeff > > > > > > > > > On Fri, Aug 24, 2012 at 8:52 AM, Fred Janon wrote: > > > > > > > Hi Jeff, > > > > > > > > Thanks, but I read the instructions and requirements for a C compiler > > an > > > > the JDK. As shown in my original message there is a JDK > > > > > > > > > /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/* > > > > > > > > but no "jni_md.h" in the Open JDK. As I said the "jni_md.h" seems to > be > > > in > > > > the Windows JDK, but not in the Linux one. > > > > > > > > Cheers, > > > > > > > > Fred > > > > > > > > On Fri, Aug 24, 2012 at 7:51 AM, Jeff MAURY > > > > > wrote: > > > > > > > > > You need a JDK to be installed on your machine and it seems you've > > > only a > > > > > JRE > > > > > > > > > > Jeff > > > > > > > > > > > > > > > On Thu, Aug 23, 2012 at 10:12 PM, Fred Janon > > wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > I am trying to build the Unix deamon jsvc in AWS EC2 Linux. I did > > not > > > > > > install Tomcat7 that comes with the AWS Linux, I downloaded > Tomcat7 > > > > from > > > > > > the Apache Tomcat website, I installed it and ran Tomcat7 > > > successfully. > > > > > Now > > > > > > I am trying to build the daemon to run Tomcat7 as a daemon. I get > > an > > > > > error > > > > > > running the "configure" script as indicated in the Tomcat > > > > documentation. > > > > > I > > > > > > did a lot of searching on the web and cannot find a solution to > > this > > > > > issue. > > > > > > I am not fluent in shell scripting, so my understanding of > > > "configure" > > > > is > > > > > > very limited. > > > > > > > > > > > > Do I need to regenerate the "configure" script or do I need to > > modify > > > > the > > > > > > script? > > > > > > > > > > > > The error is: > > > > > > *checking for JDK os include directory... Cannot find jni_md.h in > > > > > > /usr/lib/jvm/jre/* > > > > > > *configure: error: You should retry --with-os-type=SUBDIR* > > > > > > * > > > > > > * > > > > > > It looks like *"jni_md.h"* is part of the Windows JDK, *but it's > > not > > > in > > > > > the > > > > > > Linux OpenJDK on CentOS.* > > > > > > > > > > > > I don't really understand why the message says "*with-os-type*" > > where > > > > it > > > > > > seems to mean JDK? > > > > > > > > > > > > As indicated in the INSTALL.txt below, I am reporting the issue, > > > hoping > > > > > > that someone can give me a solution or a patch for the script... > > > > > > > > > > > > "Depending on your JDK layout, configure might fail to find the > JNI > > > > > > machine dependant include file (jni_md.h). If that's the case use > > the > > > > > > --with-os-type= parameter where subdir points to the > > > directory > > > > > > within JDK include directory containing jni_md.h file. > > > > > > If your operating system is supported, configure will go thru > > > cleanly, > > > > > > otherwise it will report an error (please send us the details of > > your > > > > > > OS/JDK, or a patch against the sources)." > > > > > > > > > > > > Below is the console output running configure and some > information > > > > about > > > > > > the jdk installed. > > > > > > > > > > > > [ec2-user@ip-10-244-162-78 unix]$ *./configure* > > > > > > *** Current host *** > > > > > > checking build system type... i686-pc-linux-gnu > > > > > > checking host system type... i686-pc-linux-gnu > > > > > > checking cached host system type... ok > > > > > > *** C-Language compilation tools *** > > > > > > checking for gcc... gcc > > > > > > checking for C compiler default output file name... a.out > > > > > > checking whether the C compiler works... yes > > > > > > checking whether we are cross compiling... no > > > > > > checking for suffix of executables... > > > > > > checking for suffix of object files... o > > > > > > checking whether we are using the GNU C compiler... yes > > > > > > checking whether gcc accepts -g... yes > > > > > > checking for gcc option to accept ANSI C... none needed > > > > > > checking for ranlib... ranlib > > > > > > checking for strip... strip > > > > > > *** Host support *** > > > > > > checking C flags dependant on host system type... ok > > > > > > *** Java compilation tools *** > > > > > > *checking for JDK os include directory... Cannot find jni_md.h in > > > > > > /usr/lib/jvm/jre/* > > > > > > *configure: error: You should retry --with-os-type=SUBDIR* > > > > > > > > > > > > [ec2-user@ip-10-244-162-78 unix]$ find / -name 'jni_md.h' > > > 2>/dev/null > > > > > > > > > > > > [ec2-user@ip-10-244-162-78 unix]$ find / -name '*jni*' > 2>/dev/null > > > > > > /usr/share/java-jni > > > > > > > > > > > > > > > > > > > > > > > > > > > /datadisk1/tomcat/bin/commons-daemon-1.0.10-native-src/windows/src/javajni.c > > > > > > > > > > > > > > > > > > > > > > > > > > > /datadisk1/tomcat/bin/commons-daemon-1.0.10-native-src/windows/include/javajni.h > > > > > > > > > > > > Installed Packages > > > > > > java-1.6.0-openjdk.i686 > installed > > > > > > > > > > > > ---------------------------------------- > > > > > > [ec2-user@ip-10-244-162-78 unix]$ *./configure > > > > > > -with-java=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre* > > > > > > *** Current host *** > > > > > > checking build system type... i686-pc-linux-gnu > > > > > > checking host system type... i686-pc-linux-gnu > > > > > > checking cached host system type... ok > > > > > > *** C-Language compilation tools *** > > > > > > checking for gcc... gcc > > > > > > checking for C compiler default output file name... a.out > > > > > > checking whether the C compiler works... yes > > > > > > checking whether we are cross compiling... no > > > > > > checking for suffix of executables... > > > > > > checking for suffix of object files... o > > > > > > checking whether we are using the GNU C compiler... yes > > > > > > checking whether gcc accepts -g... yes > > > > > > checking for gcc option to accept ANSI C... none needed > > > > > > checking for ranlib... ranlib > > > > > > checking for strip... strip > > > > > > *** Host support *** > > > > > > checking C flags dependant on host system type... ok > > > > > > *** Java compilation tools *** > > > > > > checking JAVA_HOME... /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre > > > > > > *checking for JDK os include directory... Cannot find jni_md.h in > > > > > > /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/* > > > > > > *configure: error: You should retry --with-os-type=SUBDIR* > > > > > > > > > > > > ----------------------------------------- > > > > > > configure script excerpt: > > > > > > > > > > > > echo "$as_me:$LINENO: checking for JDK os include directory" > > >&5 > > > > > > echo $ECHO_N "checking for JDK os include directory... $ECHO_C" > >&6 > > > > > > JAVA_OS=NONE > > > > > > if test -f $JAVA_HOME/$JAVA_INC/jni_md.h > > > > > > then > > > > > > JAVA_OS="" > > > > > > else > > > > > > for f in $JAVA_HOME/$JAVA_INC/*/jni_md.h > > > > > > do > > > > > > if test -f $f; then > > > > > > JAVA_OS=`dirname $f` > > > > > > JAVA_OS=`basename $JAVA_OS` > > > > > > echo " $JAVA_OS" > > > > > > break > > > > > > fi > > > > > > done > > > > > > if test "x$JAVA_OS" = "xNONE"; then > > > > > > echo "$as_me:$LINENO: result: Cannot find jni_md.h in > > > > > > ${JAVA_HOME}/${OS}" >&5 > > > > > > echo "${ECHO_T}Cannot find jni_md.h in ${JAVA_HOME}/${OS}" >&6 > > > > > > { { echo "$as_me:$LINENO: error: You should retry > > > > > > --with-os-type=SUBDIR" >&5 > > > > > > echo "$as_me: error: You should retry --with-os-type=SUBDIR" > >&2;} > > > > > > { (exit 1); exit 1; }; } > > > > > > fi > > > > > > fi > > > > > > > > > > > > ----------------------------------------- > > > > > > > > > > > > Thanks > > > > > > > > > > > > Fred > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Jeff MAURY > > > > > > > > > > > > > > > "Legacy code" often differs from its suggested alternative by > > actually > > > > > working and scaling. > > > > > - Bjarne Stroustrup > > > > > > > > > > http://www.jeffmaury.com > > > > > http://riadiscuss.jeffmaury.com > > > > > http://www.twitter.com/jeffmaury > > > > > > > > > > > > > > > > > > > > > -- > > > Jeff MAURY > > > > > > > > > "Legacy code" often differs from its suggested alternative by actually > > > working and scaling. > > > - Bjarne Stroustrup > > > > > > http://www.jeffmaury.com > > > http://riadiscuss.jeffmaury.com > > > http://www.twitter.com/jeffmaury > > > > > > > > > -- > Jeff MAURY > > > "Legacy code" often differs from its suggested alternative by actually > working and scaling. > - Bjarne Stroustrup > > http://www.jeffmaury.com > http://riadiscuss.jeffmaury.com > http://www.twitter.com/jeffmaury > --20cf3074d7dccfcfbd04c80a6bfa--