--- old/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java 2014-01-24 14:02:59.566567100 +0800 +++ new/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java 2014-01-24 14:02:59.366567090 +0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -97,6 +97,22 @@ ActivationGroupDesc groupDesc = new ActivationGroupDesc(p, null); ActivationSystem system = ActivationGroup.getSystem(); + if(system == null) { + //Set a 5 seconds timeout + long stopTime = System.currentTimeMillis() + 5000; + do { + try { + Thread.sleep(200); + } catch (InterruptedException ignore) { + } + if((system = ActivationGroup.getSystem()) != null) { + break; + } + } while (System.currentTimeMillis() < stopTime); + if (system == null) { + TestLibrary.bomb("\nfailure: Can't acquire ActivationSystem"); + } + } ActivationGroupID groupID = system.registerGroup(groupDesc); System.err.println("registering activatable");