• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

placing jar files in tomcat

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/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
 
Vishnu Murthy
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
....\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).]
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/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.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
Vishnu Murthy
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic