[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

java tomcat catalina.sh

Posted on 2006-06-21
11
Medium Priority
?
1,340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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!

 

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 1000 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

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!

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

656 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