-1

I have an executable jar which I am running on server (all kinds of OS). While running this jar, it got stuck at a point and not moving further from past 16 hrs. There are no visible exceptions in the log file. Also all the loops are proper. In one server instance, it is generating correct output. But in some server instance it is stuck. All the loops and methods are properly terminated. As it is giving proper output in one instance. My question is:

  1. Is it possible that the jar could be the reason for execution to be stuck?

  2. If yes, what can be the possible reasons for the jar to cause this scenario?

I'm out of reasons here, and trying to figure out what could be wrong. My jar is of version 1.4 and OS can be of any version 1.4 and above.

  1. Is it possible that the version difference could have caused the execution to be stuck?

PS: My question may not be useful to others but I really need your help. So please give your suggestions.

Edit: I'm using System.out.println to maintain a log file. Can that cause the jar to be stuck?

Harshita Sethi
  • 2,035
  • 3
  • 24
  • 46
  • Deadlock. wheres the code? – WalterM Dec 24 '15 at 05:36
  • null pointer exception – Kumaresan Perumal Dec 24 '15 at 05:37
  • @KumaresanPerumal There are no exceptions visible in the log file. If some exception would come it will report it right? – Harshita Sethi Dec 24 '15 at 05:41
  • 2
    You actually waited 16 hours?! I guess if you get paid hourly, it's cool. Just don't let your employer see this post :-) – Paul Samsotha Dec 24 '15 at 05:43
  • @WalterM The code is working perfectly in one instance, I just need to know the possible reasons that could have caused stuck. The code is very lengthy and huge, that's why I didn't pasted it here. – Harshita Sethi Dec 24 '15 at 05:43
  • @peeskillet Its running in the server and from past 16 hours there is no activity. I don't need to sit and wait, just need to monitor the status after some hours :) – Harshita Sethi Dec 24 '15 at 05:44
  • Did you write the stack trace of exception to the log file (maybe in your catch block)? – Atri Dec 24 '15 at 06:02
  • @ashutosh yes,, the log file will give exactly the same data what console gives. – Harshita Sethi Dec 24 '15 at 06:05
  • It is possible that the process is stuck on an I/O operation of a file or waiting on a DB connection. Try doing an `strace -p ` on the process id. – Atri Dec 24 '15 at 06:08
  • @ashutosh Can you please explain which process Id, I should write this command? Also won't it give any exception for I/O operation or DB connection error? – Harshita Sethi Dec 24 '15 at 06:11
  • If you have access to the server, login to the box and try the command. Its a unix command. It might not give any exception if it is waiting on a file or db, depending on if there is a timeout set and how long it is. – Atri Dec 24 '15 at 06:13
  • @ashutosh I got this as output. `Process 6648 attached - interrupt to quit wait4(-1,` I dont know what it means. :/ – Harshita Sethi Dec 24 '15 at 08:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/98922/discussion-between-ashutosh-and-harshita-sethi). – Atri Dec 24 '15 at 15:30
  • People please help me.. :( How can I debug what part is causing the jar to get stuck? – Harshita Sethi Dec 29 '15 at 17:56
  • Try following the instructions at http://stackoverflow.com/q/10756105/1542723 to get a thread stacktrace, so you can follow the path to the stuck loop/code. After you found it, edit the post to include the non working code and the stacktrace. – Ferrybig Jan 06 '16 at 11:59

1 Answers1

-1

It might be because of some invalid inputs ( if program requires inputs ). If it is try different inputs.

  • If there are some invalid inputs, won't it give exception? – Harshita Sethi Dec 24 '15 at 05:59
  • Sure. But sometimes execution stops. –  Dec 24 '15 at 06:01
  • But in the console stack trace would be printed. Exception cause will be printed. But in my case there is no exception stack trace in the log file(generated from console data). Even on the server, the command to run the script is not terminated. That means the script is still running. – Harshita Sethi Dec 24 '15 at 06:04
  • Are there any string data types ? –  Dec 24 '15 at 06:05
  • Yes there are.. Can they be reason? If yes, what can they do? – Harshita Sethi Dec 24 '15 at 06:06
  • If there are Strings those variables or fields are seriously case sensitive please check it out. –  Dec 24 '15 at 06:09
  • 1
    The code is running fine for one server but not for others... even if the Strings are case sensitive, how can they cause the jar to be stuck. – Harshita Sethi Dec 24 '15 at 06:17