Bonjour, j'ai une application que j'ai reussi a la lancer sous windows et sous linux sans prb,la quand je la lance avec un serveur linux j'obtient ce message d'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
Exception in thread "Timer-0" java.lang.NullPointerException
	at marouene.TestPerformance$1RemindTask.run(TestPerformance.java:65)
	at java.util.TimerThread.mainLoop(Unknown Source)
	at java.util.TimerThread.run(Unknown Source)
apparament c'est en relation avec le timer que j'ai dans ma classe main qui est celle ci :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package marouene;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DecimalFormat;
 
import java.util.Timer;
import java.util.Vector;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.TimerTask;
import java.text.*;
import java.util.Locale;
 
 
public class TestPerformance  {
 
	  static int i = 0;
	  static Timer timer;
      static Connection con;
     static double perte;
	public static void main(String[] args) {
 
         class RemindTask extends TimerTask {
 
				public void run() {
 
 
 
					//TestFtp ftp = new TestFtp();
					//HttpClient http = new HttpClient();
					Ping avg = new Ping();
					Dns dns = new Dns();
					 Vector t=dns.tableau();
 
					 try {
						double perte=dns.taux(t.size());
					} catch (IllegalStateException e1) {
 
					} catch (IOException e1) {
 
 
				}
					tableau tab = new tableau();
 
					try {
						Class.forName("com.mysql.jdbc.Driver");
						 try {
							con DriverManager.getConnection("jdbc:mysql://localhost:3306newdata","root","root");
					} catch (SQLException e) {
 
						}
 
					} catch (ClassNotFoundException e) {
 
						e.printStackTrace();
					}
 
					//capture cc = new capture();
 
					try {
						Statement stm=con.createStatement();
					//	int res1=stm.executeUpdate("insert into httptable(date,heure,http) values (now(),now(),"+http.debithttp("http://41.228.192.9/30M")+")");
						//int res2=stm.executeUpdate("insert into ftptable(date,heure,ftp) values (now(),now(),"+ftp.calculdebitftp("otn","otnotn","41.228.192.9","/30M")+")");
						int res4=stm.executeUpdate("insert into dnstable(date,heure,min,moy,max,perte) values (now(),now(),"+tab.minimum(t)+","+tab.moyenne(t)+","+tab.maximum(t)+","+perte+")");
 
							try {
								int res3=stm.executeUpdate("insert into pingtable(date,heure,avg) values (now(),now(),"+avg.time()+")");
							} catch (IllegalStateException e) {
 
							} catch (IOException e) {
 
							}
 
 
 
						//cc.start();
 
 
					} catch (SQLException e) {
 
					}
 
 
 
			    }
		 }
					 timer = new Timer();
					 timer.scheduleAtFixedRate(new RemindTask(), 0, 900 * 1000);
 
 
 
 
	}
 
 
}