[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jacorb-developer
Subject:    [jacorb-developer] corba newbie needs some help!!!
From:       "Dims Stavrou" <corba_newbie () hotmail ! com>
Date:       2000-12-22 20:45:26
Message-ID: F20vdrEb6MXb0zrAXBi00000f5a () hotmail ! com
[Download RAW message or body]

Before I explain my problems let me tell you about my set-up.  I’m using
jdk1.2, jacorb1.2.3, apache1.3.12 on a Unix box called Saturn and I’m
accessing the client applet from a windows NT machine with IE5 and java
plug-in 1.2.  Source code of my Corba server, client applet,
jacorb.properties and any other messages that jacorb writes to the console
will be at the end of this post.

Now,  jacorb.properties is located at 1) my home directory, 2) where the
applet class is located and in the jar file that is downloaded from the
web-server.  The web-server and the naming service are located on the same
machine and I have placed orb.properties at JAVA_HOME/lib.

In the programming guide in the section talking about the jacorb.properties
configuration there is a mention about jacorb.NameServerURL(page 6,7) but in
my jacorb.properties file that parameter is named ORBInitRef.NameService.
Is that a different version issue or something else?  Finally, I’m not
thinking of using the appligator because as I mentioned both my web-server
and naming service along with my corba server are located on the same host.

My first problem is that when I start my corba server <jaco importServer>
everything seems to be ok for 30 seconds and then I get a connection timeout
message and the connection is closed.  I have tried to keep the time out for
longer periods through the jacorb.properties’
jacorb.connection.server_timeout but nothing worked.  For the time being I
have commented that line out.

My second problem appears when I try to connect with the ORB from my client
applet.  It initializes the orb but when it hits the
orb.resolve_initial_references(“NameService”) line it throws an exception
with following stack trace:

org.omg.CORBA.COMM_FAILURE:   minor code: 1  completed: No

	at com.sun.CORBA.iiop.ConnectionTable.get(Unknown Source)

	at com.sun.CORBA.iiop.GIOPImpl.createRequest(Unknown Source)

	at com.sun.CORBA.iiop.GIOPImpl.createRequest(Unknown Source)

	at com.sun.CORBA.idl.GenericCORBAClientSC.createRequest(Unknown Source)

	at com.sun.CORBA.idl.InitialNamingClient.resolve(Unknown Source)

	at com.sun.CORBA.idl.InitialNamingClient.cachedInitialReferences(Unknown
Source)

	at com.sun.CORBA.idl.InitialNamingClient.resolve_initial_references(Unknown
Source)

	at com.sun.CORBA.idl.ORB.resolve_initial_references(Unknown Source)

	at importApplet.init(importApplet.java:122)

	at sun.applet.AppletPanel.run(Unknown Source)

	at java.lang.Thread.run(Unknown Source)

I have researched the error and I found out that it was unable to connect to
the host and port specified in the object reference.

I would appreaciate any input you may have because I don’t know what else to
do.
Now for the code:

--My corba server code:

import test.*;
import java.sql.*;

public class importServer
{
	public static void main(String[] args)
	{
		//connect to the ORB
		org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);

		//create an instance of the implementation
		serverImp imp = new serverImp();

		try
		{
			org.omg.CORBA.Object obj = orb.resolve_initial_references("RootPOA");

			//connect to the root POA
			org.omg.PortableServer.POA poa \
org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));

			//activate POA manager
			poa.the_POAManager().activate();

			//create an object reference from the new implementation
			org.omg.CORBA.Object o = poa.servant_to_reference(imp);

			//register object reference with JacORBs naming service
			org.omg.CosNaming.NamingContextExt nc \
org.omg.CosNaming.NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
  nc.bind(nc.to_name("import.file"), o);
		}catch (Exception e){
			e.printStackTrace();
			return;
		}

		//run loop to handle requests.
		orb.run();
	}
}

*	*	*	*	*	*	*	*	*	*	*

Part of the client applet’s init method having to do with corba:

		java.util.Properties props = new java.util.Properties();
		props.setProperty("ORBInitRef.NameService","http://saturn:2123/xref/NS_Ref");
		props.setProperty("org.omg.ORBClass","jacorb.orb.ORB");
		props.setProperty("org.omg.CORBA.ORBSingletonClass","jacorb.orb.ORBSingleton");

		try
		{
			orb = org.omg.CORBA.ORB.init(this,props);
			org.omg.CORBA.Object o = orb.resolve_initial_references("NameService");

			if(o == null)
			{
				System.out.println("No name server found!");
			}

			org.omg.CosNaming.NamingContextExt nc \
org.omg.CosNaming.NamingContextExtHelper.narrow(o);

			if(nc == null)
			{
				System.out.println("Name server has incorrect type!");
			}

			importClient importInterfaceHelper.narrow(nc.resolve(nc.to_name("import.file")));
		}catch(Exception e){
			System.out.println("Unable to complete Corba connection");
			e.printStackTrace();
		}

*	*	*	*	*	*	*	*	*	*	*

My jacorb.properties file:

##
##  JacORB configuration options
##

#
# Basic ORB properties
#

# use (java) jacorb.util.CAD to generate an apropriate
# verbosity level
jacorb.verbosity=3

# where does output go? Terminal is default
#jacorb.logfile=LOGFILEPATH

# number of retries if connection cannot directly be established
jacorb.retries=5

# how many msecs. do we wait between retries
jacorb.retry_intervalP0

# size of network buffers for outgoing messages
jacorb.outbuf_size 48

# client-side timeout, set no non-zero to stop blocking
# after so many msecs.
#jacorb.connection.client_timeout=0

# max time a server keeps a connection open if nothing happens
#jacorb.connection.server_timeout`000

# IP address on multi-homed host (this gets encoded in
# object references)
#OAIAddr0.0.0.1

#
# URL where IORs are stored (used in orb.resolve_initial_service())
# DO EDIT these!

#ORBInitRef.NameService=corbaloc::160.45.110.41:38693/StandardNS/NameServer%2DPOA/_root
 ORBInitRef.NameService=http://saturn:2123/xref/NS_Ref
ORBInitRef.TradingService=http://saturn:2123/xref/TS_Ref

# JacORB-specific URLs
jacorb.ImplementationRepositoryURL=http://saturn:2123/xref/ImR_Ref
jacorb.ProxyServerURL=http://saturn:2123/xref/Appligator_Ref

# if your applets don't need appligator, switch this off
jacorb.use_appligator=off

# client-side caching of object references can turned off,
# but it should not normally as it prevents connection multiplexing
#jacorb.reference_caching=off

#
# The following property specifies the class which is used for
# reference caching. WeakHashtable uses WeakReferences, so entries
# get gc'ed if only the Hashtable has a reference to them. This
# is useful if you have many references to short-living non-persistent
# CORBA objects. It is only available for java 1.2 and above.
#
# On the other hand the standard Hashtable keeps the references until
# they are explicitely deleted by calling _release(). This is useful
# for persistent and long-living CORBA objects.
#
#jacorb.hashtable_class=jacorb.util.WeakHashtable
#
jacorb.hashtable_class=java.util.Hashtable

# Switch off to avoid contacting the ImR on every server start-up
jacorb.use_imr=off

#
# interceptor configuration. The standard interceptors should be
# used.
#
org.omg.PortableInterceptor.ORBInitializerClass.standard_init=jacorb.orb.standardInterceptors.IORInterceptorInitializer



# the implementation name, should be set to a different
# name in the code of persistent servers
jacorb.implname=StandardImplName

#
# Implementation Repository Configuration Options
#
jacorb.imr.table_file=Z:\table.dat
jacorb.imr.backup_file=z:\backup.dat
jacorb.imr.ior_file=/home/dstavrop/apps/apache/htdocs/xref/ImR_Ref
jacorb.imr.timeoutjacorb.imr.no_of_poasjacorb.imr.no_of_servers
#
# This is supposed to be a generic startup string for everything
# that calls Runtime.exec(). Might be replaced by jaco[.bat].
#
jacorb.java_exec=java -Dorg.omg.CORBA.ORBClass=jacorb.orb.ORB
-Dorg.omg.CORBA.ORBSingletonClass=jacorb.orb.ORBSingleton

#
# SSL Setup options
#

# For using SSL, this interceptor *must* be set. Otherwise, it can
# be left commented out.
#org.omg.PortableInterceptor.ORBInitializerClass.ForwardInit=jacorb.security.ssl.SecurityServiceInitializer


#
# numbers are hex values (omitting leading 0x)
#
jacorb.security.support_ssl=off
jacorb.security.ssl.supported_optionsd
jacorb.security.enforce_ssl=off
jacorb.security.ssl.required_optionsd

# files with public key certs of trusted CAs
jacorb.security.trustees=trustee1.cert,trustee2.cert

# the name of the default key alias to look up in the keystore
jacorb.security.default_user=brose
jacorb.security.default_password=jacorb

# the name and location of the keystore relative to the home directory
jacorb.security.keystore=.keystore
jacorb.security.keystore_password=jacorb

# qualified classname of access decision object
jacorb.security.access_decision=jacorb.security.level2.AccessDecisionImpl

#
# POA configuration
#

# displays a GUI monitoring tool for servers
jacorb.poa.monitoring=off

# thread pool configuration for request processing
jacorb.poa.thread_pool_max 
jacorb.poa.thread_pool_min=5

# if set, request processing threads in thePOA
# will run at this priority. If not set or invalid,
# MAX_PRIORITY will be used.
#jacorb.poa.thread_priority
# size of the request queue, clients will receive Corba.TRANSIENT
# exceptions if load exceeds this limit
jacorb.poa.queue_max0

#
# Naming Service Configuration
#
# where to store persistent naming context state?
jacorb.naming.db_dir=/home/dstavrop/apps/apache/htdocs/xref

#
# Trader configuration, please see
# src/trading/README.PROPERTIES for
# explanation
jtrader.util.max_threads
jtrader.util.min_threads=1
jtrader.util.query_timeoutP00
jtrader.impl.cache_max0

# boolean values, e.g. true / false
#jtrader.modifiable_properties#jtrader.dynamic_properties#jtrader.proxy_offers
jtrader.debugúlse
jtrader.debug_verbosity=3

#integer values
jtrader.def_search_cardjtrader.max_search_cardjtrader.def_match_cardjtrader.max_match_ \
cardjtrader.def_return_cardjtrader.max_return_cardjtrader.max_listjtrader.def_hop_countjtrader.max_hop_count
 #FollowOptions
#always=2
#if_no_local=1
#local_only=0
jtrader.def_follow_policyjtrader.max_follow_policyjtrader.max_link_follow_policy
# any other custom properties can be added here.
# These are available through the API (call
# jacorb.orb.Environment.getProperty())

*	*	*	*	*	*	*	*	*	*	*

When I start the naming service I get the following messages:
<ns ~/apps/apache/htdocs/xref/NS_Ref>

$ [ Delegate bound to 10.16.190.245:47095 ]
[ ORBInitRef NameService string: http://saturn:2123/xref/NS_Ref ]
[ Could not read from URL http://saturn:2123/xref/TS_Ref ]
############################ StackTrace ############################
java.lang.NullPointerException
        at jacorb.util.ObjectUtil.readURL(ObjectUtil.java, Compiled Code)
        at jacorb.orb.ParsedIOR.parse(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ParsedIOR.<init>(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ORB.string_to_object(ORB.java, Compiled Code)
        at jacorb.orb.ORB.initialReferencesInit(ORB.java, Compiled Code)
        at jacorb.orb.ORB.set_parameters(ORB.java, Compiled Code)
        at org.omg.CORBA.ORB.init(ORB.java, Compiled Code)
        at jacorb.naming.NameServer.main(NameServer.java, Compiled Code)
####################################################################
############################ StackTrace ############################
java.lang.NullPointerException
        at jacorb.orb.ParsedIOR.parse(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ParsedIOR.parse(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ParsedIOR.<init>(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ORB.string_to_object(ORB.java, Compiled Code)
        at jacorb.orb.ORB.initialReferencesInit(ORB.java, Compiled Code)
        at jacorb.orb.ORB.set_parameters(ORB.java, Compiled Code)
        at org.omg.CORBA.ORB.init(ORB.java, Compiled Code)
        at jacorb.naming.NameServer.main(NameServer.java, Compiled Code)
####################################################################
[ Build: jacorb.orb.standardInterceptors.IORInterceptorInitializer ]
[ InterceptorManager started with 0 SIs, 0 CIs and 1 IORIs ]
[ no initial map policy defined. Defining default initial map policy ]
[ POA RootPOA - ready ]
[ no initial map policy defined. Defining default initial map policy ]
[ POA NameServer-POA - ready ]
[ Invoking IORInterceptor CodeSetInfoComponentCreator ]
[ CodeSetInfoCreator added TaggedComponent to TAG_INTERNET_IOP profile ]
[ Delegate bound to 10.16.190.245:48091 ]
[ Poa.getReference: a new IDL:omg.org/PortableServer/ServantActivator:1.0 ]
[ Invoking IORInterceptor CodeSetInfoComponentCreator ]
[ CodeSetInfoCreator added TaggedComponent to TAG_INTERNET_IOP profile ]
[ Delegate bound to 10.16.190.245:48091 ]
[ Poa.getReference: a new IDL:omg.org/CosNaming/NamingContextExt:1.0 ]
[ NS up ]

*	*	*	*	*	*	*	*	*	*	*

When I start my server I get the following messages:
<jaco importServer>

[ Delegate bound to 10.16.190.245:48091 ]
[ ORBInitRef NameService string: http://saturn:2123/xref/NS_Ref ]
[ Could not read from URL http://saturn:2123/xref/TS_Ref ]
############################ StackTrace ############################
java.lang.NullPointerException
        at jacorb.util.ObjectUtil.readURL(ObjectUtil.java, Compiled Code)
        at jacorb.orb.ParsedIOR.parse(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ParsedIOR.<init>(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ORB.string_to_object(ORB.java, Compiled Code)
        at jacorb.orb.ORB.initialReferencesInit(ORB.java, Compiled Code)
        at jacorb.orb.ORB.set_parameters(ORB.java, Compiled Code)
        at org.omg.CORBA.ORB.init(ORB.java, Compiled Code)
        at importServer.main(importServer.java, Compiled Code)
####################################################################
############################ StackTrace ############################
java.lang.NullPointerException
        at jacorb.orb.ParsedIOR.parse(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ParsedIOR.parse(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ParsedIOR.<init>(ParsedIOR.java, Compiled Code)
        at jacorb.orb.ORB.string_to_object(ORB.java, Compiled Code)
        at jacorb.orb.ORB.initialReferencesInit(ORB.java, Compiled Code)
        at jacorb.orb.ORB.set_parameters(ORB.java, Compiled Code)
        at org.omg.CORBA.ORB.init(ORB.java, Compiled Code)
        at importServer.main(importServer.java, Compiled Code)
####################################################################
[ Build: jacorb.orb.standardInterceptors.IORInterceptorInitializer ]
[ InterceptorManager started with 0 SIs, 0 CIs and 1 IORIs ]
after orb init
after serverImp
[ no initial map policy defined. Defining default initial map policy ]
[ POA RootPOA - ready ]
after resolve initial references
after RootPOA
after POAManager activate
[ Invoking IORInterceptor CodeSetInfoComponentCreator ]
[ CodeSetInfoCreator added TaggedComponent to TAG_INTERNET_IOP profile ]
[ Delegate bound to 10.16.190.245:48163 ]
[ Poa.getReference: a new IDL:test/importInterface:1.0 ]
after object reference
after nc
[ New connection to 10.16.190.245:48091 ]
[ Incoming GIOP Request ]
[ Accepted connection from 10.16.190.245:48164 ]
[ POA NameServer-POA - rid: 0 oid: _root opname: to_name - is queued (queue
size: 1) ]
[ POA NameServer-POA - rid: 0 oid: _root opname: to_name - trying to get a
RequestProcessor ]
[ POA NameServer-POA - rid: 0 oid: _root opname: to_name - invoke incarnate
on servant activator ]
[ No naming context state, starting empty ]
[ Invoking IORInterceptor CodeSetInfoComponentCreator ]
[ CodeSetInfoCreator added TaggedComponent to TAG_INTERNET_IOP profile ]
[ Delegate bound to 10.16.190.245:48091 ]
[ Poa.getReference: a new IDL:omg.org/CosNaming/NamingContextExt:1.0 ]
[ POA NameServer-POA - oid: _root - servant is incarnated ]
[ POA NameServer-POA - rid: 0 oid: _root opname: to_name - invoke operation
on servant (stream based) ]
[ POA NameServer-POA - rid: 0 oid: _root opname: to_name - ends with request
processing ]
[ POA NameServer-POA - rid: 1 oid: _root opname: bind - is queued (queue
size: 1) ]
[ POA NameServer-POA - rid: 1 oid: _root opname: bind - trying to get a
RequestProcessor ]
[ POA NameServer-POA - rid: 1 oid: _root opname: bind - invoke operation on
servant (stream based) ]
[ Delegate bound to 10.16.190.245:48163 ]
[ Bound name: import.file ]
[ POA NameServer-POA - rid: 1 oid: _root opname: bind - ends with request
processing ]
after nc bind
Just loaded Oracle driver.

After 30 seconds I get the following message:


[ Connection timed out ]
[ Connection to 10.16.190.245:48164 aborting... ]
[ Closing connection to 10.16.190.245:48164 ]
[ Closing connection to 10.16.190.245:48164 (sockets closed) ]
[ Connection to 10.16.190.245:48091 aborting... ]
############################ StackTrace ############################
java.io.EOFException
        at jacorb.orb.Connection.abort(Connection.java, Compiled Code)
        at jacorb.orb.Connection.readBuffer(Connection.java, Compiled Code)
        at jacorb.orb.Connection.receiveReply(Connection.java, Compiled
Code)
        at jacorb.orb.ReplyReceptor.run(ReplyReceptor.java, Compiled Code)
####################################################################
[ Closing connection to 10.16.190.245:48091 ]

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic