奇怪,我启动weblogic时然后再运行程序就都不会发生错误。但用jbuilder启动weblogic server时,就会发生楼顶的错误。然后我运行程序时又会发生以下错误:(是在启动weblogic的tab里打印出错误,不是在程序的tab里打印出错误) ---------------------------------------------------------------------------- <2003-8-23 上午12时06分58秒> <Error> <socket> <000403> <IOException on socket: Socket[addr=/127.0.0.1,port=4420,localport=7001] java.net.SocketException: Connection reset java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:328) at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133) >
最近W32.Blaster.Worm病毒泛滥,我的xp不知怎么得无法升级,只有开着防火墙,机子就变慢了,还好我的内存384 DDR的。我又舍不得重装系统,机子里太多东西了
-------------------------------------------------------------------------------package j2eeTest;import java.sql.*;
import javax.naming.*;
import javax.sql.*;
import java.util.Properties;
import javax.rmi.PortableRemoteObject;public class Example1 { public static void main(String[] args) {
DataSource ds = null;
Context ctx = null;
Connection myConn = null;
try {
/* 获得WebLogic ServerJNDI初始上下文信息
*/
ctx = getInitialContext();
/* 建立数据源对象
*/
ds = (javax.sql.DataSource)
ctx.lookup("myDataSource");
} catch(Exception E) {
System.out.println("Init Error: " + E);
}
Statement myStatement = null;
ResultSet myResultSet = null;
try {
//建立连接
myConn = ds.getConnection();
// 建立语句对象
myStatement = myConn.createStatement();
//建立结果集对象
myResultSet = myStatement.executeQuery(
"SELECT stuid from student"
);
//遍历结果集对象,访问每一条记录,输出full_name字段
while(myResultSet.next()) {
System.out.println("the student full name is " +
myResultSet.getString("stuid"));
}
//关闭结果集
myResultSet.close();
} catch(SQLException e) {
System.out.println("Error code = " + e.getErrorCode());
System.out.println("Error message = " + e.getMessage());
} finally {
try {
// close the Statement object using the close() method
if(myStatement != null) {
myStatement.close();
}
// close the Connection object using the close() method
if(myConn != null) {
myConn.close();
}
} catch(SQLException e) {
System.out.println("Error code = " + e.getErrorCode());
System.out.println("Error message = " + e.getMessage());
}
} } private static Context getInitialContext() throws Exception {
String url = "t3://localhost:7001";
String user = "NakoRuru";
String password = "47421062";
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL , url);
if(user != null) {
properties.put(Context.SECURITY_PRINCIPAL , user);
properties.put(Context.SECURITY_CREDENTIALS ,
password == null ? "" : password);
}
return new InitialContext(properties);
} catch(Exception e) {
throw e;
}
}}
----------------------------------------------------------------------------
<2003-8-23 上午12时06分58秒> <Error> <socket> <000403> <IOException on socket: Socket[addr=/127.0.0.1,port=4420,localport=7001]
java.net.SocketException: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:328)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
>