org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:453)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause 
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:572)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause 
java.lang.SecurityException: no manifiest section for signature file entry javax/mail/internet/ContentDisposition.class
sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVerifier.java:377)
sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:231)
sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:176)
java.util.jar.JarVerifier.processEntry(JarVerifier.java:277)
java.util.jar.JarVerifier.update(JarVerifier.java:188)
java.util.jar.JarFile.initializeVerifier(JarFile.java:321)
java.util.jar.JarFile.getInputStream(JarFile.java:386)
org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1977)
org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:926)
org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1147)
org.apache.jasper.servlet.JasperLoader.getResourceAsStream(JasperLoader.java:143)
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:184)
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:169)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:126)
org.eclipse.jdt.internal.compiler.lookup.Scope.findType(Scope.java:1355)
org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2472)
org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2194)
org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:39)
org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:124)
org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.resolve(LocalDeclaration.java:147)
org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:115)
org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:504)
org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:115)
org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:504)
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:427)
org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:178)
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:398)
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1078)
org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1127)
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:305)
org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:512)
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:404)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

解决方案 »

  1.   

    我是需要上传图书信息到数据库,结果SmartUpload出错,数据库连接正常,因为我注册用户信息(未用SmartUpload),从数据库读数都正常,就是图书信息不能上传(使用SmartUpload),求求各位高手,时间很紧急!!!
    <%@ page contentType="text/html; charset=gb2312" language="java"%>
    <jsp:useBean scope="page" id="books" class="com.ch11.books" />
    <%@ page import="com.jspsmart.upload.*"%>
     <%@ page import="java.sql.*"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>  
    <%             try
    {
    // 新建一个SmartUpload对象
    SmartUpload su = new SmartUpload();
    // 上传初始化
    su.initialize(pageContext);
    //设定上传限制
    //限制每个上传文件的最大长度。
    su.setMaxFileSize(1000000*8);
    //设定允许上传的文件(通过扩展名限制)
    su.setAllowedFilesList("jpg,gif,bmp,JPG,GIF,BMP");
    // 上传文件
    su.upload();
    String s_SortID=su.getRequest().getParameter("SortID");
    long l_SortID = Long.parseLong(s_SortID);
    String s_BookName=su.getRequest().getParameter("BookName");
    String s_Pub=su.getRequest().getParameter("Pub");
    String s_Intro=su.getRequest().getParameter("Intro");
    String s_Author=su.getRequest().getParameter("Author");
    String s_Price=su.getRequest().getParameter("Price");
    float f_Price = Float.parseFloat(s_Price);
    String s_PicUrl="00000000000000.gif";
    //判断是否有附件上传
    com.jspsmart.upload.File file = su.getFiles().getFile(0);
    if (!file.isMissing())
    {   String s_Pic=file.getFileName();
    //将附件以 当前时间+附件扩展名 作为文件名保存
    java.text.SimpleDateFormat dateFormatter = new java.text.SimpleDateFormat("yyyyMMddHHmmss");
    String s_NowTime = dateFormatter.format(new java.util.Date());
    s_PicUrl = s_NowTime+"."+ file.getFileExt();
    file.saveAs("./pic/"+s_PicUrl);
    }
    //将文章信息保存到数据库中
    books.setBookName(s_BookName);
    books.setAuthor(s_Author);
    books.setIntro(s_Intro);
    books.setSortID(l_SortID);
    books.setPub(s_Pub);
    books.setPicUrl(s_PicUrl);
    books.setPrice(f_Price);
    if(books.add_book())
    {
    out.println("<p align=center>图书信息发布成功</p>");
    out.println("<div align=center><input type=button name=btn1 value=\"返回图书管理\" onClick='window.location=\"./books_management.jsp\"'></div>");
    }
    else
    {out.println("<p align=center>图书信息发布失败,请重试</p>");
    out.println("<div align=center><input type=button name=btn2 value=\"返回\" onClick='window.history.go(-1)'></div>");
    return;
    }
    }
    catch(Exception e)
    {
    out.println("<p align=center>您上传的文件格式不对,或者上传文件太大!</p>");
    out.println("<div align=center><input type=button name=btn3 value=返回 onClick='window.history.go(-1)'></div>");
    return;
    }
    %>
    </body>
    </html>
                                      books.java
    import java.util.*;
    import java.sql.*;
    import java.text.*;
    public class books extends Execute_DB
    {
    //定义类成员变量
    private long BookID;    
    private String BookName;       
    private String Author;   
    private String Pub;
    private float Price;
    private String PicUrl;
    private long SortID;   
    private String Intro;
    private int RecommendNumber;
    private String strSql;

        
        //初始化类成员变量
    public books()
    {
    this.BookID=0;        
    this.BookName="";
    this.Author="";
    this.SortID=0;
    this.Price=0;
    this.Pub="";
    this.PicUrl = "00000000000000.gif";
    this.Intro = "";
    this.RecommendNumber = 0;
    this.strSql=""; 
    }
       
    //向books数据表中添加一条新记录
    public boolean add_book()
    {
                   this.strSql="insert into books ";
    this.strSql=this.strSql + "(";        
    this.strSql=this.strSql + "BookName,";  
    this.strSql=this.strSql + "Author,";
    this.strSql=this.strSql + "Pub,";
    this.strSql=this.strSql + "Price,";
    this.strSql=this.strSql + "SortID,"; 
    this.strSql=this.strSql + "PicUrl,"; 
    this.strSql=this.strSql + "Intro,"; 
    this.strSql=this.strSql + "RecommendNumber";              
    this.strSql=this.strSql + ") ";        
    this.strSql=this.strSql + "values(";
    this.strSql=this.strSql + "'" + this.BookName + "',";
    this.strSql=this.strSql + "'" + this.Author + "',";
    this.strSql=this.strSql + "'" + this.Pub + "',";
    this.strSql=this.strSql + "'" + this.Price + "',";
    this.strSql=this.strSql + "'" + this.SortID + "',";
    this.strSql=this.strSql + "'" + this.PicUrl + "',";
    this.strSql=this.strSql + "'" + this.Intro + "',";
    this.strSql=this.strSql + "'" + this.RecommendNumber + "'";
    this.strSql=this.strSql + ")";
    System.out.println(this.strSql);
    boolean isAdd = super.exeSql(this.strSql);
    return isAdd;
    }   
       //修改类成员变量BookID对应的图书信息
    public boolean modify_info()
    {
    this.strSql="update books set ";
    this.strSql=this.strSql + "BookName=" + "'" + this.BookName + "',";
    this.strSql=this.strSql + "Author=" + "'" + this.Author + "',";
    this.strSql=this.strSql + "Pub=" + "'" + this.Pub + "',";
    this.strSql=this.strSql + "Price=" + "'" + this.Price + "',";
    this.strSql=this.strSql + "SortID=" + "'" + this.SortID + "',";
    this.strSql=this.strSql + "PicUrl=" + "'" + this.PicUrl + "',";
    this.strSql=this.strSql + "Intro=" + "'" + this.Intro + "'";
    this.strSql=this.strSql + " where BookID=" + this.BookID;
    System.out.println(this.strSql);
    boolean isUpdate = super.exeSql(this.strSql);
    return isUpdate;
    }
       
      //删除类DeleteBookID中对应的图书信息
    public boolean delete_book(String DeleteBookID)
    {
    this.strSql="delete from books where BookID in (";
    this.strSql=this.strSql + DeleteBookID + ")";
    System.out.println(this.strSql);
    boolean isDelete = super.exeSql(this.strSql);
    return isDelete;
    }
    //获取类成员变量BookID对应的图书信息
    public boolean  init()
    {
    this.strSql="select * from books where BookID=";
    this.strSql=this.strSql + this.BookID;        
    System.out.println(strSql);      
    try
    {
    ResultSet rs = super.exeSqlQuery(this.strSql);
    if (rs.next())
    {
    this.BookID=rs.getLong("BookID");                
    this.BookName=rs.getString("BookName"); 
    this.Pub=rs.getString("Pub");
    this.Author=rs.getString("Author");
    this.PicUrl=rs.getString("PicUrl");   
    this.Price=rs.getFloat("Price");
    this.SortID=rs.getInt("SortID");   
    this.Intro=rs.getString("Intro");
    this.RecommendNumber=rs.getInt("RecommendNumber");
    return true;
    }
    else
    {
    return false;

    }
    catch(Exception ex)
    {  
    return false;
    }
    }

    //获取所有普通图书信息,返回一个ResultSet类型对象
    public ResultSet show_books()
    {
    this.strSql="select * from books";
    ResultSet rs = null;              
    try
    {
    rs = super.exeSqlQuery(this.strSql); 
    }
    catch(Exception ex)
    {
    System.out.println(ex.toString());            
    }
    return rs;        


    //获得按RecommendNumber排序的图书集合,返回一个ResultSet类型对象
    public ResultSet show_books_ByRecommendNumber()
    {
    this.strSql="select * from books order by RecommendNumber desc";
    ResultSet rs = null;              
    try
    {
    rs = super.exeSqlQuery(this.strSql); 
    }
    catch(Exception ex)
    {
    System.out.println(ex.toString());            
    }
    return rs;        

       
        //以BookName、Author、Pub、SortID为条件搜索books数据表,获得符合条件的记录,返回一个ResultSet类型对象
    public ResultSet search_books(String BookName,String Author,String Pub,long SortID)
    {
    this.strSql="select * from books where";
    this.strSql=this.strSql + " BookName like '%" + BookName +"%'";    
    this.strSql=this.strSql + " and Author like '%" + Author +"%'"; 
    this.strSql=this.strSql + " and Pub like '%" + Pub +"%'";
    if(SortID != 0)
    {
    this.strSql=this.strSql + " and SortID =" + SortID;
    }

    ResultSet rs = null;              
    try
    {
    rs = super.exeSqlQuery(this.strSql); 
    }
    catch(Exception ex)
    {
    System.out.println(ex.toString());            
    }
    return rs;        
    }     
    //设置类成员变量BookID的值 
    public void setBookID(long BookID)
    {
    this.BookID = BookID;
    }     //设置类成员变量BookName的值 
      public void setBookName(String BookName)
    {
    this.BookName = BookName;
    }    //获取类成员变量BookName的值  
    public String getBookName()
    {
    return this.BookName;


     //设置类成员变量Author的值 
      public void setAuthor(String Author)
    {
    this.Author = Author;
    }  
    ........(以后的代码省略)
    }我很纠结这个问题3天了,在网上查些资料,都不对口,希望各路高手相救!是不是jar包冲突了??怎么就不能上传呢?上面的错误信息没看懂??
      

  2.   

    Unable to compile class for JSP  不能把jsp编译成class。应该是你jsp页面出错了,且错误代码你没有贴完吧?
      

  3.   

    root cause  
    java.lang.SecurityException: no manifiest section for signature file entry javax/mail/internet/ContentDisposition.class你的mail.jar包是不是改了?如果没改,请重新下载这个jar包