473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Creating a long-running RMI server

I want to create a long-running RMI server, which makes an object
available to remote hosts, and does nothing else. However, the server
consistently exists with no exception or error after >=60 seconds.
Without waiting on a dummy object or going into a sleep loop, how can I
prevent my server from exiting?

Here's my code:
RemoteInterface.java:
public interface RemoteInterface extends java.rmi.Remote
{
public String doRequest() throws java.rmi.RemoteException;
}

RMIServer.java
import java.rmi.*;
import java.rmi.server.*;

public class RMIServer extends UnicastRemoteObject implements
RemoteInterface
{
public RMIServer() throws RemoteException
{
super();
}

public String doRequest()
{
System.out.println("executing");
return "done";
}

public static void main(String[] args)
{
try {
// create a remote object and register it
RMIServer obj = new RMIServer();
Naming.rebind("rmi://localhost:1099/object", obj);
}

// throws if the URL to the rmiregistry is invalid
catch (java.net.MalformedURLException e) {
System.err.println("Malformed URL: " + e);
}
catch (RemoteException e) {
System.err.println("RMI error: " + e);
}
}
}

I've tested this with Sun's Java 1.5 and 1.4.2 SDKs, with the same
results.

Rennie
Jul 17 '05 #1
0 1674

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Galina | last post by:
Hello I am trying to create a table, which includes a field type LONG. The wizard hasn't allowed me to enter storage settings for this table. It set the initial size is 64K and not available to...
6
by: Dim St Thomas | last post by:
I am a developer working on a database client program. I am testing this program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk) This machine has Oracle 9.2.0.1.0 and RedBrick...
0
by: James Fortune | last post by:
Here is an example of Access creating a single page PDF file. The text in the textbox is scaled to fit horizontally into a grey box 100 pixels wide that is fontsize pixels high. Clicking the...
0
by: musicloverlch | last post by:
I used to be able to create PDFs, automatically save them to a file, and mail them out to people. This was on Access 97 with Windows NT. We've changed to Windows XP and Access 2003. Doesn't work...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
7
by: Digital Puer | last post by:
I'd like to be able to create an integer from a range of contiguous bits in another integer. I'm on a big-ending machine, in case that matters. I would ideally like to create a function with this...
13
by: Jo | last post by:
Hi. I'm getting the following error when creating a table with 250 columns .. I have tried creating it in a 32K tablespace , still the same issue. Is this a limitation in DB2? I am using DB2...
2
by: Steve555 | last post by:
Hi, I'm creating an object CSub, which is sub-classed from CMaster. The constructor for either takes a struct as an argument: CSub:: CSub(BasicModel *inModel : CMaster(inModel) and this...
3
by: Bartholomew Simpson | last post by:
I am writing some C++ wrappers around some legacy C ones - more specifically, I am providing ctors, dtors and assignment operators for the C structs. I have a ton of existing C code that uses...
2
by: oswald.harry | last post by:
hi i am reading a set of jpeg files(RGB) and extracts the pixel values as longs.i want to create a 2d array with numof rows=numof images and numof cols=numof pixels in each image.ie each row of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.