Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / CORBA / June 2006

Tip: Looking for answers? Try searching our database.

SunORB in Java 1.5.0 buggy?

Thread view: 
Ole Streicher - 20 Jun 2006 08:45 GMT
Hi Group,

after switching to Java 1.5.0 I observe a lot of problems in using
Corba (SUN Orb) between different machines. If both end are on the
same machine, everything seems OK.

One of the problems what I see is that a very simple call sometimes
does not return at all; one of my calls is just an (IDL)

boolean ping();

which is implemented in Java as

public boolean ping() {
 return true;
}

If this method is called with server and client being on different
machines, I see sometimes the following lines on stdout of the server
side (the side that implements ping()):

19.06.2006 14:12:27 com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl readFully
WARNUNG: "IOP00410215: (COMM_FAILURE) Read of full message failed : bytes requested = 1.012 bytes read = 700 max wait time = 3.000 total time spent waiting
= 3.190"
org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 215  completed: No
       at com.sun.corba.se.impl.logging.ORBUtilSystemException.transportReadTimeoutExceeded(Unknown Source)
       at com.sun.corba.se.impl.logging.ORBUtilSystemException.transportReadTimeoutExceeded(Unknown Source)
       at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.readFully(Unknown Source)
       at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.read(Unknown Source)
       at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.readGIOPBody(Unknown Source)
       at com.sun.corba.se.impl.transport.CorbaContactInfoBase.finishCreatingMessageMediator(Unknown Source)
       at com.sun.corba.se.impl.transport.SocketOrChannelAcceptorImpl.finishCreatingMessageMediator(Unknown Source)
       at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.finishReadingBits(Unknown Source)
       at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(Unknown Source)
       at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(Unknown Source)

The client side blocks here completely. The network connection between
server and client is ideal: no switches etc. between them -- a direct
100 MBit connection. Testing the connection with standard tools shows
zero package loss.

The ORB used here is the SUN Orb tha comes with 1.5.0, the OS is Linux
on server and on client.

What is the cause of the problem and how it can be solved? Is the Sun
ORB really that bad or do I something wrong?

Ciao

Ole
Ole Streicher - 20 Jun 2006 10:46 GMT
Hi again,

I made a small example that shows the problem. When running server and
client on different computers, there are exceptions observed after a
while; sometimes connected with a lock on server side.

The example consists of 3 files, the IDL, the server and the client:

MyT.idl:
----------------------------------------------------------------
interface MyT {
 long ping(in wstring s);
};
----------------------------------------------------------------

MyTServer.java:
----------------------------------------------------------------
import org.omg.CORBA.ORB;
import org.omg.CosNaming.*;
import org.omg.PortableServer.*;

class MyTServer extends MyTPOA {
 int i = 0;
 public int ping(String s) {
   return ++i;
 }

 public static void main(String[] args) {
   try {
     ORB orb = ORB.init(args, System.getProperties());
     POA rootPOA= POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
     rootPOA.the_POAManager().activate();
     org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
     NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
     MyTServer m = new MyTServer();
     MyT href = MyTHelper.narrow(rootPOA.servant_to_reference(m));
     NameComponent path[] = {new NameComponent("MyT", "MyT")};
     ncRef.rebind(path, href);
     Object o = new Object();
     synchronized (o) { o.wait(); }
   } catch (Throwable e) {
     e.printStackTrace();
   }
 }
}
----------------------------------------------------------------

MyTClient.java:
----------------------------------------------------------------
import org.omg.CORBA.ORB;
import org.omg.CosNaming.*;

class MyTClient {
 public static void main(String[] args) {
   try {
     ORB orb = ORB.init(args, System.getProperties());
     org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
     NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
     NameComponent path[] = { new NameComponent("MyT", "MyT") };
     MyT m = MyTHelper.narrow(ncRef.resolve(path));
     StringBuffer sb = new StringBuffer();
     for (long i = 0; true; i++) {
       sb.append(".");
       System.out.println("ping("+i+")="+m.ping(s.toString()));
     }
   } catch (Throwable e) {
     e.printStackTrace();
   }
 }
}
----------------------------------------------------------------


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.