This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Running 3rd party API as servlets in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Running 3rd party API as servlets in Tomcat" Watch "Running 3rd party API as servlets in Tomcat" New topic
Author

Running 3rd party API as servlets in Tomcat

vkm raja
Greenhorn

Joined: Oct 05, 2006
Posts: 1
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

Put the srbJavaAPI.jar into the lib directory of your web application.
(myapp/WEB-INF/lib)


[My Blog]
All roads lead to JavaRanch
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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.


Rahul Bhattacharjee
LinkedIn - Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running 3rd party API as servlets in Tomcat