Exception in thread "main" java.lang.NullPointerExceptionat
来源:百度知道 编辑:UC知道 时间:2024/05/28 06:18:00
Exception in thread "main" java.lang.NullPointerException
at xchat.XCHAT.main(XCHAT.java:91)
try{
socket = new JxtaServerSocket(myGroup,myUnicastPipeAdv,20);
socket.setSoTimeout(0);
}
catch(IOException e){
System.out.println("创建服务器套接字失败!!");
System.exit(-1);
}
try{
Thread.sleep(10000);
}
catch(Exception e){
}
while(true){
try{
JxtaSocket sock = (JxtaSocket)socket.accept();
if(sock==null)
System.out.println("sock is null...........") ;
System.out.println("sock :"+sock.toString()) ;
// InetAddress ia = sock.getInetAddress() ;
// System.out.println("ia :"+ia.toString()) ;
String sid =
at xchat.XCHAT.main(XCHAT.java:91)
try{
socket = new JxtaServerSocket(myGroup,myUnicastPipeAdv,20);
socket.setSoTimeout(0);
}
catch(IOException e){
System.out.println("创建服务器套接字失败!!");
System.exit(-1);
}
try{
Thread.sleep(10000);
}
catch(Exception e){
}
while(true){
try{
JxtaSocket sock = (JxtaSocket)socket.accept();
if(sock==null)
System.out.println("sock is null...........") ;
System.out.println("sock :"+sock.toString()) ;
// InetAddress ia = sock.getInetAddress() ;
// System.out.println("ia :"+ia.toString()) ;
String sid =
很明显,你定义一个引用 A a=null
然后你直接使用a.f() A中的某个方法是f() 这样就会有这异常
也就是你的a未初始化,或者初始化失败
空指针异常,这是由于对象引用是null
Exception EOleSysError in module
英语作文,主题:in th park
Realistic novel in the 18th century
on June 5th和in June
Christmas in the 13th Month
nothing in thé world 是什么意思?
Report ranks China 6th in overall strength 怎么翻译?
谁能告诉我feminism in 17th century 在英国
The film was released on 11th July in China
Fashions in America before the 19th century_____those of Egland.