Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server crash!

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic