| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1235 人关注过本帖
标题:java.lang.NullPointerException是怎么回事
取消只看楼主 加入收藏
wq6525
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-7-25
收藏
 问题点数:0 回复次数:1 
java.lang.NullPointerException是怎么回事
代码如下
<!-- Copyright (c) 2002 by ObjectLearn. All Rights Reserved. -->
<%@ page language="java" contentType="text/html;charset=GBK"%>
<%@page import = "java.sql.*"%>
<html>
<head>
<title>hello,everyone</title>
</head>
<body>
<center>
<%
Connection con=null;
Statement sm=null;
ResultSet rs=null;
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url="jdbc:mysql://localhost/mydb1";
con=DriverManager.getConnection(url,"root","12345");
sm = con.createStatement();
rs=sm.executeQuery("select * from userinfo");
while(rs.next())
{
out.println("hello"+rs.getString("name")+"!<br>");
}
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
if(rs!=null)
{
try{rs.close();}catch(Exception e){e.printStackTrace();}
}
if(sm!=null)
{
try{sm.close();}catch(Exception e){e.printStackTrace();}
}
if(con!=null)
{
try{con.close();}catch(Exception e){e.printStackTrace();}
}
}
%>
</center>
</body>
</html>
一保存文件eclipse就提示J2EE Plugin internal error
详细情况是
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.batch.FileSystem.initializeKnownFileNames(FileSystem.java:111)
at org.eclipse.jdt.internal.compiler.batch.FileSystem.<init>(FileSystem.java:71)
at org.eclipse.jdt.internal.compiler.batch.FileSystem.<init>(FileSystem.java:49)
at com.objectlearn.jdt.j2ee.core.jasper.JasperNameEnvironment.jasperizedClasspath(JasperNameEnvironment.java:127)
at com.objectlearn.jdt.j2ee.core.WebModule.internalParseJSP(WebModule.java:232)
at com.objectlearn.jdt.j2ee.core.WebModule.forceParseJSP(WebModule.java:218)
at com.objectlearn.jdt.j2ee.core.WebModule.parseJSP(WebModule.java:197)
at com.objectlearn.jdt.j2ee.core.WebModule.internalCompileJsp(WebModule.java:78)
at com.objectlearn.jdt.j2ee.core.WebModule.compileJsp(WebModule.java:66)
at com.objectlearn.jdt.j2ee.core.WebModule.incrementalBuildFor(WebModule.java:291)
at com.objectlearn.jdt.j2ee.core.WebModule.incrementalBuildFor(WebModule.java:272)
at com.objectlearn.jdt.j2ee.core.Project.incrementalBuildFor(Project.java:609)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.doIncrementalBuildFor(ResourceChangedListener.java:178)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.access$0(ResourceChangedListener.java:171)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener$1.visit(ResourceChangedListener.java:155)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:49)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.deltaTree(ResourceChangedListener.java:152)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.deltaTree(ResourceChangedListener.java:167)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.deltaTree(ResourceChangedListener.java:167)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.deltaTree(ResourceChangedListener.java:167)
at com.objectlearn.jdt.j2ee.core.ResourceChangedListener.resourceChanged(ResourceChangedListener.java:92)
at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:276)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:270)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:144)
at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:185)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
怎么回事呀
搜索更多相关主题的帖子: java lang null page 
2007-08-05 11:15
wq6525
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-7-25
收藏
得分:0 

谢谢各位了

2007-08-05 14:44
快速回复:java.lang.NullPointerException是怎么回事
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016590 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved