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 jsp issue

Discussion in 'General Discussion' started by Menta2K, Jan 7, 2008.

  1. Menta2K

    Menta2K Member

    Joined:
    Apr 11, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    First i wont to say that i am not a tomcat expert and maybe i am doing something wrong. Here is the case :

    I have a class located in
    /home/user/public_html/WEB-INF/classes/testlib/MyString.class

    I have a jsp page located in document root directory (/home/user/public_html/)
    with that content
    <%@ page language="java" import="testlib.*"%>
    <%
    out.print("User1"+MyString.doString("Test String"));
    %>
    and its working like a charm

    I have same file in directory /home/user/public_html/t1/ with the same content.

    but i got that error
    Java FileName:/usr/local/jakarta/apache-tomcat-5.5.25/work/Catalina/domain.com/t1//org/apache/jsp/test2_jsp.java

    An error occurred at line: 3 in the jsp file: /test2.jsp
    MyString cannot be resolved
    1: <%@ page language="java" import="testlib.*"%>
    2: <%
    3: out.print("User1"+MyString.doString("Test String"));
    4: %>
    Looks like if the jsp is located outside of the document root import tag did not work properly.

    Any one with same issue ? or any ideas what can be wrong ?
     
  2. appservermgr

    appservermgr Member

    Joined:
    Feb 16, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Are both JSPs being called in the same context. Provide the URL for each.
     
  3. Menta2K

    Menta2K Member

    Joined:
    Apr 11, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
  4. appservermgr

    appservermgr Member

    Joined:
    Feb 16, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    OK. So the domains in the URL are the same.
    Is there a WEB-INF directory under ./t1
     
  5. Menta2K

    Menta2K Member

    Joined:
    Apr 11, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    No i have web inf only under main document root
    /home/user/public_html/WEB-INF/
    should i have WEB-INF in t1 subdirectory ?
    if i should should y make a copy of all my classes inside /home/user/public_html/WEB-INF/ to
    /home/user/public_html/t1/WEB-INF/

    Because i dont know how tomcat works internally maybe i ask very stupid questions...

    I really appreciate your help appservermgr
     
  6. appservermgr

    appservermgr Member

    Joined:
    Feb 16, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Hi Menta2k,

    Do not add a WEB-INF under t1. There should only be 1 WEB-INF per application
    context.

    Try restarting Tomcat and see if the error goes away.
     
  7. Menta2K

    Menta2K Member

    Joined:
    Apr 11, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
  8. appservermgr

    appservermgr Member

    Joined:
    Feb 16, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Quite possible as most 3rd party packages of Tomcat are susceptible to
    problems. I personally recommend using unaltered Tomcat versions directly from the Apache site.
    I presume the Tomcat installation is from cPanel?
    That said did you add any thing to the CLASSPATH or made any changes?
    Also is there a Context in the server.xml with the name "t1".

    Try testing the jsp under a different name (e.g. test2.jsp) under t1 and see what happens.
     
  9. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    It seems there is a bug somewhere or may be some misconfiguration, this is what I am getting:

    whereas the index.jsp is working fine at http://www.sakariya.com

    The developer says, it is not compiling JSP pages.

    Any idea where it is going wrong?
     
Loading...

Share This Page