tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Schacht" <kscha...@uiuc.edu>
Subject Using JAR files
Date Tue, 05 Dec 2000 04:38:53 GMT
I have a servlet that references a bunch of classes that are all packaged
nicely in a JAR file.  I put this JAR file into the
/webappname/WEB-INF/servlet directory but I get:

500 .NoClassDefFoundError: org/worthy/utilities/worthyConst

(the org/worthy/utitilities/worthyConst structure is all within the JAR
file).  I realize I could probably just recreate the directory structure
from within the WEB-INF/servlet directory and put each of the class files in
its respective location but I would really rather use the JAR file.

I tried adding this directory /webappname/WEB-INF/servlet to classpath and
restarting (even though it was recently mentioned you should not do it), but
that didn't work.  I tried just copying the JAR file straight to
/tomcat/lib/ and this time when I restarted I did indeed see it listed in
the classpath startup message.. but still go the same 500 error.

Any ideas?


Keith Schacht
http://www.pididdle.com

----- Original Message -----
From: "Bill Long" <bill@longboys.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Monday, December 04, 2000 4:08 PM
Subject: Re: Tomcat - mod_jk - Configuration : Need some help please


> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> you are correct.
>
> now..*sigh* i looked at the build.xml , wrapper.properties,
> tomcat.properties, server.xml and a bunch of other files.  I saw lots of
> places to set the classpath, but none of them worked.
>
> I can set the classpath in an environment variable, but do you know where
to
> set the classpath for the tomcat server, or can you explicitly set the
> classpath in the configuration files? common sense would indicate you can,
> but I cant find any info on it.  meanwhile, i'll head back to the docs for
> installing tomcat.
>
> thanks for you help, i think i'm almost there.
>
> ----- Original Message -----
> From: "Mike La Budde" <mike.labudde@irista.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Monday, December 04, 2000 1:29 PM
> Subject: Re: Tomcat - mod_jk - Configuration : Need some help please
>
>
> > *This message was transferred with a trial version of CommuniGate(tm)
Pro*
> > After starting tomcat look at the output in your console window to
verify
> > the classpath. I'll bet you won't see
> >
> > <path-to-jdk>/lib/tools.jar
> >
> > (and it must be there to work)....
> >
> > HTH,
> >
> > Mike
> >
> > At 12/04/2000 01:02 PM -0800, you wrote:
> > >*This message was transferred with a trial version of CommuniGate(tm)
> Pro*
> > >Hi folks,
> > >
> > >Okay, I'm kind of new to this java stuff, so please bear with me. I
think
> > >I have it almost done but have reached a stumbling block which I cannot
> > >resolve by searching through the archives.  I'm sure its a simple one,
> but
> > >It's got me stumped.
> > >
> > >FOR---
> > >Solaris 2.6
> > >Apache 1.3.12
> > >Tomcat 3.2
> > >mod_jk
> > >JDK 1.3
> > >
> > >I have my apache set up to use virtual hosts.
> > >I have the tomcat set up pretty much stock, with the exception that I
> > >added ajp13(i'm not using it in my apache configuration though) and I
> > >commented out the /examples, /admin, etc. now all i have in my
server.xml
> > >file for context is
> > >
> > >         <Context path="/java"
> > >                  docBase ="/export/home/cci/public_html/java"
> > >                  croseContext="true"
> > >                  debug="0"
> > >                  reloadable="true">
> > >         </Context>
> > >
> > >then in my httpd.conf file i have
> > ><VirtualHost 111.111.111.111>
> > >         ServerAdmin root@mydomain.com
> > >         DocumentRoot /export/home/cci/public_html
> > >         ServerName my.domain.com
> > >         DirectoryIndex index.cgi index.pl index.html index.shtml
> > >         <Directory /export/home/cci/public_html>
> > >           Options All
> > >         </Directory>
> > >
> > >         <Directory /export/home/cci/public_html/cgi-bin>
> > >           Options All
> > >         </Directory>
> > >     AddHandler cgi-script .cgi
> > >     AddHandler cgi-script .pl
> > >         ErrorLog /export/home/cci/public_html/logs/error_log
> > >         TransferLog /export/home/cci/public_html/logs/access_log
> > >
> > >    <Directory "/export/home/cci/public_html/java">
> > >      Options Indexes FollowSymLinks
> > >    </Directory>
> > >
> > >   #
> > >   # The following line mounts all JSP files and the /servlet/ uri to
> tomcat
> > >   #
> > >   JkMount /java/servlet/* ajp12
> > >   JkMount /java/*.jsp ajp12
> > >   #
> > >   # The following line prohibits users from directly accessing WEB-INF
> > >   #
> > >   <Location "/java/WEB-INF/">
> > >       AllowOverride None
> > >       deny from all
> > >   </Location>
> > >
> > >   #
> > >   # The following line prohibits users from directly accessing
META-INF
> > >   #
> > >   <Location "/java/META-INF/">
> > >       AllowOverride None
> > >       deny from all
> > >   </Location>
> > >
> > ></VirtualHost>
> > >
> > >
> > >If I http to my virtualhost:8080 the stock tomcat screen comes up.
> > >If I http to my virtualhost:8080/java then I get the directory index of
> > >the /export/home/cci/public_html/java(as I would expect).
> > >
> > >I have created a quick jsp to test my setup which just does the basic
> html
> > >tags and then does a
> > ><% out.println("test") %>
> > >
> > >if I go to http://my.domain.com/java i get the same directory listing
as
> I
> > >would expect.
> > >
> > >the problem is that when i click on test.jsp, i get the following
> > >output.(for either the servername:8080/java or the virtual host).
> > >
> > >Error: 500
> > >
> > >Location: /java/test.jsp
> > >
> > >Internal Servlet Error:
> > >
> > >javax.servlet.ServletException: sun/tools/javac/Main
> > >         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
> > >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > >
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > >         at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >         at
> > > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > >         at
> > >
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7)
> > >         at
> > > org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > >         at
> > >
>
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Ajp12ConnectionHandler.java:166)
> > >         at
> > >
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > >         at
> > >
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > >         at java.lang.Thread.run(Thread.java:484)
> > >
> > >Root cause:
> > >
> > >java.lang.NoClassDefFoundError: sun/tools/javac/Main
> > >         at
> > >
>
org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128)
> > >         at
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:245)
> > >         at
> > > org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
> > >         at
> > >
> org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
> > >         at
> org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
> > >         at
> > >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
> rvlet.java:152)
> > >         at
> > >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:164)
> > >         at
> > >
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> > >         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> > >         at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >         at
> > >
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > >         at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >         at
> > > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > >         at
> > >
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7)
> > >         at
> > > org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > >         at
> > >
>
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Ajp12ConnectionHandler.java:166)
> > >         at
> > >
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > >         at
> > >
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > >         at java.lang.Thread.run(Thread.java:484)
> > >
> > >I checked my workers.properties and it appears to be all okay.  the
> > >tomcat_home and java_home are set correct.  I can run other java
> > >applications okay.
> > >
> > >can anybody help me with this? I'm totally stumped and don't know where
> to
> > >look. I can't find that much documentation on setting up mod_jk with
> > >virtual hosts. I checked out the tomcat_apache howto and the
minimalistic
> > >approact to setting up tomcat and all
> > >the other docs that come with it.  I'm sure its just something simple i
> > >have missed somewhere.
> > >
> > >any help would be most appreciated.
> > >
> > >bill
> >
> >
>


Mime
View raw message