Solved

java tomcat catalina.sh

Posted on 2006-06-21
11
1,304 Views
Last Modified: 2013-11-24
Hi
In my application there are some resource files in /root/resources directory
there is an entry in tomcat,s(On Linux) catalina.sh file which is :
          CATALINA_OPTS="-bhel.resources.dir=/root/resources"

and in one of the java class  this line is written
    String sResourcesDir = System.getProperty("bhel.resources.dir");

i need to know what is this and why we are using this(and what is the need to read this property from catalina.sh normally if we can do this from other way)

if i put these resource files in c:\resources on windows platform
than what entry shuold i put in (cataline.bat/catalina.sh ?) equalant to linux platform so that my application can read
resource files without any problem
thanks
0
Comment
Question by:riteinfotech
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 16952098
Not sure about Windows, but perhaps: CATALINA_OPTS="-bhel.resources.dir=C:/resources"
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16952296
>>CATALINA_OPTS="-bhel.resources.dir=/root/resources"

is a VM argument. Given the way you are accessing it, it should probably be

CATALINA_OPTS="bhel.resources.dir=/root/resources"

A better way to do this would be in your context:

http://tomcat.apache.org/tomcat-4.1-doc/config/defaultcontext.html



0
 
LVL 92

Expert Comment

by:objects
ID: 16956230
The catalina_opts env var is passed on the command line used to startup tomcat
It appears to be beiung used to specify the location of a directory

try

    CATALINA_OPTS="-bhel.resources.dir=/resources"

exactly what to use depends a little on how he value actually gets used
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:riteinfotech
ID: 16960183
what do we mean by this

          System.getProperty("bhel.resources.dir");
 in an application System denotes to what(here System indicates catalina.sh ? )
????????
thanks
0
 
LVL 92

Expert Comment

by:objects
ID: 16964664
System is a Java class

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html

getProperty() is a static member in that class to return the value of a system property

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperty(java.lang.String)

0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16966596
0
 

Author Comment

by:riteinfotech
ID: 16968043
my question is  how system identify(came to know) that "bhel.resources.dir" property is defined in tomcat's catalina.sh file ?????????????
0
 
LVL 92

Expert Comment

by:objects
ID: 16968157
because the value of CATALINA_OPTS is passed as aparameter when tomcat is started

  "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
    -Dcatalina.base="$CATALINA_BASE" \
    -Dcatalina.home="$CATALINA_HOME" \
    -Djava.io.tmpdir="$CATALINA_TMPDIR" \
    org.apache.catalina.startup.Bootstrap "$@" stop
0
 

Author Comment

by:riteinfotech
ID: 16968189
can u pls explain this all in details, plsssssssssssssssssss !
0
 

Author Comment

by:riteinfotech
ID: 16968439
i mean why CATALINA_OPTS is used for?
why tomcat need this?

and this too ------>
                 
            because the value of CATALINA_OPTS is passed as aparameter when tomcat is started

                "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
                -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
                -Dcatalina.base="$CATALINA_BASE" \
                -Dcatalina.home="$CATALINA_HOME" \
                -Djava.io.tmpdir="$CATALINA_TMPDIR" \
                org.apache.catalina.startup.Bootstrap "$@" stop


      Thanks
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 16973592
CATALINA_OPTS is used for passing command line arguments for tomcat.
tomcat does not need it it is there to allow you to pass additional site specific args when starting up toimcat.
Its actually there so you do *not* have to change catalina.sh to pass extra args allowing you to instead specify them in your environment variables.  in your case assign site specific environment variable.

> and this too ------>

thats the command run to start tomcat, note it inclused the value of the CATALINA_OPTS environemnebt variable
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 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