Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running 3rd party API as servlets in Tomcat

 
vkm raja
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I am new to web programming. I need a help in executing a servlet using tomcat in "LINUX". I am using a 3rd party API called Srb JAVA API to connect to an DATA GRID Software. To Compile my Java program that uses this API i added srbJavaAPI.jar to the class path. For runnig my Java program i was asked to set the following in the Environment variable(.bashrc)
*****************************
SRB_HOME="<set SRB home directory>"

SRB_CLASSPATH= "<you local directory where new classes are compiled>"
SRB_CLASSPATH= "${SRB_CLASSPATH }:${SRB_HOME} /lib"
SRB_CLASSPATH= "${SRB_CLASSPATH }:${SRB_HOME} /lib/srbJavaAPI. jar"
****************************

and then while excuting the program using JAVA command i was asked to add two arguments like to below

*********************************

java -classpath "${SRB_CLASSPATH} " -Dsrb.home.path= "${SRB_HOME} "
<compiledJavaClassN ame> <compiledJavaClassA rguments>
**********************************

I did and i was able to connect to the Data Grid Software. But i developed a servlet version of my Java program to run inside tomcat it did not work . Where should i set the Environment Variable and how Tomcat will use the extra arguments to run my servlet. Kindly help.
Thanks and Regards
V.K.M.RAJA
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the srbJavaAPI.jar into the lib directory of your web application.
(myapp/WEB-INF/lib)
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can look into cataline.bat or catalina.sh in case of linux for setting env varialbes.Look in that file for OPTS_ARGUMENTS , or something similar for setting some extra env variables.

If you have any jar specific to your own web application then put that in the lib folder of WEB-INF.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic