2015-10-13 143 views
0
**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: [14] in the generated java file: [/usr/local/easy/share/easy-tomcat7/work/Catalina/paykar.co.in/jsp/org/apache/jsp/rechargeMobile_jsp.java] 
Only a type can be imported. com.RechargeMobile resolves to a package 

An error occurred at line: [15] in the generated java file: [/usr/local/easy/share/easy-tomcat7/work/Catalina/paykar.co.in/jsp/org/apache/jsp/rechargeMobile_jsp.java] 
Only a type can be imported. com.MobileInfo 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:463) 
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:378) 
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) 
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) 
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646) 
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357) 
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) 
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) 
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs. 

回答

1

JSP文件中存在導入錯誤。

有一個在你的日誌一個明確的信息:在線路發生

錯誤:[14]在生成的Java文件: [在/ usr /本地/易/股/易tomcat7 /工作/Catalina/paykar.co.in/jsp/org/apache/jsp/rechargeMobile_jsp.java] 只能導入一個類型。 com.RechargeMobile解析爲一個包

這就是說,你應該有一個像下面的一行:

<%@ page import="com.MobileInfo" %> 

但是,這是一個包,而不是一類。 嘗試改變它遵循導入包:

<%@ page import="com.MobileInfo.*" %> 

Otherwhise變化IR如下導入spacific類,你需要:

<%@ page import="com.MobileInfo.YourClassName" %>