ConnectException on consecutive execution [message #1804098] |
Mon, 18 March 2019 11:02 |
Kairus Chris Denoy Messages: 4 Registered: March 2019 |
Junior Member |
|
|
Hi, I've noticed this quite frequently where the following exception occurs,
*Note: Some items are redacted for confidentiality
org.eclipse.jubula.client.exceptions.CommunicationException: java.net.ConnectException: Could not connect to AUT: <ID name>.
org.eclipse.jubula.client.internal.impl.AUTImpl.connectImpl(AUTImpl.java:113)
org.eclipse.jubula.client.internal.impl.AUTImpl.connect(AUTImpl.java:98)
org.eclipse.jubula.client.internal.impl.AUTImpl.connect(AUTImpl.java:93)
com.nec.tool.jidouka.app.sequence.SequenceHardcode.executeTestSequence(SequenceHardcode.java:51)
com.nec.tool.jidouka.core.Executor.execute(Executor.java:142)
com.nec.tool.jidouka.core.Executor.main(Executor.java:61)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by java.net.ConnectException: Could not connect to AUT: <ID name>.
org.eclipse.jubula.client.internal.impl.AUTImpl.connectImpl(AUTImpl.java:114)
org.eclipse.jubula.client.internal.impl.AUTImpl.connect(AUTImpl.java:98)
org.eclipse.jubula.client.internal.impl.AUTImpl.connect(AUTImpl.java:93)
com.nec.tool.jidouka.app.sequence.SequenceHardcode.executeTestSequence(SequenceHardcode.java:51)
com.nec.tool.jidouka.core.Executor.execute(Executor.java:142)
com.nec.tool.jidouka.core.Executor.main(Executor.java:61)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
I have the custom application in AppTest.jar. The exception occurs when I'm done executing AppTest.jar and re-execute it again.
As a temporary fix, I had to close autagent.exe and start it again before proceeding. This doesn't fix it since it will occur again sometime.
This occurs 1/10 occurrences at best and 10/10 at worst.
I'm suspecting it was caused by poor implementation. So here's my implementation of it:
private static AUTConfig config = AUTConfig.getInstance();
private static int runStatus = 0;
public static void main(String[] args) {
try {
config.init(args);
AUTAgent autAgent = MakeR.createAUTAgent("localhost", 60000);
autAgent.connect();
AUTConfiguration configuration = new SwingAUTConfiguration("AppName", "AppID", "app.exe", "C:\\Program Files\\App", null);
AUTIdentifier identifier = autAgent.startAUT(configuration);
AUT aut = autAgent.getAUT(identifier, SwingComponents.getToolkitInformation());
config.setAut(aut);
// custom methods to execute test
} catch(Exception e) {
e.printStackTrace();
runStatus = 1;
} finally {
autAgent.stopAUT(identifier);
System.exit(runStatus);
}
}
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05424 seconds