aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes test runs on windows, program hangs on linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "test runs on windows, program hangs on linux" Watch "test runs on windows, program hangs on linux" New topic
Author

test runs on windows, program hangs on linux

rinke hoekstra
Ranch Hand

Joined: Apr 06, 2007
Posts: 152
Hi all,

I already scheduled my essay exam, I finished the work on the code, but now I tested the program on another OS, and guess what, it hangs!!

I developed and tested on windows 2000, which worked perfect.

When testing on red hat linux however, the program hangs in the clean closing of the database (using a shutdownhook) and the server won't even start!!

1) How is this possible? I thought java was "code once, run everywhere"?

2) Will this cause me grading problems?


rinke


_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

That's an interesting question and I do want to know the cause for it .

I would say the compiled Java code can be run everywhere without having any impact on the output while running it on other OS, which is what guaranteed! But hanging is a different issue as there may be some other environmental/OS related factors contributing for it.

I am not very sure but a wild guess!
[ June 25, 2008: Message edited by: Raghavan Muthu ]

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
rinke hoekstra
Ranch Hand

Joined: Apr 06, 2007
Posts: 152
Originally posted by Raghavan Muthu:
But hanging is a different issue as there may be some other environmental/OS related factors contributing for it.


Yes, I guess you are right. It must be something environmental.

But the problem scares me quite a bit.
Jeffry Kristianto Yanuar
Ranch Hand

Joined: Oct 01, 2007
Posts: 759
Maybe that's because Windows and Linux have different Threading mechanism.
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
I agree with Jeffry, sounds like you've got a thread deadlock due to the different thread mechanisms. Windows performs time slicing where as linux will execute each thread to completion unless it leaves the running state.

Are you peforming yield in your code?

I'd suggest you check the order the threads are processed.

Jason
[ June 26, 2008: Message edited by: Jason Moors ]
 
Don't get me started about those stupid light bulbs.
 
subject: test runs on windows, program hangs on linux