Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

error when changing the tomcat directory

Posted on 2006-05-30
12
Medium Priority
?
883 Views
Last Modified: 2010-07-27
hi, i know it's funny to change the direcotry of tomcat when it's working fine. But i really need to do this. Plase help.

Originally the tomcat directory was installed/setup in:
/usr/local/jakarta-tomcat5.0

and i have moved all the folder to this directory:
/Project/Tomcat/

i have also change all the docBase in the server.xml to point to the /Project/Tomcat folder accordingly for all my application.

But when i type this in this location

/Project/Tomcat/bin>./startup.sh  

it's shown me this error:
Cannot find /Project/Tomcat/bin/setclasspath.sh
This file is needed to run this program

i checked, inside /Project/Tomcat/bin, there is setclasspath.sh file. this is it:
# -----------------------------------------------------------------------------
#  Set CLASSPATH and Java options
#
#  $Id: setclasspath.sh,v 1.7.2.3 2004/11/17 20:06:34 yoavs Exp $
# -----------------------------------------------------------------------------

# Make sure prerequisite environment variables are set
if [ -z "$JAVA_HOME" ]; then
  echo "The JAVA_HOME environment variable is not defined"
  echo "This environment variable is needed to run this program"
  exit 1
fi
if [ "$os400" = "true" ]; then
  if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
    echo "The JAVA_HOME environment variable is not defined correctly"
    echo "This environment variable is needed to run this program"
    echo "NB: JAVA_HOME should point to a JDK not a JRE"
    exit 1
  fi
else
  if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
    echo "The JAVA_HOME environment variable is not defined correctly"
    echo "This environment variable is needed to run this program"
    echo "NB: JAVA_HOME should point to a JDK not a JRE"
    exit 1
  fi
fi
if [ -z "$BASEDIR" ]; then
  echo "The BASEDIR environment variable is not defined"
  echo "This environment variable is needed to run this program"
  exit 1
fi
#echo "$BASEDIR"/bin/setclasspath.sh;
if [ ! -x "$BASEDIR"/bin/setclasspath.sh ]; then
  if $os400; then
    # -x will Only work on the os400 if the files are:
    # 1. owned by the user
    # 2. owned by the PRIMARY group of the user
    # this will not work if the user belongs in secondary groups
    eval
  else
    echo "The BASEDIR environment variable is not defined correctly"
    echo "This environment variable is needed to run this program"
    exit 1
  fi
fi

# Set the default -Djava.endorsed.dirs argument
JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed

# Set standard CLASSPATH
CLASSPATH="$JAVA_HOME"/lib/tools.jar

# OSX hack to CLASSPATH
JIKESPATH=
if [ `uname -s` = "Darwin" ]; then
  OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
  if [ -d "$OSXHACK" ]; then
    for i in "$OSXHACK"/*.jar; do
      JIKESPATH="$JIKESPATH":"$i"
    done
  fi
fi

# Set standard commands for invoking Java.
_RUNJAVA="$JAVA_HOME"/bin/java
if [ "$os400" != "true" ]; then
  _RUNJDB="$JAVA_HOME"/bin/jdb
fi
_RUNJAVAC="$JAVA_HOME"/bin/javac


and this is the startup.sh

#!/bin/sh
# -----------------------------------------------------------------------------
# Start Script for the CATALINA Server
#
# $Id: startup.sh,v 1.3.2.1 2004/11/17 20:06:34 yoavs Exp $
# -----------------------------------------------------------------------------

# Detect OS400: see Bugzilla 31132
os400=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
esac
 


# resolve links - $0 may be a softlink
PRG="$0"

while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done
 
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh

# Check that target executable exists
if $os400; then
  # -x will Only work on the os400 if the files are:
  # 1. owned by the user
  # 2. owned by the PRIMARY group of the user
  # this will not work if the user belongs in secondary groups
  eval
else
  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
    echo "Cannot find $PRGDIR/$EXECUTABLE"
    echo "This file is needed to run this program"
    exit 1
  fi
fi

exec "$PRGDIR"/"$EXECUTABLE" start "$@"


Can tell me what should i do to make it working?
0
Comment
Question by:xman19
  • 6
  • 4
11 Comments
 
LVL 16

Expert Comment

by:suprapto45
ID: 16796053
Just curious,

Have you changed any environment variable to the correct path?

David
0
 

Author Comment

by:xman19
ID: 16796146
yes, all the JAVA_HOME, CATALINA_HOME were change accordingly.

Is there anything else that i should change? What is the environment variable you are referring? please suggest me some example.

tq
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16796170
Hi,

You have mentioned all the required environment variable. I am pretty confused too :(

David
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:suprapto45
ID: 16796184
Okay,

Just give a try if you think that it is worth it.

Create another folder called "Project2" and try to install the *fresh* Tomcat using setup in that folder and without configuring anything, try to see whether can be started up

David
0
 

Author Comment

by:xman19
ID: 16796225
as per my understanding, these are the enviroment that i have changed. Means i have set the JAVA_HOME to point to my original jdk folder. My catalina home i have chnage to point to /Project/Tomcat folder.

You are asking "Have you changed any environment variable to the correct path?" thus, i answer "Yes".

And i've asked back, is there any other "environment variable" that you thikn i shall change as well if i am changing the entire tomcat directory to a new one?


0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16796627
>>"And i've asked back, is there any other "environment variable" that you thikn i shall change as well if i am changing the entire tomcat directory to a new one?"
Not as far as I know.

David
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16796636
I think that I have answered this in the previous message that I posted
>>"You have mentioned all the required environment variable"

but you may misunderstand it. That could be my fault. English is not my native language.

David
0
 

Author Comment

by:xman19
ID: 16796806
its ok David. No problems.

FYI, the tomcat installation in FreeBSD is issues by /usr/ports whereby i am installing as per ftp version, meaning to say, i need to go to /usr/ports/www/javakarta-tomcat5 and issues a command to install directory into my default location.

Then after that, i am cp -r * to my /Project/Tomcat direcorty...

0
 

Author Comment

by:xman19
ID: 16797511
guys, i have sovled this my own.

in FreeBSD, we are using the "make all install" command in the /usr/ports/www/jakarta-tomcat5.0 command. Thus, i have modified the command and install the Tomcat directly into my custom directory. It's working fine.

thanks
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 16804963
Hi GranMod,

I am the only person who responded. Please refund the points

David
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 16849010
Question closed - 50 points refunded.

Best regards,
RomMod
Experts Exchange
Community Support Moderator
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How does storytelling impact the web? What goes into a great story on the web? And how can it be used for marketing purposes? All of these questions will be answered.
Herein one will find an aggregate of some of my experience building and deploying virtualization stacks both in standalone, clustered Hyper-V, clustered Hyper-V with a Scale-Out File Server (SOFS) backend, and Storage Spaces Direct (S2D).
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question