• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server crash!

 
Chris Popz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post us the system tray and/or a code snippet
 
Chris Popz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic