這是一個非常奇怪的問題: 有時,當我嘗試啓動我的應用程序時,該進程會創建自己,但不會執行任何操作。 有時會開始。Java應用程序有時在開始時掛起
我試圖在網上看,但我沒有找到任何有用的東西。所以我想知道你們是否有同樣的問題,你是如何解決這個問題的。
PS:我試圖看到控制檯並顯示printStackTrace,但沒有任何東西。只有常客記錄,直到它掛起(在顯示任何GUI之前)。
編輯:
Here is the cmd with java -jar when it happens
And Task manager stuck at 30 000k memory
我的程序只調用:讀( 「MaxAttempts」)
public String read(String NomFonction) {
String ConfigFile = cfgfile.getPath();
try{
InputStream flux=new FileInputStream(ConfigFile);
InputStreamReader lecture=new InputStreamReader(flux);
BufferedReader buff=new BufferedReader(lecture);
String ligne;
String Fonction = null;
while ((ligne=buff.readLine())!=null){
if(ligne.contains(NomFonction + "=")) {
Fonction = ligne.split("=")[1];
}
}
buff.close();
if(!Fonction.equals(null)) {
return Fonction;
}
} catch(Exception e1) {
e1.printStackTrace();
}
return "Error";
}
無法重現。 – shmosel
這很糟糕,我們都很抱歉。但是,如果您可以發佈您的代碼和任何您遇到的錯誤,我們可以嘗試並提供幫助。 –
是啊,對不起,我編輯了帖子並添加了一些信息。 但沒有太多東西:/ – RapidEv