tomcat 在LINUX上配置。自己的WEBAPP运行不了!!

tomcat 在LINUX上配置。自己的WEBAPP运行不了!!

好像是环境变量没设好。。
用ROOT启动TOMCAT,访问自己的站点时,这样的错误(应该是自己的包编译不了):
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:

An error occurred at line: 8 in the generated java file
Only a type can be imported. com.hongshee.ejforum.util.PageUtils resolves to a package

An error occurred at line: 9 in the generated java file
Only a type can be imported. com.hongshee.ejforum.util.AppUtils resolves to a package

An error occurred at line: 10 in the generated java file
Only a type can be imported. com.hongshee.ejforum.common.CacheManager resolves to a package

An error occurred at line: 11 in the generated java file
Only a type can be imported. com.hongshee.ejforum.common.AppContext resolves to a package

An error occurred at line: 12 in the generated java file
Only a type can be imported. com.hongshee.ejforum.common.ForumSetting resolves to a package

An error occurred at line: 13 in the generated java file
Only a type can be imported. com.hongshee.ejforum.data.UserDAO.UserInfo resolves to a package


An error occurred at line: 14 in the generated java file
Only a type can be imported. com.hongshee.ejforum.data.SectionDAO.SectionVO resolves to a package

An error occurred at line: 15 in the generated java file
Only a type can be imported. com.hongshee.ejforum.data.BoardDAO.BoardVO resolves to a package

An error occurred at line: 16 in the generated java file
Only a type can be imported. com.hongshee.ejforum.data.StatDAO resolves to a package

An error occurred at line: 17 in the generated java file
Only a type can be imported. com.hongshee.ejforum.data.GroupDAO.GroupVO resolves to a package

An error occurred at line: 20 in the jsp file: /index.jsp
AppContext cannot be resolved to a type
17:         if (!ctxPath.equals("/"))
18:                 serverName = serverName + ctxPath;
19:        
20:         AppContext appCtx = AppContext.getInstance();
21:         CacheManager cache = CacheManager.getInstance();
22:     ArrayList sections = cache.getSections();
23:        




而用普通帐户启动TOMCAT时这样的错误(应该是公共包找不到):
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:574)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.io.FileNotFoundException: /usr/local/tomcat/work/Catalina/localhost/ejforum/org/apache/jsp/index_jsp.java (Permission denied)
        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:152)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
        org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

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

ANY ADVICE???
应该是配置问题把。

建议你先拷一个干净的tomcat,测试下tomcat是否正常。

如果可以的话就可以确实你webapp的问题,然后一步步查把
其实都是正常的,TOMCAT的默认页也能访问。。
整个环境在WINDWOS上部署也成功了,但在LINUX上就出这样的问题
两个环境下的JDK是否一致,感觉是LIB中某一个包的问题。
org.apache.jasper.JasperException: Unable to compile class for JSP收藏
新一篇: 追MM与设计模式(java的32种设计模式) | 旧一篇: tomcat里设置安全访问-tomcat里设置http到https。

在运行struts时,运行时会出现这样的错误,解决方法是把JAVA_HOME/lib/tools.jar复制到 TOMCAT_HOME/common/lib下来。(我没有把原来的tools.jar文件删除,只是改了个名)

就ok了。

http://blog.csdn.net/freeplayer/archive/2007/05/12/1605665.aspx

这种异常, 我见过的, 应该是jar包的问题。
为了简单, 这样吧,1:确认自己的tomcat版本, tomat5.5.*至少要jdk1.5*来支持。
2: 我感觉redhat enterprise自带的都是jdk1.4,如果用jdk1.4的,5.5甚至更高版本的是肯定不能正常运行的。
3:下载一个jdk1.5的linux版,现在一般为*.bin格式的, 在文件所在的目录下,./*.bin,会生成一个jdk的目录,然后把该目录 move到/usr/local下(用mv jdk*  /usr/local)。
4:在/etc目录下vi profile, 在最后加入export   JAVA_HOME=/usr/local/jdk*
                                                        export  PATH=$JAVA_HOME/binPATH(顺序就是$PATH在后面的,不能改位置的)
                                                        export  CLASSPATH=.JAVA_HOME/lib/dt.jarJAVA_HOME/lib/tools.jar  , 然后执行source profile使之立刻生效(否则重启电脑才可以使之生效)
5:然后下载tomcat,现在一般的都是*.tar.gz格式的, 直接解压 tar -zxvf  *.tar.gz即可。
6:这样就可以启动tomcat了,看用netstat -an | grep 8080 来测试tomcat是否成功启动。
  希望你能成功哦。

不知道怎么回事, :都变成 来, 应该是: