Results 1 to 6 of 6

Thread: Tomcat cannot run JSP

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Default Tomcat cannot run JSP

    I have installed Tomcat via the easyapache utility in the WHM. The Tomcat got installed okay. Following are the versions:
    apache-tomcat-5.5.25
    jdk1.6.0_02

    I have enabled Servlet support for an Account. JSPs are working fine under the public_html folder. However, the moment I place the SAME JSP inside any folder (in the public_html folder) I get the following error:

    org.apache.jasper.JasperException: /test2.jsp(2,0) The value for the useBean class attribute validation.FieldValidations is invalid.
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1175)
    org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1117)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2222)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
    org.apache.jasper.compiler.Generator.generate(Generator.java:3322)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.

    The Test.jsp which I'm tying to run is:
    <%@page language = "java" import="java.io.*,java.util.*,java.sql.*,java.net.InetAddress,javax.servlet.http.Cookie" %>
    <jsp:useBean id = "validate" scope="page" class="validation.FieldValidations" />
    <jsp:useBean id="ConnectionBean" scope="session" class="poolcon.ConnectionPool" />
    <jsp:useBean id="orderidbean" scope="page" class="RngPack.RandomApp" />
    <%
    validate.setValueForAlfaNumeric("DUMMY_123'");
    String s_name=validate.getValueForSchar();

    out.println("AAAAAAA"+s_name);
    %>
    <html>
    Hello test
    </html>

    Now, I know that the Bean is NOT accessible to my JSP within any folder. And yes the package "validation" is present under /account/public_html/WEB-INF/classses. I further confirmed this with the help of the following code:

    <html>
    <head><title>Loading a class</title></head>
    <body>
    <%

    String myClass = "validation.FieldValidations" ;
    try{
    Class.forName( myClass );
    out.println("Class " + myClass + " found on the classpath") ;
    }catch(ClassNotFoundException e) {
    out.println("<font color=\"red\">Class " + myClass + " not found on the classpath</font>") ;
    }
    %>
    </body>
    </html>

    If I run this JSP inside any folder within the public_html it shows that the relevant class is not present in the CLASSPATH. If I run this JSP in public_html of the account, then the Class is found. I'm running the exactly the same versions of Tomcat and JDK on the development machine and everything works fine.

    I shall be really grateful if someone could help me with this. Is this because I have installed Tomcat via easyapache?????

  2. #2
    Registered User
    Join Date
    Mar 2008
    Posts
    1

    Default The value for the useBean class attribute is invalid

    Even I'm having the same problem for JSPs not in root folder using beans.

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    2

    Default

    We have the SAME problem since the last apache/tomcat update and everything works fine inside the public_html ONLY; the same file in any other folder generates error when the jsp call a class.

    Please help us.

    Oscar C.

  4. #4
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Default EasyApache Tomcat Installation

    I have done some more research. The "easyapache" Tomcat installation is taking the
    /home/user/public_html folder as "webapps" rather than an individual context. As a result for every folder which one tries to create within the public_html folder, a separate WEB-INF folder needs to be put in the folder. In production environment this is simply not acceptable.

    I will try and troubleshoot this and let you know if something can be juggled. I have also realized that Tomcat installation should be done ground up on a lin box. Do not rely on third party installations. Its messy and creates more problems.

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    4

    Default

    I had similar problems, and after googling, I found www.ngasi.com. And their
    NGASI AppServer Manager works wonderfully. Although it is a 3rd party installation, that is not an issue. The fact is they do not alter the Tomcat packages. They use the same packages
    that you would get directly from tomcat.apache.org.

    My 2 cents.

  6. #6
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Default Tomcat Configuration

    Its not that the cPanel guys have tinkered with Tomcat itself. The Tomcat which the Easy Apache installs is original thing. Be very sure of this. However, it is the way they configure the Tomcat with Apache is the problem.

    This is how they do it (I may be wrong!):
    Under the httpd.conf
    1. Load mod_jk module (mod_jk.so). This is the Tomcat connector.
    2. Include the jk.conf. This is neat as these directives can be put directly into the httpd.conf, but would clutter it!
    3. Create workers.properties file.
    4. Create a separate context tag <context> ...... </context> for every account in the Tomcat's server.xml file.

    All this is standard stuff. Perfectly okay. I really do not know what else they have done to the configuration to warrant such Tomcat behavior! I'm trying to replicate the same our Local Server. Will keep you posted.

Similar Threads

  1. help jsp not run on another path except /
    By bugton in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 09-24-2011, 08:18 AM
  2. Help me??? i cannot run .jsp file.
    By matrixvn in forum cPanel & WHM Discussions
    Replies: 5
    Last Post: 09-30-2004, 11:04 PM
  3. About JSP (Tomcat)
    By Domenico in forum cPanel & WHM Discussions
    Replies: 17
    Last Post: 08-07-2004, 10:24 PM
  4. Tomcat JSP
    By casey in forum cPanel & WHM Discussions
    Replies: 18
    Last Post: 04-14-2003, 03:57 AM