[jacorb-developer] Charset negotiation error in multiple threads with JacORB 3.9

Gotthard Witsch Gotthard.Witsch at ith-icoserve.com
Wed Jan 17 11:27:05 CET 2018


Hello JacOrb Team,

I am facing a problem with JacORB 3.9 when sending multiple requests in parallel threads. Especially if there are more than 10 threads, sending requests to the same CORBA endpoint.
After analyzing the problem I figured out that JacORB does not negotiate the correct codeset with the server. There is no request send for codeset negotiation at all! Therefore our CORBA server defaults to the ISO-8859 encoding, however JacORB does work with UTF-8. As the result we get invalid content.

My code does send three requests to the server:
1. Establish a connection to the NamingService
2. Receive the CORBA object named TenantManger
3. Call a method on the CORBA object and read the received data.

Each thread does execute these three steps. I downloaded the source code for JacORB 3.9 and added some logging statements.
These statements definitely show that the encoding is negotiated for the first two requests. However the third request does not negotiate the encoding for the used client connection.

Debugging the JacORB source code led me to the org.jacorb.orb.Delegate and org.jacorb.orb.giop.ClientConnectionManager class, that are responsible for retrieving the connection to the CORBA server.
Unfortunately I could not find any obvious bugs in those classes. I also had a look at the class org.jacorb.orb.giop.RequestOutputStream and its write_to method, but could not find any bugs neither. I added logging  statements to the write_to method, but the block for negotiating the codeset is not executed on the third request.

Has anyone got a clue, what is causing the error? Or do I miss some important configuration?
If I just use 5 threads, for example, everything is fine. When I increase the number of threads it starts causing the described error. At about 10 threads it's failing all the time.

My JacORB configuration is the following:

props.put("ORBInitRef.NameService", "corbaloc:iiop:" + host + ":" + port + "/NameService");
props.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
props.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");

// Charset properties
props.put("jacorb.codeset", "on");

// Turn on SSL support
props.put("jacorb.security.support_ssl", "on");

// Read certificates from key store (not from trust store)
props.put("jacorb.security.jsse.trustees_from_ks", "on");

// Filename key store file
props.put("jacorb.security.keystore", keyStorePath);
// Password for the key store
props.put("jacorb.security.keystore_password", keyStorePassword);

props.put("jacorb.security.ssl.client.supported_options", "60");
props.put("jacorb.security.ssl.client.required_options", "01");

// Use JSSE
props.put("jacorb.ssl.socket_factory", "org.jacorb.security.ssl.sun_jsse.SSLSocketFactory");
props.put("jacorb.ssl.server_socket_factory", "org.jacorb.security.ssl.sun_jsse.SSLServerSocketFactory");

props.put("jacorb.maxManagedBufSize", "23");

// connection timeout
props.put("jacorb.retries", "30");
props.put("jacorb.retry_interval", "2000"); // in ms

// dump messages to log
props.put("jacorb.debug.dump_outgoing_messages", "off");
props.put("jacorb.debug.dump_incoming_messages", "off");

Thanks in advance,

Gotthard Witsch

Research & Development syngo.share
E-Mail:       gotthard.witsch at ith-icoserve.com<mailto:gotthard.witsch at ith-icoserve.com>
______________________________________
ITH icoserve technology for healthcare GmbH
a siemens company - HC SV DS ITH
Innrain 98, 6020 Innsbruck, Österreich - www.ith-icoserve.com<http://www.ith-icoserve.com/>
Rechtsform: Gesellschaft mit beschränkter Haftung - Firmensitz: 6020 Innsbruck, Innrain 98
Firmenbuchnummer: FN 174117f - Firmenbuchgericht: Innsbruck - DVR: 0983039



More information about the jacorb-developer mailing list