JSP连接数据库,报Unable to compile class for JSP

时间:2023-02-11 08:50:01

先看一下报错原因:

HTTP Status 500 - Unable to compile class for JSP:

type Exception report

message Unable to compile class for JSP:

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: [16] in the generated java file: [F:\apache-tomcat-7.0.70\work\Catalina\localhost\LibrarySystem\org\apache\jsp\frameOne_jsp.java]
Only a type can be imported. com.mysql.jdbc.Driver resolves to a package Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.70 logs.
Apache Tomcat/7.0.70

然后我的解决办法是:因为我使用的MyEclipse编译器是32位,里面自带的是32位的JDK1.6版本,而我的电脑是64位的WIN10系统,安装的是64位的Tomcat7.0,结果在Tomcat中部署时,出现了上面的错误。随后,我下载安装配置了一个32位的Tomcat7.0,结果问题顺利解决~

(PS:当时我是参照这一篇博客而解决了问题,具体链接地址如下:http://blog.csdn.net/zwk626542417/article/details/38421839)

JSP连接数据库,报Unable to compile class for JSP的更多相关文章

  1. maven web报错:org.apache.jasper.JasperException: Unable to compile class for JSP

    原博文地址:https://blog.csdn.net/ken1583096683/article/details/80837281 maven web项目启动没问题,访问页面就报错:org.apac ...

  2. 【JSP报错】—— org.apache.jasper.JasperException: Unable to compile class for JSP

    org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [52] ...

  3. Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Unable to compile class for JSP] with root cause java.lang.IllegalArgumentException: Page directive: inval

    严重: Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Una ...

  4. Unable to compile class for JSP

    https://www.cnblogs.com/mthoutai/p/7136304.html 错误提示: The return type is incompatible with JspSource ...

  5. JAVA Drp项目实战—— Unable to compile class for JSP 一波三折

    交代下背景.电脑系统是64位的,用的是64位的Tomcat.安装是32位的Myeclipse10,java环境也是32位的.Tomcat在開始启动时会报这样一个错误,"Can't load ...

  6. embedded tomcat运行java web,Unable to compile class for JSP

    环境 eclipse:4.5.2 jre:1.8 java project compiler:1.8 embedded tomcat:7.0.32 可以正常启动,但是访问时,会报错. HTTP Sta ...

  7. Jetty - Unable to compile class for JSP

    问题与分析 在启动公司项目时发现报错如下: [jetty] 2019-10-07 10:28:28.760:WARN:org.apache.jasper.compiler.Compiler:Error ...

  8. UniEAP Platform V5.0 Unable to compile class for JSP

    流程设计器报错: http://127.0.0.1:8080/framework/workflow/webdesign/procmodify/procmodifydetail.jsp?isLoadDa ...

  9. org.apache.jasper.JasperException: Unable to compile class for JSP

    项目启动时报错 : The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory S ...

随机推荐

  1. [译]如何防止elasticsearch的脑裂问题

    本文翻译自blog.trifork.com的博文 地址是http://blog.trifork.com/2013/10/24/how-to-avoid-the-split-brain-problem- ...

  2. Mysql-简单安装

    centos上安装msqyl 通过如下命令来查看我们的操作系统上是否已经安装了mysql数据库 [root@CentOS6.5 ~]# rpm -qa | grep mysql #这个命令就会查看该操 ...

  3. Windows 2012 R2中安装SharePoint 2013 sp1参考

    之前介绍过在window 2012中安装SharePoint 2013,这次,借着SharePoint 2013 sp1补丁发布之际,介绍下在window 2012 r2中安装SharePoint 2 ...

  4. TdxAlertWindowManager右下角HINT显示控件

    带爱像的右下角HINT显示,自动隐藏 function alterInfo: TdxAlertWindowManager;begin  if not Assigned(Falter) then  be ...

  5. 先前设定的sa密码忘记了,如何修改sa密码?

    在window身份验证登陆后,新建查询,输入以下代码就可以修改sa密码了: use master go exec sp_password null,'123456','sa' go

  6. DelphiXE4- System.IOUtils.TDirectory笔记查询后缀名为dll的文件

    TStringDynArray 在System.Types中定义

  7. Android ---时间工具类

    public class DateUtil { // protected static Log logger = LogFactory.getLog(DateUtil.class); // 格式:年- ...

  8. node笔记-node的好基友monggoDB

    mongoDB--非关系型数据库的佼佼者 mongodb是一个基于分布式文件存储的数据库,由c++语言编写. 特点:高性能.易部署.易使用. 下载地址:http://www.mongodb.org/d ...

  9. Android 5.1.1 源码目录结构

    点击打开链接 最近公司培训新同事,我负责整理一点关于android的基础知识,遥想当年,刚接触android,也是一头雾水, 啥都不懂,就是靠看文档和视频,对android有一个初步了解,然后就通过查 ...

  10. PL/SQL修改数据之后,程序查到的还是原来的数据怎么办?

    我们在开发的过程中,可能需要手动删除或者修改数据库数据,但是在update之后,程序还是查到的是原始的数据.而我们自己在pl/sql中查到的确实修改之后的数据,通常情况下这个是因为我们在修改之后没有c ...