tcsh and java: script stuck

A

anuttka

I have simple tcsh script that executes my java program many times
(about 2000 ech time).
I need it for testing.

After about 300-500 times the script stuck.
I added some printing to stdout, and I find that script stuck, when I
am trying to execute java program, but it never reaches first line at
the main menthod.


I thought maybe the problem at my program, and instead my program I
use this one

public class Untitled1 {
public static void main(String[] args) {
System.out.println("inside java");
}
}

Still, the script is stuck and "inside java" dosen't print.But I get
line thats prints before executing java

when I print ps I get this:

2026 pts/6 00:00:00 bash
8910 pts/6 00:00:00 try.tcsh
17398 pts/6 00:00:00 java
17399 pts/6 00:00:00 java <defunct>
17400 pts/6 00:00:00 java
17401 pts/6 00:00:00 java
17402 pts/6 00:00:00 java
17410 pts/6 00:00:00 java
17411 pts/6 00:00:00 java
32731 pts/6 00:00:00 ps


Any ideas? I can't run test over night because of it.
Thanks in advance
Anna
 
K

Karsten Wutzke

anuttka said:
I added some printing to stdout, and I find that script stuck, when I
am trying to execute java program, but it never reaches first line at
the main menthod.
Any ideas? I can't run test over night because of it.
Thanks in advance
Anna

I bet there's an error in the way you try to startup your java program.
Can you show us the command line that gets executed, like

java -cp build com.bla.Main or anything?

Chances are, that the Java runtime can't find the class you specify, so
an exception might be thrown.

Karsten
 
N

Noel

Any ideas? I can't run test over night because of it.
Thanks in advance
Anna

What happens when you run Java outside of the script? Does it give you
any error messages?
 
A

anuttka

Can you show us the command line that gets executed

java -classpath /home/anna/int10 Untitled1
Chances are, that the Java runtime can't find the class you specify, so
an exception might be thrown.

As I told before it runs for about 300 execution ok and then stuck.
No Exception is thrown.
What happens when you run Java outside of the script? Does it give you
any error messages?

No error messages
 
T

Thomas Schodt

anuttka said:
I have simple tcsh script that executes my java program many times
(about 2000 each time).
I need it for testing.

After about 300-500 times the script gets stuck.
I thought maybe the problem at my program, and instead my program I
use this one

public class Untitled1 {
public static void main(String[] args) {
System.out.println("inside java");
}
}

Still, the script is stuck and "inside java" doesn't print. But I get
the line that's printed before executing java

I am not able to reproduce. I compiled your Untitled1.java
and wrote a small tcsh script.

[code:try.tcsh]
#!/usr/bin/tcsh

setenv I 1
while ( $I < 2000 )
java Untitled1
echo $I `ps|wc -l`
setenv I `echo "$I + 1" | bc`
end
[/code]

It runs to the end (1999 iterations).

OS
$ uname -srv
SunOS 5.8 Generic_108528-13

SDK
$ javah -version
javah version "1.4.1_02"

JRE
$ java -version
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
 
A

anuttka

I run the program on the cluster.
I talk to our sysadmin and he said that its problem with load balance.
If the balancing is performed during loading java, the java program stack.
But he not sure

I solved the problem by inserting the loop into the java

Thanks to everybody
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top