File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes placing jar files in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "placing jar files in tomcat" Watch "placing jar files in tomcat" New topic
Author

placing jar files in tomcat

Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
Hi
i am working on tomcat webserver and there a problem in placing .jar i have calander.jar i would like to access it in my servlet when i placed my .jar file in tomcat\webapps\examples\web-inf\classes\ directory but it is not working(not able to access) can u please guide. as where to place a .jar file in tomcat webserver to access it from my servlet
thanking u
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
/WEB-INF/classes is the location you place un-jar'ed class files.
/WEB-INF/lib is the location you place your jar files. Tomcat will include any .jar file it finds in this directory in the classpath so...

------------------
Hope This Helps
Carl Trusiak, SCJP2


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
i have placed my Calander.jar file in tomcat\lib directory
still i am not able to access the class file in it.
i have written as
<applet archive="Calender.jar" name="calender" class="Cal.class" height= 200 width=300>
i am not able to execute the applet file in the jar.
please help me.
thanking u
DAYANAND BURAMSHETTY
Ranch Hand

Joined: Aug 06, 2001
Posts: 34
....\wlserver6.0sp1\config\mydomain\applications
All jar files keep in this directory.Using this function
U can get the EJBHome.Write another function or add adtional
information in this function for getting remoteObject.

public EJBHome getEJBHome(String jndiName, String ejbClass)
throws javax.naming.NamingException, ClassNotFoundException {

InitialContext initial = (InitialContext)com.modusmedia.seagatewcms.util.AppSvrContext.getEJBInitialContext();
// get enterprise bean
Object objref = initial.lookup(jndiName);
return (EJBHome) PortableRemoteObject.narrow(objref,
Class.forName(ejbClass));
}
[This message has been edited by DAYANAND BURAMSHETTY (edited August 10, 2001).]
[This message has been edited by DAYANAND BURAMSHETTY (edited August 10, 2001).]


Dil se....,<BR>Dayanand<BR>0065-8839071(off)<BR>0065-7547034(Res0
Samith Nambiar
Ranch Hand

Joined: Mar 14, 2001
Posts: 147
hi vishnu
create a LIB folder directly under your context folder and place the jar file in this folder
Samith.P.Nambiar
Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
Hi Samith
i tryed with the way the u have said but still i am not able to access my applet.
help out na
vishnu
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
/WEB-INF/lib is where you place jar files that the server needs to access. An applet isn't run by the server, it's run by the client. The easiest way to allow the client access to your applet is to place it in your application directory with the html page the applet is on.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16055
    
  21

Technically, /WEB-INF isn't your starting point (unless you're in the habit of deploying j2ee apps to the root of your file system!). More correctly, something like:
/var/tomcat/webapps/examples/WEB-INF/lib/
is the place you want.
Or, to be more specific, say web.xml contains this context:

And I'd put my jars in /home/httpd/listopt/WEB-INF/lib !


Customer surveys are for companies who didn't pay proper attention to begin with.
Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
hi
i have placed my jar file at tomcat/webapps/mydirectory where i have my html file also, and i set the classpath to this jar file but when i try to access the applet in this jar file it is executing only on the server machine where i have webserver but, when i try to access the same page from the some other machine other than server i am not able to execute the Calendar applet present in my jar file.
please help me
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Well, something we need to consider here is that this
is an Applet unlike any other J2EE applications.
Since anything under the WEB-INF is private,
I am not sure that is the right place to put the jar file
of an Applet. I am not 100 % sure of this, I should try
something before I speak more. I know that the Applet
jars should be downloadable to the client side and so
placing the jars in WEB-INF maynot be appropriate.
My choice would be to put the jar files in webapps/examples, if thats what the servlet-context is called (unless
proven otherwise). As I said I haven't experimented with this
take this advice with a grain of salt. And btw, if you place
the jars in webapps/examples be sure to change the
codebase=".".
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: placing jar files in tomcat