aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Server crash! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Server crash!" Watch "Server crash!" New topic
Author

Server crash!

Chris Popz
Greenhorn

Joined: Feb 19, 2007
Posts: 14
Hi:

I have problems starting my server. Sometimes it starts, but most often it crashes after entering the db location.
Is there anyone who has experienced the same thing?

(The server start-up seems to work the very first time after rebooting my computer, but then it just crashes)
Abdel Kader
Greenhorn

Joined: Apr 14, 2007
Posts: 11
I have experienced a similar problem at work (not in my SCJD assignment). The problem was related to file-descriptors so I will have to ask you how you read the database file?
One single file object for all operations on the db-file?
Input streams, RAF?
Proper use of flush and close in finally?
Is it threadsafe? Try for example using only one client and see if the problem persists.
Is the crash random or does it always happen at the exact same line in your code?
Chris Popz
Greenhorn

Joined: Feb 19, 2007
Posts: 14

Hi Abdel:
I have experienced a similar problem at work (not in my SCJD assignment). The problem was related to file-descriptors so I will have to ask you how you read the database file?
One single file object for all operations on the db-file?
Input streams, RAF?
Proper use of flush and close in finally?
Is it threadsafe? Try for example using only one client and see if the problem persists.
Is the crash random or does it always happen at the exact same line in your code?

I'm using a single RAF instance. I'm currently not using the close() method, but as it work in standalone mode, I'm doubting that this is the source of error (No exceptions either). Yes - the crash always happen at the exact same in line in my code. The crash occurs before connecting any clients to the server...
Abdel Kader
Greenhorn

Joined: Apr 14, 2007
Posts: 11
In that case im out of ideas :-(. Are you sure you get no exceptions at all?! In that case I wonder how it crashes? If the crash occurs before connecting any clients, your server should be more or less identical to the standalone before the crash. What exactly is it you are doing on that line where the server crashes? Try surronding it with try/catch(Throwable) and print any stacktrace...
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 918

can you post us the system tray and/or a code snippet


SCJP, SCJD, SCWCD, OCPJBCD
Chris Popz
Greenhorn

Joined: Feb 19, 2007
Posts: 14
Hi:

I solved it!
When the server crashed I used UnicastRemoteObject.exportObject(remoteObject).
Now, my remote object extends UnicastRemoteObject, and that solved it!
I don't understand why, since I've heard that the two options solve the same thing...(?)

Thanks for the help anyway!

/Regards Christian
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server crash!