-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
7
-
team
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
After a corba server shutdown with ORB.destroy any following corba client calls do not terminate but wait indefinitely.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Scenario 1: Execute the test code -> the client hang up and the program does not terminate
Scenario 2: uncomment the line adding the corba flag "com.sun.CORBA.transport.ORBUseNIOSelectToWait" with a value of 'false' -> the client does not hang up
Scenario 3: add the corba flag to the server orb only -> the client hang up with Java 7 and works fine with Java 6
Scenario 4: add the corba flag to the client orb only -> the client works fine with Java 7 and hangs up with Java 6.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The corba client should always terminate and not hang up.
ACTUAL -
Depending on the java version (6 or 7) and the corba flag (server or client) the client terminates or hangs up. Without flag on both sides it always hang up.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Thread dump of hang up client:
java.lang.Object.wait(long) @bci=0 (Interpreted frame)
java.lang.Object.wait() @bci=2, line=503 (Interpreted frame)
com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl.waitForResponse(com.sun.corba.se.pept.protocol.MessageMediator) @bci=238, line=158 (Interpreted frame)
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.waitForResponse(com.sun.corba.se.pept.protocol.MessageMediator) @bci=5, line=1101 (Interpreted frame)
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.waitForResponse() @bci=17, line=271 (Interpreted frame)
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(com.sun.corba.se.spi.orb.ORB, com.sun.corba.se.spi.protocol.CorbaMessageMediator) @bci=46, line=395 (In
terpreted frame)
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(java.lang.Object, com.sun.corba.se.pept.encoding.OutputObject) @bci=66, line=369 (Interpreted frame)
com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream) @bci=11, line=147 (Interpreted frame)
org.omg.CORBA.portable.ObjectImpl._invoke(org.omg.CORBA.portable.OutputStream) @bci=6, line=475 (Interpreted frame)
hox.corem.corba._LoginServiceWithProtocolVersionStub.removeLoginServiceListener(hox.corem.corba.Session, java.lang.String) @bci=26, line=311 (Interpreted frame)
com.coremedia.cotopaxi.corba.CorbaContentConnection.removeLoginServiceListener() @bci=22, line=613 (Interpreted frame)
com.coremedia.cotopaxi.corba.CorbaContentConnection.closingSession() @bci=1, line=602 (Interpreted frame)
com.coremedia.cotopaxi.corba.AbstractConnection.disconnect() @bci=5, line=217 (Interpreted frame)
com.coremedia.cotopaxi.corba.CorbaConnectStrategy.disconnect() @bci=25, line=698 (Interpreted frame)
com.coremedia.cotopaxi.common.CapConnectionImpl.close() @bci=181, line=520 (Interpreted frame)
com.coremedia.workflow.impl.server.Server.disconnectFromContentServer() @bci=32, line=565 (Interpreted frame)
com.coremedia.workflow.impl.server.Server.shutdown() @bci=489, line=1265 (Interpreted frame)
com.coremedia.workflow.impl.server.ServerBootstrap.shutdown() @bci=18, line=104 (Interpreted frame)
com.coremedia.workflow.impl.server.ServerBootstrap.destroy() @bci=1, line=57 (Interpreted frame)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package test;
import org.omg.CORBA.ORB;
import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CORBA.Object;
import org.omg.CORBA.Request;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAHelper;
import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
import org.omg.PortableServer.POAPackage.ObjectNotActive;
import org.omg.PortableServer.POAPackage.ServantAlreadyActive;
import org.omg.PortableServer.POAPackage.WrongPolicy;
import org.omg.PortableServer.Servant;
import java.util.Properties;
public class ORBTest {
public static void main(String[] args) throws InvalidName, ServantAlreadyActive, WrongPolicy, ObjectNotActive, AdapterInactive, InterruptedException {
System.out.println(System.getProperty("os.arch"));
System.out.println(System.getProperty("java.version"));
Properties props = new Properties(System.getProperties());
// uncomment to avoid client hang up
// props.put("com.sun.CORBA.transport.ORBUseNIOSelectToWait", "false");
final ORB server = ORB.init(args, props);
final POA poa = POAHelper.narrow(server.resolve_initial_references("RootPOA"));
poa.the_POAManager().activate();
final MyServant servant = new MyServant();
final byte[] oid = poa.activate_object(servant);
final Object customer = poa.id_to_reference(oid);
final String ior = server.object_to_string( customer );
final ORB client = ORB.init(args, props);
final Object stub = client.string_to_object(ior);
System.out.println("Shutting down server");
server.shutdown(true);
server.destroy();
System.out.println("Shut down server");
Thread.sleep(2000);
new Thread() {
public void run() {
System.out.println("Call begin");
Request request = stub._request("callya");
request.invoke();
System.out.println("Call returned");
}
}.start();
Thread.sleep(1000);
System.out.println("Shutting down client");
client.destroy();
System.out.println("Shut down client");
}
static class MyServant extends Servant implements InvokeHandler {
private static final String[] INTERFACES = new String[] { "type:body" };
public String[] _all_interfaces(POA poa, byte[] objectId) {
return INTERFACES;
}
public OutputStream _invoke(String method, InputStream input, ResponseHandler handler) throws SystemException {
System.out.println("server operation starts");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
System.out.println("server operation ends");
return handler.createReply();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use corba flag com.sun.CORBA.transport.ORBUseNIOSelectToWait = 'false'
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
After a corba server shutdown with ORB.destroy any following corba client calls do not terminate but wait indefinitely.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Scenario 1: Execute the test code -> the client hang up and the program does not terminate
Scenario 2: uncomment the line adding the corba flag "com.sun.CORBA.transport.ORBUseNIOSelectToWait" with a value of 'false' -> the client does not hang up
Scenario 3: add the corba flag to the server orb only -> the client hang up with Java 7 and works fine with Java 6
Scenario 4: add the corba flag to the client orb only -> the client works fine with Java 7 and hangs up with Java 6.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The corba client should always terminate and not hang up.
ACTUAL -
Depending on the java version (6 or 7) and the corba flag (server or client) the client terminates or hangs up. Without flag on both sides it always hang up.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Thread dump of hang up client:
java.lang.Object.wait(long) @bci=0 (Interpreted frame)
java.lang.Object.wait() @bci=2, line=503 (Interpreted frame)
com.sun.corba.se.impl.transport.CorbaResponseWaitingRoomImpl.waitForResponse(com.sun.corba.se.pept.protocol.MessageMediator) @bci=238, line=158 (Interpreted frame)
com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.waitForResponse(com.sun.corba.se.pept.protocol.MessageMediator) @bci=5, line=1101 (Interpreted frame)
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.waitForResponse() @bci=17, line=271 (Interpreted frame)
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(com.sun.corba.se.spi.orb.ORB, com.sun.corba.se.spi.protocol.CorbaMessageMediator) @bci=46, line=395 (In
terpreted frame)
com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(java.lang.Object, com.sun.corba.se.pept.encoding.OutputObject) @bci=66, line=369 (Interpreted frame)
com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream) @bci=11, line=147 (Interpreted frame)
org.omg.CORBA.portable.ObjectImpl._invoke(org.omg.CORBA.portable.OutputStream) @bci=6, line=475 (Interpreted frame)
hox.corem.corba._LoginServiceWithProtocolVersionStub.removeLoginServiceListener(hox.corem.corba.Session, java.lang.String) @bci=26, line=311 (Interpreted frame)
com.coremedia.cotopaxi.corba.CorbaContentConnection.removeLoginServiceListener() @bci=22, line=613 (Interpreted frame)
com.coremedia.cotopaxi.corba.CorbaContentConnection.closingSession() @bci=1, line=602 (Interpreted frame)
com.coremedia.cotopaxi.corba.AbstractConnection.disconnect() @bci=5, line=217 (Interpreted frame)
com.coremedia.cotopaxi.corba.CorbaConnectStrategy.disconnect() @bci=25, line=698 (Interpreted frame)
com.coremedia.cotopaxi.common.CapConnectionImpl.close() @bci=181, line=520 (Interpreted frame)
com.coremedia.workflow.impl.server.Server.disconnectFromContentServer() @bci=32, line=565 (Interpreted frame)
com.coremedia.workflow.impl.server.Server.shutdown() @bci=489, line=1265 (Interpreted frame)
com.coremedia.workflow.impl.server.ServerBootstrap.shutdown() @bci=18, line=104 (Interpreted frame)
com.coremedia.workflow.impl.server.ServerBootstrap.destroy() @bci=1, line=57 (Interpreted frame)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package test;
import org.omg.CORBA.ORB;
import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CORBA.Object;
import org.omg.CORBA.Request;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAHelper;
import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
import org.omg.PortableServer.POAPackage.ObjectNotActive;
import org.omg.PortableServer.POAPackage.ServantAlreadyActive;
import org.omg.PortableServer.POAPackage.WrongPolicy;
import org.omg.PortableServer.Servant;
import java.util.Properties;
public class ORBTest {
public static void main(String[] args) throws InvalidName, ServantAlreadyActive, WrongPolicy, ObjectNotActive, AdapterInactive, InterruptedException {
System.out.println(System.getProperty("os.arch"));
System.out.println(System.getProperty("java.version"));
Properties props = new Properties(System.getProperties());
// uncomment to avoid client hang up
// props.put("com.sun.CORBA.transport.ORBUseNIOSelectToWait", "false");
final ORB server = ORB.init(args, props);
final POA poa = POAHelper.narrow(server.resolve_initial_references("RootPOA"));
poa.the_POAManager().activate();
final MyServant servant = new MyServant();
final byte[] oid = poa.activate_object(servant);
final Object customer = poa.id_to_reference(oid);
final String ior = server.object_to_string( customer );
final ORB client = ORB.init(args, props);
final Object stub = client.string_to_object(ior);
System.out.println("Shutting down server");
server.shutdown(true);
server.destroy();
System.out.println("Shut down server");
Thread.sleep(2000);
new Thread() {
public void run() {
System.out.println("Call begin");
Request request = stub._request("callya");
request.invoke();
System.out.println("Call returned");
}
}.start();
Thread.sleep(1000);
System.out.println("Shutting down client");
client.destroy();
System.out.println("Shut down client");
}
static class MyServant extends Servant implements InvokeHandler {
private static final String[] INTERFACES = new String[] { "type:body" };
public String[] _all_interfaces(POA poa, byte[] objectId) {
return INTERFACES;
}
public OutputStream _invoke(String method, InputStream input, ResponseHandler handler) throws SystemException {
System.out.println("server operation starts");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
System.out.println("server operation ends");
return handler.createReply();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use corba flag com.sun.CORBA.transport.ORBUseNIOSelectToWait = 'false'