J
Jan Persson
Hi,
We recently upgraded our system from JDK 1.3.1 to 1.4.2_05 and now we are
experiencing strange problems in the CORBA layer connected to tnameserv.exe.
If I start a blank tnameserv.exe and run the following test program
(which basicly only connects to the naming service and then quits, in a loop)
it will only be able to do this 240 times. This means that our application
can only accept about 240 incoming connections before it crashes.
However, if I run the same code against a tnameserv.exe from JDK 1.3.1
it seems to be able to run forever.
Is this a known issue? Does anyone have a workaround?
Best Regards
//Jan Persson (Bitmine AB, Sweden)
---- code ahead ------------------------------------------------------------
import org.omg.CORBA.ORB;
import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CosNaming.NamingContext;
import org.omg.CosNaming.NamingContextHelper;
public class TestNamingService
{
public static void main(String[] args)
{
int i=0;
for(;;i++)
{
connect();
System.out.println(i);
}
}
private static void connect()
{
System.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
System.setProperty("org.omg.CORBA.ORBInitialPort", "900");
ORB orb = ORB.init(new String[] {}, null);
// get the root naming context
org.omg.CORBA.Object objRef = null;
try
{
objRef = orb.resolve_initial_references("NameService");
}
catch (InvalidName e)
{
e.printStackTrace();
}
NamingContext ncRef = NamingContextHelper.narrow(objRef);
}
}
We recently upgraded our system from JDK 1.3.1 to 1.4.2_05 and now we are
experiencing strange problems in the CORBA layer connected to tnameserv.exe.
If I start a blank tnameserv.exe and run the following test program
(which basicly only connects to the naming service and then quits, in a loop)
it will only be able to do this 240 times. This means that our application
can only accept about 240 incoming connections before it crashes.
However, if I run the same code against a tnameserv.exe from JDK 1.3.1
it seems to be able to run forever.
Is this a known issue? Does anyone have a workaround?
Best Regards
//Jan Persson (Bitmine AB, Sweden)
---- code ahead ------------------------------------------------------------
import org.omg.CORBA.ORB;
import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CosNaming.NamingContext;
import org.omg.CosNaming.NamingContextHelper;
public class TestNamingService
{
public static void main(String[] args)
{
int i=0;
for(;;i++)
{
connect();
System.out.println(i);
}
}
private static void connect()
{
System.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
System.setProperty("org.omg.CORBA.ORBInitialPort", "900");
ORB orb = ORB.init(new String[] {}, null);
// get the root naming context
org.omg.CORBA.Object objRef = null;
try
{
objRef = orb.resolve_initial_references("NameService");
}
catch (InvalidName e)
{
e.printStackTrace();
}
NamingContext ncRef = NamingContextHelper.narrow(objRef);
}
}