2015-11-08 69 views
1

我用red5(1.0.5)編寫了一些flash應用程序。但是我決定讓一個servlet接收用戶的音頻文件(這次我不想使用flash)。我注意到我無法打開任何jsp。每當我嘗試打開一個時,我會得到以下servlet異常:javax.servlet.ServletException:java.lang.NoClassDefFoundError:javax/el/ExpressionFactory。如果我重新加載頁面,那麼在幾次嘗試之後,我會得到一些不同的結果:java.lang.ClassNotFoundException:org.apache.jsp.index_jsp然後如果我再次加載,那麼我提到的第一個異常再次顯示。 Project Explorer.任何幫助表示讚賞。 :)Red5,java.lang.NoClassDefFoundError:javax/el/ExpressionFactory

的Servlet

package org.red5.core; 

     import java.io.IOException; 
     import javax.servlet.ServletException; 
     import javax.servlet.annotation.WebServlet; 
     import javax.servlet.http.HttpServlet; 
     import javax.servlet.http.HttpServletRequest; 
     import javax.servlet.http.HttpServletResponse; 

/** 
     * Servlet implementation class Upload 
*/ 
     @WebServlet("/Upload") 
     public class Upload extends HttpServlet { 
     private static final long serialVersionUID = 1L; 

    /** 
    * Default constructor. 
    */ 
    public Upload() { 
    } 

    /** 
     * @see HttpServlet#doGet(HttpServletRequest request,HttpServletResponse response) 
    */ 
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 
     response.getWriter().append("Served at: ").append(request.getContextPath()); 
    } 

    /** 
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse  response) 
    */ 
     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 
     doGet(request, response); 
    } 

} 

JSP

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
    pageEncoding="ISO-8859-1"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<title>JSP</title> 
</head> 
<body> 
    <h1>JSP!</h1> 
</body> 
</html> 

異常

exception 

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ExpressionFactory 
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:348) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 
    org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77) 
root cause 

java.lang.NoClassDefFoundError: javax/el/ExpressionFactory 
    org.apache.jasper.compiler.PageInfo.<init>(PageInfo.java:79) 
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:111) 
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) 
    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:657) 
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) 
    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:727) 
    org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77) 

回答

1

檢查RED5/plugins目錄,你可能錯過了EL實現JAR,通常命名爲:tomcat的-embed-el.jar

+0

你是男人!我下載了jar,現在我可以享受servlet功能的美妙了。謝謝! –

+0

很高興爲你工作,現在你應該標記這個答案。 –