Tomcat 4 JSP OK Having Servlet WEB-INF issues

BobFarkle

Member
Nov 19, 2002
14
0
151
I installed jsp-install-4.x.tar.gz from layer1.cpanel.net, installed it, configured stuff a bit, activated an account in WHM, and .JSP files work great inside the www directory, however I created a WEB-INF dir and lib / classes dir under the www dir but my JAR files are not being found. I also put a standard unpackaged class in the classes directory with no luck. Tomcat is getting invoked by the /servlet call but /servlet/classname is not working. I am familiar with java programming and resin by caucho... but his is my first experience with Tomcat outside of a dev environment and I am having trouble.

Any ideas on how to troubleshoot this / where to look would be great. Thanks.

-A.J.
[email protected]
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
A.J. - Jar files are a funny thing, they need to be set in the classpath. Unfortunatly this also requires a Tomcat restart. You need to put the jar files in a directory like $JAVA_HOME/lib/ext

Hope that helps a little.
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
[quote:fc9720eb74][i:fc9720eb74]Originally posted by dgbaker[/i:fc9720eb74]

A.J. - Jar files are a funny thing, they need to be set in the classpath. Unfortunatly this also requires a Tomcat restart. You need to put the jar files in a directory like $JAVA_HOME/lib/ext

Hope that helps a little.[/quote:fc9720eb74]

Incorrect. You simply need to add your jars to your /WEB-INF/lib directory. Tomcat will automatically add them to the classpath. In addition, you can put any jar into the $JDK_HOME/jre/lib/ext and it will get loaded without needing to put it into the classpath. This was added into JDK/JRE 1.4.

Bob, PM me the &IfModule mod_jk.c& section for the domain in your httpd.conf, as well as the &Host& entry for the domain in your server.xml file.

Jaz
 

BobFarkle

Member
Nov 19, 2002
14
0
151
My java version is:
java version &1.4.0&
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)



Here it the extract from the httpd.conf file: I understand that &ajp13& is saying.. use tomcat. But where is ajp13 defined? Are there other options for tomcat?



ServerAlias www.myspu.net myspu.net
ServerAdmin [email protected]
DocumentRoot /home/myspune/public_html
BytesLog domlogs/myspu.net-bytes_log
User myspune
Group myspune
ServerName www.myspu.net
CustomLog domlogs/myspu.net combined
ScriptAlias /cgi-bin/ /home/myspune/public_html/cgi-bin/


JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
In the web.xml for the Tomcat install check that the following are not rem'd out

&servlet&
&servlet-name&invoker&/servlet-name&
&servlet-class&org.apache.catalina.servlets.InvokerServlet&/servlet-class&
&init-param&
&param-name&debug&/param-name&
&param-value&0&/param-value&
&/init-param&
&load-on-startup&2&/load-on-startup&
&/servlet&


&!-- The mapping for the invoker servlet --&
&servlet-mapping&
&servlet-name&invoker&/servlet-name&
&url-pattern&/servlet/*&/url-pattern&
&/servlet-mapping&


Tomcat by default only sets up /servlet/ and it may be rem'd out.