SOS!jsp+oracle测试程式,

seacaptain 2004-09-04 08:40:58
classpath:D:\Sun\AppServer\jdk\lib\dt.jar;D:\Sun\AppServer\jdk\lib\tools.jar;D:\oracle\ora92\jdbc\lib\classes12.jar

//testoracle.jsp
<%@page contentType="text/html;charset=gb2312"%>
<%@page language="java" %>

<%

import java.util.*;
import java.sql.*;
import javax.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
import javax.naming.*;

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

String url="jdbc:oracle:thin:@ibm-2373-7wh:1521:ibm";
String user="scott";
String password="dingding";
Connection conn=DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from test";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {%>
your no_id: <%=rs.getString(1)%>
your subject:<%=rs.getString(2)%>
<%}%>
<% out.print("connect to oracle is successed");%>
<% rs.close();
stmt.close();
conn.close();
%>

出错信息:
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:87)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:311)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:421)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:402)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:262)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)


note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server-PE-8.0 logs.

...全文
57 7 点赞 打赏 收藏 举报
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
seacaptain 2004-09-07
UP
  • 打赏
  • 举报
回复
seacaptain 2004-09-05
sorry我的是sun appserver ,不是tomcat
  • 打赏
  • 举报
回复
jewelsh 2004-09-04
copy $JAVA_HOME/lib/tools.jar to $TOMCAT_HOME/common/lib
  • 打赏
  • 举报
回复
seacaptain 2004-09-04
classpath:D:\Sun\AppServer\jdk\lib\dt.jar;D:\Sun\AppServer\jdk\lib\tools.jar;D:\oracle\ora92\jdbc\lib\classes12.jar

环境设置的问题,这样对不?
  • 打赏
  • 举报
回复
guestman 2004-09-04
环境设置的问题!
  • 打赏
  • 举报
回复
kingofvc 2004-09-04
因为有时候 $JAVA_HOME/lib/tools.jar 虽然放在那里 但是由于classpath里面 有其他的东西 比如你装了 oracle 他可能就找到了另外一个tools.jar 所以 tomcat提议的方法 最好
  • 打赏
  • 举报
回复
kingofvc 2004-09-04
不是告诉你怎么做了嘛
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.
  • 打赏
  • 举报
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2004-09-04 08:40
社区公告
暂无公告