You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Bruno Salgueiro <bs...@sibs.pt> on 2000/03/09 13:30:27 UTC

Problems with JSP with Tomcat 3.1 M1 (again)

Dear all,

  I had the same problem with Tomcat 3.0 and I upgraded to version 3.1M1
expecting it could be something that the first version had wrong but I
don't think so...

  Basically the problem has to do with CLASSPATH regarding JSPs and
beans
used by JSPs. I used the NumberGuess example without modifications and
deployed it in the new context created (/tomcat mapped on a directory
with rx access to user which tomcat is running). The JSP doesn't work
but the Snoop servlet works... I've been wasting too much time tring to
figure it out and I can't really understand what is going on. I really
need this working ASAP.

  Here is the browser output, extract from server.xml where the contexts
are defined and the web.xml. The browser connected directly to the
Tomcat
Web Server, not through Apache (but the results are the same either
way).

Browser

Error: 500
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for
JSPwork/localhost_8080%2Ftomcat/_0002fhtml_0002fnumguess_0002ejspnumguess_jsp_0.java:15:
Class num.NumberGuessBean not found in import.
import num.NumberGuessBean;
       ^
1 error

        at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:213)
        at
org.apache.jasper.runtime.JspLoader.loadJSP(JspLoader.java:226)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:137)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:148)
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:255)
        at
org.apache.jasper.runtime.JspServlet.service(JspServlet.java:360)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
        at
org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java:403)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:224)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:347)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
        at
org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:305)
        at java.lang.Thread.run(Thread.java)


server.xml

        <Context path="/" docBase="/home/httpd/site"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

        <Context path="/tomcat" docBase="/home/httpd/site"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

        <Context path="/examples"
docBase="/usr/local/opt/tomcat/examples"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet>
        <servlet-name>snoop</servlet-name>
        <servlet-class>SnoopServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>snoop</servlet-name>
        <url-pattern>/snoop</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
       <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>


Thank you for your attention.
-- 
=======================================================
Bruno Salgueiro       (mailto:bs@sibs.pt)
                   
SIBS - Sociedade Interbancária de Serviços
Rua Soeiro Pereira Gomes, Lote 1, 1600 Lisboa, Portugal

Tel: + 351 21 791 88 33
Fax: + 351 21 793 50 80
http://www.sibs.pt

Esta mensagem foi assinada com certificado MULTIcert.
Para obter o certificado da Autoridade de Certificação
PILOTO MULTIcert dirija-se ao site
            http://www.sibs.multicert.com

"Computers are useless. They can only give you answers."
                                        --Pablo Picasso
=======================================================