The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tomcat 4 JSP OK Having Servlet WEB-INF issues

Discussion in 'General Discussion' started by BobFarkle, Jan 16, 2003.

  1. BobFarkle

    BobFarkle Member

    Joined:
    Nov 19, 2002
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    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.
    ajo@dpzone.com
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    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.
     
  3. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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
     
  4. BobFarkle

    BobFarkle Member

    Joined:
    Nov 19, 2002
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    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 webmaster@myspu.net
    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
     
  5. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    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.
     
Loading...

Share This Page