File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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

Running 3rd party API as servlets in Tomcat

vkm raja

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

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
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Put the srbJavaAPI.jar into the lib directory of your web application.

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

Joined: Nov 29, 2005
Posts: 2308
You can look into cataline.bat or 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:
subject: Running 3rd party API as servlets in Tomcat
It's not a secret anymore!