tomcat安装配置问题

tomcat安装配置问题

freebsd7 ports安装的tomcat55,jdk是安装tomcat的时候依赖安装的

jdk的环境变量设置如下

/etc/csh.cshrc
setenv JAVA_HOME /usr/local/diablo-jdk1.6.0
setenv CLASSPATH $JAVA_HOME/lib
setenv CATALINA_HOME /usr/local/Tomcat5.5


测试页面代码


<%@ page contentType="text/html;charset=gb2312" %>
<HTML>
<HEAD>
<TITLE>JSP测试页面</TITLE>
</HEAD>
<BODY>
<%out.println("<h1>Hello World! </h1>";%>
</BODY>
</HTML>



错误提示有2个

1

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: Unable to load class for JSP
        org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:599)
        org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
        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)


root cause
java.lang.ClassNotFoundException: org.apache.jsp.test_jsp
        java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        java.security.AccessController.doPrivileged(Native Method)
        java.net.URLClassLoader.findClass(URLClassLoader.java:18
        org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:131)
        org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
        org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:597)
        org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
        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.26 logs.



2


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: Unable to compile class for JSP
        org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:573)
        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)


root cause
java.io.FileNotFoundException: /usr/local/tomcat5.5/work/Catalina/localhost/_/org/apache/jsp/test_jsp.java (No such file or directory)
        java.io.FileOutputStream.open(Native Method)
        java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        java.io.FileOutputStream.<init>(FileOutputStream.java:70)
        org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:141)
        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.26 logs.
问题已经解决,果然是jre的版本的缘故,我将tomcat换成4.1的就完成正常了,谢谢各位的帮助!!
真够怪了,新版本的jdk要配合旧版本的tomcat才能工作?
有进展,如果用/usr/local/etc/rc.d/tomcat55 start启动就出现上面的错误
/usr/local/tomcat5.5/bin/startup.sh启动好像就正常,

这2种启动方式有什么不同的地方?

tomat现在的版本tomat5.5或tomcat6.0的比较多, 它需要至少jdk1.5的才能正常运行。
   因为tomcat运行要jdk的(jre也可以)。 tomcat4.*的jdk1.4肯定可以支持的。 这就是你换成tomcat4可以的原因。 因为redhat enterprise 4 up4 上的是jdk1.4 , 所以为了安全期间,最好安装jdk1.5的版本。