当前位置: 代码迷 >> Java相关 >> 还是一个Unable to compile class for JSP的问题,实在解决不了,老问题,问 ...
  详细解决方案

还是一个Unable to compile class for JSP的问题,实在解决不了,老问题,问 ...

热度:602   发布时间:2008-03-30 18:46:36.0
还是一个Unable to compile class for JSP的问题,实在解决不了,老问题,问一下(谅解)
想在Tomcat里运行JSP文件,就从没成功过,很是郁闷

我照的书的例子写了个有关session对象的JSP文件
放到Tomcat的Webapps文件夹下,
在IE里敲入:http://localhost:8080/page1.jsp
就出现了以下的错误:
=====================================================================================
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: 1 in the jsp file: /page1.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\page1_jsp.java:42: illegal character: \64
@ page contextType="text/html;charset=gb2312"  
^


An error occurred at line: 2 in the jsp file: /page1.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\page1_jsp.java:45: illegal character: \64
@ page import="java.util.Date"  
^


An error occurred at line: 3 in the jsp file: /page1.jsp
Generated servlet error:
C:\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\page1_jsp.java:48: illegal character: \64
@ page language="java"  
^
3 errors


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
====================================================================================
Google了一下
把JDK里的Tool.jar文件复制到了Tomcat下,问题还是有
重新看了一下环境变量的设置,classpath没错,设置了tool.jar

请问高手问题出在哪?

在一个地方看到说jdk1.5.0和Tomcat5.0不兼容,有这回事吗?
搜索更多相关的解决方案: Unable  compile  JSP  class  

----------------解决方案--------------------------------------------------------
  相关解决方案