[jacorb-developer] Problem with the Name Service

Luca Gherardi luca.gherardi at unibg.it
Tue Jun 21 10:21:03 CEST 2011


HI all,


I'm just trying to setup a simple application by using JacOrb, but my code raises some exceptions.

I downloaded the last version, I configured the JACORB_HOME variable, I compiled the code, and I copied the configuration file.

This is the part of the code which raises the exception:

		String context_name;
		String str_name;
		String roomName = "Room4";
		context_name = "BuildingApplications/Rooms";
		
		System.setProperty("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
		System.setProperty("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton"); 
		try{
			ORB orb = ORB.init(args,System.getProperties());

			POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
			poa.the_POAManager().activate();

			org.omg.CORBA.Object room_obj = poa.servant_to_reference(new RoomImpl(roomName));

			str_name = context_name + "/" + roomName;

			NamingContextExt root = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));

			try{
				root.bind_new_context(root.to_name(context_name));
			}
			catch(AlreadyBound ab){
				// does no matter
			}
			root.bind(root.to_name(str_name), room_obj);

			orb.run();
		}catch (AlreadyBound ex) {
			System.err.println(ex);
		}catch(UserException ex){
			System.err.println(ex);
		}catch(SystemException ex){
			System.err.println(ex);
		}
	}

And this is the exception:

Jun 21, 2011 9:51:24 AM org.jacorb.config.JacORBConfiguration init
INFO: base configuration loaded from file /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/orb.properties
Jun 21, 2011 9:51:24 AM org.jacorb.config.JacORBConfiguration init
INFO: configuration jacorb loaded from file /Users/luca/Software/jacorb/etc/jacorb.properties
2011-06-21 09:51:24.979 FINE jacorb.interop.strict_check_on_tc_creation set to true
2011-06-21 09:51:24.980 INFO 
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
JacORB V 2.3.1, www.jacorb.org
	
(C) The JacORB project 27-May-2009
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2011-06-21 09:51:24.984 FINE RequestProcessorPoolFactory settings: thread_pool_min=5 thread_pool_max=20 thread_pool_shared=false
2011-06-21 09:51:24.987 FINE added ORBInitializer: org.jacorb.orb.standardInterceptors.IORInterceptorInitializer
2011-06-21 09:51:25.019 FINE defaulting to DefaultSocketFactory
2011-06-21 09:51:25.027 FINE Maximum connection threads: 1000
2011-06-21 09:51:25.027 FINE Maximum idle threads: 5
2011-06-21 09:51:25.059 INFO Property "jacorb.hashtable_class" is set to: java.util.Hashtable
2011-06-21 09:51:25.090 WARNING Warning - unknown codeset (MacRoman) - defaulting to ISO-8859-1
2011-06-21 09:51:25.090 FINE TCS set to ISO8859_1
2011-06-21 09:51:25.095 INFO InterceptorManager started with 0 Server Interceptors, 0 Client Interceptors and 1 IOR Interceptors
2011-06-21 09:51:25.138 FINE waiting for queue
2011-06-21 09:51:25.145 FINE POA RootPOA ready
2011-06-21 09:51:25.146 FINE Maximum connection threads: 1000
2011-06-21 09:51:25.146 FINE Maximum idle threads: 5
2011-06-21 09:51:25.168 FINE created org.omg.ETF.Factories: org.jacorb.orb.iiop.IIOPFactories
2011-06-21 09:51:25.176 FINE created ServerSocketFactory: org.jacorb.orb.factory.DefaultServerSocketFactory
2011-06-21 09:51:25.185 FINE Created socket listener on 0.0.0.0/0.0.0.0:60262
2011-06-21 09:51:25.205 FINE reset a previous completion call
2011-06-21 09:51:25.211 INFO oid: 
00 17 02 3D 0D 35 02 4D 01 11 37                            ...=.5.M..7
object is activated
2011-06-21 09:51:25.212 INFO Using server ID (3724331842) for transient POA
2011-06-21 09:51:25.279 INFO base configuration loaded from file /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/orb.properties
2011-06-21 09:51:25.290 INFO configuration jacorb loaded from file /Users/luca/Software/jacorb/etc/jacorb.properties
2011-06-21 09:51:25.290 FINE jacorb.interop.strict_check_on_tc_creation set to true
2011-06-21 09:51:25.291 INFO created ORBSingleton
2011-06-21 09:51:25.345 FINE Trying to resolve URL/IOR from: /Users/luca/Software/jacorb/NS_Ref
2011-06-21 09:51:25.346 FINE Error reading IOR/URL: 
    java.net.URL.<init>(
    java.net.URL.<init>(
    java.net.URL.<init>(
    org.jacorb.util.ObjectUtil.newInputStreamReader(
    org.jacorb.util.ObjectUtil.readURL(
    org.jacorb.orb.ParsedIOR.parse(
    org.jacorb.orb.ParsedIOR.<init>(
    org.jacorb.orb.ORB.string_to_object(
    org.jacorb.orb.ORB.resolve_initial_references(
    implementation.roomBooking.RoomServer.main(
2011-06-21 09:51:25.347 SEVERE Exception while converting string to object
    org.jacorb.orb.ParsedIOR.parse(
    org.jacorb.orb.ParsedIOR.<init>(
    org.jacorb.orb.ORB.string_to_object(
    org.jacorb.orb.ORB.resolve_initial_references(
    implementation.roomBooking.RoomServer.main(
2011-06-21 09:51:25.348 SEVERE Could not create initial reference for "NameService"
Please check property "ORBInitRef.NameService"
2011-06-21 09:51:25.348 FINE 
org.omg.CORBA.ORBPackage.InvalidName
UE: Room BuildingApplications/RoomsRoom4 already bound


In the configuration file I set the following properties:

ORBInitRef.NameService=file:/Users/luca/Software/jacorb/NS_Ref
jacorb.naming.ior_filename=/Users/luca/Software/jacorb/NS_Ref

First of all, which is the difference between the two?
Because I noticed that if I comment the first the exception disappear.
Anyway this is what the Name Server reports when I comment the first configuration:

2011-06-21 09:44:06.327 INFO Opened new server-side TCP/IP transport to 10.33.174.46:60055
2011-06-21 09:44:06.328 FINE GIOPConnectionManager: created new ServerGIOPConnection to 10.33.174.46:60055 (288051)
2011-06-21 09:44:06.329 FINE [0/0] creating new thread
2011-06-21 09:44:06.329 FINE [0/1] removed idle thread (job scheduled)
2011-06-21 09:44:06.331 FINE read 12 bytes from 10.33.174.46:60055
2011-06-21 09:44:06.332 FINE read 115 bytes from 10.33.174.46:60055
2011-06-21 09:44:06.332 FINE read GIOP message of size 127 from ServerGIOPConnection to 10.33.174.46:60055 (288051)
2011-06-21 09:44:06.334 FINE Received CodeSetContext. Using ISO8859_1 as TCS and UTF16 as TCSW
2011-06-21 09:44:06.335 FINE POA NameServer-POA rid: 0 opname: to_name _invoke: queuing request
2011-06-21 09:44:06.336 FINE rid: 0 opname: to_name is queued (queue size: 1)
2011-06-21 09:44:06.336 FINE rid: 0 opname: to_name trying to get a RequestProcessor
2011-06-21 09:44:06.339 FINE waiting for queue
2011-06-21 09:44:06.339 FINE rid: 0 opname: to_name starts with request processing
2011-06-21 09:44:06.339 FINE rid: 0 opname: to_name invoke incarnate on servant activator
2011-06-21 09:44:06.339 INFO oid: 
5F 72 6F 6F 74                                              _root
incarnate
2011-06-21 09:44:06.340 FINE Reading in context state from file
2011-06-21 09:44:06.464 FINE oid: 
5F 72 6F 6F 74                                              _root
servant is incarnated
2011-06-21 09:44:06.464 INFO oid: 
5F 72 6F 6F 74                                              _root
object is activated
2011-06-21 09:44:06.465 FINE rid: 0 opname: to_name invokeOperation on servant (stream based)
2011-06-21 09:44:06.466 FINE ServerRequest: reply to to_name
2011-06-21 09:44:06.467 FINE wrote 81 bytes to 10.33.174.46:60055
2011-06-21 09:44:06.467 FINE wrote GIOP message of size 81 to ServerGIOPConnection to 10.33.174.46:60055 (288051)
2011-06-21 09:44:06.467 FINE rid: 0 opname: to_name ends with request processing
2011-06-21 09:44:06.472 FINE read 12 bytes from 10.33.174.46:60055
2011-06-21 09:44:06.472 FINE read 133 bytes from 10.33.174.46:60055
2011-06-21 09:44:06.472 FINE read GIOP message of size 145 from ServerGIOPConnection to 10.33.174.46:60055 (288051)
2011-06-21 09:44:06.473 FINE POA NameServer-POA rid: 2 opname: bind_new_context _invoke: queuing request
2011-06-21 09:44:06.473 FINE rid: 2 opname: bind_new_context is queued (queue size: 1)
2011-06-21 09:44:06.473 FINE rid: 2 opname: bind_new_context trying to get a RequestProcessor
2011-06-21 09:44:06.473 FINE waiting for queue
2011-06-21 09:44:06.473 FINE rid: 2 opname: bind_new_context starts with request processing
2011-06-21 09:44:06.473 FINE rid: 2 opname: bind_new_context invokeOperation on servant (stream based)
2011-06-21 09:44:06.474 INFO New context.
2011-06-21 09:44:06.475 FINE ServerRequest: reply to bind_new_context
2011-06-21 09:44:06.475 FINE wrote 121 bytes to 10.33.174.46:60055
2011-06-21 09:44:06.476 FINE wrote GIOP message of size 121 to ServerGIOPConnection to 10.33.174.46:60055 (288051)
2011-06-21 09:44:06.476 FINE rid: 2 opname: bind_new_context ends with request processing
2011-06-21 09:44:06.802 FINE Transport to 10.33.174.46:60055: stream closed on read  < 0
2011-06-21 09:44:06.802 FINE ServerGIOPConnection to 10.33.174.46:60055 (288051): getMessage() -- COMM_FAILURE
2011-06-21 09:44:06.803 FINE ServerGIOPConnection to 10.33.174.46:60055 (288051): streamClosed()
2011-06-21 09:44:06.803 FINE ServerGIOPConnection to 10.33.174.46:60055 (288051): close()
2011-06-21 09:44:06.804 INFO Closed server-side transport to 10.33.174.46:60055
2011-06-21 09:44:06.804 FINE [1/1] job queue empty

The failure in the the lasts line makes me think that something is not working.

For completeness this is what the command line of the applications which I building reports:

Jun 21, 2011 9:54:00 AM org.jacorb.config.JacORBConfiguration init
INFO: base configuration loaded from file /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/orb.properties
Jun 21, 2011 9:54:00 AM org.jacorb.config.JacORBConfiguration init
INFO: configuration jacorb loaded from file /Users/luca/Software/jacorb/etc/jacorb.properties
2011-06-21 09:54:00.221 FINE jacorb.interop.strict_check_on_tc_creation set to true
2011-06-21 09:54:00.222 INFO 
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
JacORB V 2.3.1, www.jacorb.org
	
(C) The JacORB project 27-May-2009
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2011-06-21 09:54:00.226 FINE RequestProcessorPoolFactory settings: thread_pool_min=5 thread_pool_max=20 thread_pool_shared=false
2011-06-21 09:54:00.228 FINE added ORBInitializer: org.jacorb.orb.standardInterceptors.IORInterceptorInitializer
2011-06-21 09:54:00.240 FINE defaulting to DefaultSocketFactory
2011-06-21 09:54:00.248 FINE Maximum connection threads: 1000
2011-06-21 09:54:00.248 FINE Maximum idle threads: 5
2011-06-21 09:54:00.252 INFO Property "jacorb.hashtable_class" is set to: java.util.Hashtable
2011-06-21 09:54:00.273 WARNING Warning - unknown codeset (MacRoman) - defaulting to ISO-8859-1
2011-06-21 09:54:00.273 FINE TCS set to ISO8859_1
2011-06-21 09:54:00.279 INFO InterceptorManager started with 0 Server Interceptors, 0 Client Interceptors and 1 IOR Interceptors
2011-06-21 09:54:00.306 FINE POA RootPOA ready
2011-06-21 09:54:00.306 FINE Maximum connection threads: 1000
2011-06-21 09:54:00.306 FINE Maximum idle threads: 5
2011-06-21 09:54:00.307 FINE waiting for queue
2011-06-21 09:54:00.319 FINE created org.omg.ETF.Factories: org.jacorb.orb.iiop.IIOPFactories
2011-06-21 09:54:00.325 FINE created ServerSocketFactory: org.jacorb.orb.factory.DefaultServerSocketFactory
2011-06-21 09:54:00.332 FINE Created socket listener on 0.0.0.0/0.0.0.0:60323
2011-06-21 09:54:00.340 FINE reset a previous completion call
2011-06-21 09:54:00.342 INFO oid: 
00 17 02 3D 0E 14 49 34 01 22 3C                            ...=..I4."<
object is activated
2011-06-21 09:54:00.343 INFO Using server ID (9955292794) for transient POA
2011-06-21 09:54:00.396 INFO base configuration loaded from file /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/orb.properties
2011-06-21 09:54:00.398 INFO configuration jacorb loaded from file /Users/luca/Software/jacorb/etc/jacorb.properties
2011-06-21 09:54:00.398 FINE jacorb.interop.strict_check_on_tc_creation set to true
2011-06-21 09:54:00.398 INFO created ORBSingleton
2011-06-21 09:54:00.444 FINE Trying to resolve URL/IOR from: file:/Users/luca/Software/jacorb/NS_Ref
2011-06-21 09:54:00.463 INFO ClientConnectionManager: created new ClientGIOPConnection to 10.33.174.46:60051 (199836ed)
2011-06-21 09:54:00.463 FINE [0/0] creating new thread
2011-06-21 09:54:00.465 FINE [0/1] removed idle thread (job scheduled)
2011-06-21 09:54:00.467 FINE ClientGIOPConnection to 10.33.174.46:60051 (199836ed): will wait until connected
2011-06-21 09:54:00.473 FINE ClientGIOPConnection to 10.33.174.46:60051 (199836ed): sendMessage() -- opening transport
2011-06-21 09:54:00.473 FINE created SocketFactory: org.jacorb.orb.factory.DefaultSocketFactory
2011-06-21 09:54:00.474 FINE Trying to connect to 10.33.174.46:60051 with timeout=90000.
2011-06-21 09:54:00.480 INFO Connected to 10.33.174.46:60051 from local port 60324
2011-06-21 09:54:00.484 FINE wrote 72 bytes to 10.33.174.46:60051
2011-06-21 09:54:00.485 FINE wrote 24 bytes to 10.33.174.46:60051
2011-06-21 09:54:00.485 FINE wrote 31 bytes to 10.33.174.46:60051
2011-06-21 09:54:00.485 FINE wrote GIOP message of size 111 to ClientGIOPConnection to 10.33.174.46:60051 (199836ed)
2011-06-21 09:54:00.488 FINE read 12 bytes from 10.33.174.46:60051
2011-06-21 09:54:00.489 FINE read 69 bytes from 10.33.174.46:60051
2011-06-21 09:54:00.489 FINE read GIOP message of size 81 from ClientGIOPConnection to 10.33.174.46:60051 (199836ed)
2011-06-21 09:54:00.492 FINE wrote 145 bytes to 10.33.174.46:60051
2011-06-21 09:54:00.493 FINE wrote GIOP message of size 145 to ClientGIOPConnection to 10.33.174.46:60051 (199836ed)
2011-06-21 09:54:00.496 FINE read 12 bytes from 10.33.174.46:60051
2011-06-21 09:54:00.496 FINE read 109 bytes from 10.33.174.46:60051
2011-06-21 09:54:00.496 FINE read GIOP message of size 121 from ClientGIOPConnection to 10.33.174.46:60051 (199836ed)
org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
UE: Room BuildingApplications/RoomsRoom4 already bound

Sorry for the long mail and for posting a lot of code.
I hope someone can help me.

Best regards,
Luca



More information about the jacorb-developer mailing list