先看一下报错原因:

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. QT5.1 调用https

    以VS开发为例.因为https访问需要用到SSL认证,而QT默认是不支持SSL认证,所以在使用之前必须先做一些准备工作: 需要安装OpenSSL库: 1.首先打开http://slproweb.com ...

  2. CSS之深入探究Position

    这些天重新整理以前的代码,想对其进行优化,却出现了很多问题,其中一个就是Position,中间自己停下优化代码的工作,特意停下来深入研究了一下Position.现在来分享一下自己的体会吧! 首先我们从 ...

  3. python读取文件的方法

    一. 通过readline 逐行读取: #--encoding:utf-8 with open("ha.conf","r",encoding='utf-8') ...

  4. 第 31 章 项目实战-PC 端固定布局[3]

    学习要点: 1.搜索区 2.插入大图 3.搜索框 主讲教师:李炎恢 本章主要开始使用学习用 HTML5 和 CSS3 来构建 Web 页面,第一个项目采用 PC 端固定布局来实现. 一.搜索区 本节课 ...

  5. 【夯实PHP系列】PHP正则表达式

    一. 概述 1. 正则表达式的测试地址: http://tool.chinaz.com/regex/ 二.具体的常用正则表达式 1. 邮箱正则表达式: 1)\w[-\w.+]*@([A-Za-z0-9 ...

  6. Singleton

    1.//懒汉模式 //天生线程不安全,但是效率高 public class Singleton { private static Singleton singleton; private Single ...

  7. [ASP.NET MVC] ASP.NET Identity登入技术剖析

    [ASP.NET MVC] ASP.NET Identity登入技术剖析 前言 ASP.NET Identity是微软所贡献的开源项目,用来提供ASP.NET的验证.授权等等机制.本篇文章介绍ASP. ...

  8. 基于HTML5 Canvas实现的图片马赛克模糊特效

    效果请点击下面网址: http://hovertree.com/texiao/html5/1.htm 一.开门见山受美国肖像画家Chuck Close的启发,此脚本通过使用HTML5 canvas元素 ...

  9. 今天再给大家带点html5前端开发的干货模板“text/tpl”怎么用 script template怎么用

    text/tpl 顾名思义就是模板,其实和C++模板函数类似的作用,就是利用他生成一个HMTL内容,然后append或者替换html里面 有什么好处,假如后端返回来的数据都是一样的,但是需要生成不同的 ...

  10. 2-1 git合并 打tag

    tag常用命令(仅供参考): git tag -a V1.4 -m "1.4" 创建一个tag git tag 查看本地tag git tag -d V1.1  删除本地tag g ...