使用jsp:useBean的時候出錯!
其他jsp頁面正常
有一個頁面是
<%@ page contentType="text/html"%>
<jsp:useBean id="test" scope="session" class="testBean"/>
<%=test.getUserid()%>
<%=test.getPassword()%>
類testBean程式碼為
public class testBean implements java.io.Serializable{
private String userid = "init";
private String password = "init";
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
並且編譯透過
但是執行的時候報錯
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
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
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
應該是找不到編譯所需的類包,但是所需要的類我都在CLASSPATH中宣告瞭啊
我的CLASSPATH是
.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\msbase.jar;%JAVA_HOME%\lib\mssqlserver.jar;%JAVA_HOME%\lib\msutil.jar;%JAVA_HOME%\lib\msutil.jar;%JAVA_HOME%\lib\jbcl.jar;%JAVA_HOME%\lib\servlet-api.jar;%JAVA_HOME%\jre\lib\
我的JAVA_HOME是
c:\j2sdk1.4
請問哪出錯了,謝謝
有一個頁面是
<%@ page contentType="text/html"%>
<jsp:useBean id="test" scope="session" class="testBean"/>
<%=test.getUserid()%>
<%=test.getPassword()%>
類testBean程式碼為
public class testBean implements java.io.Serializable{
private String userid = "init";
private String password = "init";
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
並且編譯透過
但是執行的時候報錯
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
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
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
應該是找不到編譯所需的類包,但是所需要的類我都在CLASSPATH中宣告瞭啊
我的CLASSPATH是
.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\msbase.jar;%JAVA_HOME%\lib\mssqlserver.jar;%JAVA_HOME%\lib\msutil.jar;%JAVA_HOME%\lib\msutil.jar;%JAVA_HOME%\lib\jbcl.jar;%JAVA_HOME%\lib\servlet-api.jar;%JAVA_HOME%\jre\lib\
我的JAVA_HOME是
c:\j2sdk1.4
請問哪出錯了,謝謝
相關文章
- jsp:useBean用法JSBean
- jsp標籤jsp:useBean用法JSBean
- jsp:useBean的亂碼處理JSBean
- ftp下載的時候用mget命令出錯FTP
- ant intro-interest-ear時候出錯REST
- 在使用jbuild7執行jive論壇的時候出現下列錯誤UI
- 使用rman執行recover database 的時候出現RMAN-06054的錯誤提示Database
- 解決vue使用Sass時候的報錯問題Vue
- centos6.2安裝virtualbox建立xp的時候出錯CentOS
- 關於jsp呼叫ejb出錯的jsp程式如下JS
- 使用HttpClient時出錯NoClassDefFoundErrorHTTPclientError
- PrestaShop 1.7 使用者付款的時候無法支付錯誤REST
- 請問一下jsp;useBean中request作用域問題JSBean
- 什麼時候釋出
- 裝完PHP後重起Apache的時候出現"Undefinedsymbols"錯誤(轉)PHPApacheUndefinedSymbol
- rsync 客戶端同步的時候報錯客戶端
- 執行dbca命令的時候報錯了
- [BUG反饋]升級OT1.1開發版的時候出錯了
- npm publish 釋出一個 Angular 庫的時候報錯以及解決方法NPMAngular
- 裝完PHP後重起Apache的時候出現"Undefined symbols"錯誤(轉)PHPApacheUndefinedSymbol
- 新版什麼時候釋出?
- 線上急等]訪問jsp時的錯誤JS
- 我安裝JIVE,在setup時,按繼續候,出現錯誤。
- 奇怪的問題: 資料庫使用者登入的時候報錯資料庫
- 蘋果釋出ios新特性的時候,安卓使用者的反應蘋果iOS安卓
- 物理data guard備standby庫的時候報錯。
- vagrant下composer安裝laravel-wechat時候,出現could not delete的錯誤Laraveldelete
- 版主求救:Jbuilder編譯Jsp出錯UI編譯JS
- setInterval()呼叫其他函式時候報錯函式
- JSP 的本質原理解析:"編寫的時候是JSP,心裡想解讀的是 java 原始碼"JSJava原始碼
- 訪問量非常大的時候,如何讓我的jsp能支援的住?JS
- suse10啟動vsftp的時候報錯FTP
- 當出現記憶體洩漏的時候記憶體
- 到底什麼時候使用mqMQ
- 安裝jive 後,post.jsp 出錯JS
- thinkphp自帶Page類使用時候setconfig() name=last的時候不生效PHPAST
- Debian 12 到底啥時候釋出?
- 釋出時出錯.求助