[omniORB] Nameservice problem, Java Client ,C++ server

Huang Guosheng huanggs at startimes.com.cn
Thu Aug 11 03:29:27 BST 2005


hello ,
         I rewrite the client program of echo example with java,but it report some errors.
  here is my step. both the client and server progam run in the same machine.
     1. star Namer service.
      [root at redhat omniNameDir]# omniNames
omniORB: Distribution date: Thu Apr 14 17:19:57 BST 2005 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 192.168.18.249
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) =
omniORB:   DefaultInitRef (args) =
omniORB:   InitRef = NameService=corbaname::192.168.18.249
omniORB:   abortOnInternalError = 0
omniORB:   acceptBiDirectionalGIOP = 0
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 0
omniORB:   endPoint = giop:tcp::2809
omniORB:   endPointPublishAllIFs = 0
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   inConScanPeriod = 180
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 5
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 100
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 0
omniORB:   omniORB_27_CompatibleAnyExtraction = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 120
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   strictIIOP = 1
omniORB:   supportBootstrapAgent = 1
omniORB:   supportCurrent = 1
omniORB:   supportPerThreadTimeOut = 0
omniORB:   tcAliasExpand = 0
omniORB:   threadPerConnectionLowerLimit = 9000
omniORB:   threadPerConnectionPolicy = 1
omniORB:   threadPerConnectionUpperLimit = 10000
omniORB:   threadPoolWatchConnection = 1
omniORB:   traceExceptions = 1
omniORB:   traceInvocations = 0
omniORB:   traceLevel = 25
omniORB:   traceThreadId = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: Initialising incoming endpoints.
omniORB: Bind to address 0.0.0.0.
omniORB: Starting serving incoming endpoints.
omniORB: Adding key<NameService> (activating) to object table.
omniORB: State key<NameService> (activating) -> active
omniORB: Adding root/<ca1c1841010007f4/0> (activating) to object table.
omniORB: State root/<ca1c1841010007f4/0> (activating) -> active
omniORB: Creating ref to local: key<NameService>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Creating ref to local: root/<ca1c1841010007f4/0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: AsyncInvoker: thread id = 1 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:192.168.18.249:2809
omniORB: ObjRef(IDL:omg.org/CosNaming/NamingContextExt:1.0) -- deleted.
omniORB: Creating ref to local: root/<ca1c1841010007f4/0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: Creating ref to remote: root<0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:Echo:1.0
omniORB: ObjRef(IDL:omg.org/CosNaming/NamingContextExt:1.0) -- deleted.

Wed Aug 11 09:43:52 2004:

Read log file successfully.
omniORB: Creating ref to local: key<NameService>
 target id      : IDL:omg.org/CosNaming/NamingContextExt:1.0
 most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000064000000010102000f0000003139322e3136382e31382e3234390000f90a00000b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100

Wed Aug 11 09:43:53 2004:

Checkpointing Phase 1: Prepare.
omniORB: createLocalObjRef -- reusing reference from local ref list.
omniORB: createLocalObjRef -- reusing reference from local ref list.
Checkpointing Phase 2: Commit.
Checkpointing completed.
 2. as to ther server side, its code is identical to eg3_impl.cc. I change nothing.
    star the server 
[root at redhat echo]# ./eg3_clt
omniORB: Distribution date: Thu Apr 14 17:19:57 BST 2005 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 192.168.18.249
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) =
omniORB:   DefaultInitRef (args) =
omniORB:   InitRef = NameService=corbaname::192.168.18.249
omniORB:   abortOnInternalError = 0
omniORB:   acceptBiDirectionalGIOP = 0
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 0
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublishAllIFs = 0
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   inConScanPeriod = 180
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 5
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 100
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 0
omniORB:   omniORB_27_CompatibleAnyExtraction = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 120
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   strictIIOP = 1
omniORB:   supportBootstrapAgent = 1
omniORB:   supportCurrent = 1
omniORB:   supportPerThreadTimeOut = 0
omniORB:   tcAliasExpand = 0
omniORB:   threadPerConnectionLowerLimit = 9000
omniORB:   threadPerConnectionPolicy = 1
omniORB:   threadPerConnectionUpperLimit = 10000
omniORB:   threadPoolWatchConnection = 1
omniORB:   traceExceptions = 1
omniORB:   traceInvocations = 0
omniORB:   traceLevel = 25
omniORB:   traceThreadId = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: Creating ref to remote: key<NameService>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id:
omniORB: Initial reference `NameService' resolved from configuration file.
omniORB: Client attempt to connect to giop:tcp:192.168.18.249:2809
omniORB: Client opened connection to giop:tcp:192.168.18.249:2809
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 100 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 25 bytes
omniORB: Creating ref to remote: key<NameService>
 target id      : IDL:omg.org/CosNaming/NamingContext:1.0
 most derived id:
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 111 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 160 bytes
omniORB: Creating ref to remote: root<0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:Echo:1.0
omniORB: ObjRef() -- deleted.
omniORB: LocateRequest to remote: root<0>
omniORB: Client attempt to connect to giop:tcp:192.168.18.249:32774
omniORB: Client opened connection to giop:tcp:192.168.18.249:32774
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 38 bytes
omniORB: AsyncInvoker: thread id = 1 has started. Total threads = 1
omniORB: Scavenger task execute.
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 20 bytes
omniORB:  send codeset service context: (ISO-8859-1,UTF-16)
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 99 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: sendChunk: to giop:tcp:192.168.18.249:32774 75 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:32774 35 bytes
I said, "Hello!".
The Echo object replied, "Hello!".
omniORB: Preparing to shutdown ORB.
omniORB: Disable ObjRef(IDL:Echo:1.0) root<0>
omniORB: omniRemoteIdentity deleted.
omniORB: Disable ObjRef() key<NameService>
omniORB: omniRemoteIdentity deleted.
omniORB: 2 object references present at ORB shutdown.
omniORB: ORB shutdown is complete.
omniORB: ObjRef() -- deleted.
omniORB: Client connection refcount (forced) = 0
omniORB: Client close connection to giop:tcp:192.168.18.249:32774
omniORB: Client connection refcount (forced) = 0
omniORB: Client close connection to giop:tcp:192.168.18.249:2809
omniORB: 0 remaining bidir ropes deleted.
omniORB: 2 remaining ropes deleted.
omniORB: Clear endPoint options.
omniORB: AsyncInvoker: thread id = 1 has exited. Total threads = 1
omniORB: AsyncInvoker: deleted.
omniORB: ObjRef(IDL:Echo:1.0) -- deleted.
omniORB: No more references to the ORB -- deleted.
omniORB: Final clean-up
omniORB: Deleted 2 nil object references and 0 other tracked objects.
omniORB: Final clean-up completed.
[root at redhat echo]# ./eg3_impl
omniORB: Distribution date: Thu Apr 14 17:19:57 BST 2005 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 192.168.18.249
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1) ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) =
omniORB:   DefaultInitRef (args) =
omniORB:   InitRef = NameService=corbaname::192.168.18.249
omniORB:   abortOnInternalError = 0
omniORB:   acceptBiDirectionalGIOP = 0
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 0
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublishAllIFs = 0
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   inConScanPeriod = 180
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 5
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 100
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 0
omniORB:   omniORB_27_CompatibleAnyExtraction = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 120
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   strictIIOP = 1
omniORB:   supportBootstrapAgent = 1
omniORB:   supportCurrent = 1
omniORB:   supportPerThreadTimeOut = 0
omniORB:   tcAliasExpand = 0
omniORB:   threadPerConnectionLowerLimit = 9000
omniORB:   threadPerConnectionPolicy = 1
omniORB:   threadPerConnectionUpperLimit = 10000
omniORB:   threadPoolWatchConnection = 1
omniORB:   traceExceptions = 1
omniORB:   traceInvocations = 0
omniORB:   traceLevel = 25
omniORB:   traceThreadId = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: Initialising incoming endpoints.
omniORB: Bind to address 0.0.0.0.
omniORB: Starting serving incoming endpoints.
omniORB: Adding root<0> (activating) to object table.
omniORB: State root<0> (activating) -> active
omniORB: Creating ref to local: root<0>
 target id      : IDL:Echo:1.0
 most derived id: IDL:Echo:1.0
IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000068000000010102000f0000003139322e3136382e31382e3234390000168000000e000000fe417a194100000f75000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: Creating ref to remote: key<NameService>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id:
omniORB: Initial reference `NameService' resolved from configuration file.
omniORB: Client attempt to connect to giop:tcp:192.168.18.249:2809
omniORB: Client opened connection to giop:tcp:192.168.18.249:2809
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 100 bytes
omniORB: AsyncInvoker: thread id = 1 has started. Total threads = 2
omniORB: giopRendezvouser task execute for giop:tcp:192.168.18.249:32790
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 25 bytes
omniORB: Creating ref to remote: key<NameService>
 target id      : IDL:omg.org/CosNaming/NamingContext:1.0
 most derived id:
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 99 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 81 bytes
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 87 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 188 bytes
omniORB: Creating ref to remote: root/<ca1c1841010007f4/0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:omg.org/CosNaming/NamingContextExt:1.0
omniORB: LocateRequest to remote: root/<ca1c1841010007f4/0>
omniORB: Client attempt to connect to giop:tcp:192.168.18.249:2809
omniORB: Client opened connection to giop:tcp:192.168.18.249:2809
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 38 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 20 bytes
omniORB:  send codeset service context: (ISO-8859-1,UTF-16)
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 244 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 81 bytes
omniORB: sendChunk: to giop:tcp:192.168.18.249:2809 228 bytes
omniORB: inputMessage: from giop:tcp:192.168.18.249:2809 24 bytes
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef(IDL:omg.org/CosNaming/NamingContextExt:1.0) -- deleted.
omniORB: ObjRef() -- deleted.

4, then I begin start the client,
  this is the client code:


import org.omg.CosNaming.*;
import org.omg.CORBA.*;
public class EchoClient 
{
    public static void main(String args[])
    {
	try{
		String SetInfo,ReturnInfo,ref;
		org.omg.CORBA.Object objRef;
        Echo EchoRef;
		ORB orb = ORB.init(args, null);

           objRef = orb.resolve_initial_references("NameService");
            NamingContext ncRef = NamingContextHelper.narrow(objRef);
            // locate the service
            NameComponent nc = new NameComponent("Echo", "");
            NameComponent path[] = {nc};
EchoRef = EchoHelper.narrow(ncRef.resolve(path));


		    if (args.length>1)
		       {
    			 SetInfo=args[1];
		    	}
             else
		       {
				  
	        	}
				System.out.println("Client Process Begin: ");
				ReturnInfo = EchoRef.echoString("my corba test");
				System.out.println(ReturnInfo);
	} catch (Exception e) {
	    System.out.println("ERROR : " + e) ;
	}
    }
}


   in the console ,
      i typeed java EchoClient :
[root at redhat corba]# java EchoClient
ERROR : org.omg.CORBA.INTERNAL:   vmcid: SUN  minor code: 208  completed: No
then I met the errors above, could anyone give me some advice?
thanks a lot!
Best regards
Simon
    





More information about the omniORB-list mailing list