Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » ConnectException on consecutive execution(executing Jubula repeatedly frequently causes ConnectException)
ConnectException on consecutive execution [message #1804098] Mon, 18 March 2019 11:02 Go to next message
Kairus Chris Denoy is currently offline Kairus Chris DenoyFriend
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);
  }
}


Re: ConnectException on consecutive execution [message #1804130 is a reply to message #1804098] Tue, 19 March 2019 07:25 Go to previous messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 192
Registered: March 2012
Senior Member
Hello,

please add aut.disconnect() and autAgent,disconnect() into the finally Block
finally {
    if(aut.isConnected()){
        aut.disconnect();
    }
    autAgent.stopAUT(identifier);
    autAgent.disconnect()
    System.exit(runStatus);
  }


I hope this makes it more reliably

best regards
Marvin
Re: ConnectException on consecutive execution [message #1804177 is a reply to message #1804130] Wed, 20 March 2019 02:40 Go to previous messageGo to next message
Kairus Chris Denoy is currently offline Kairus Chris DenoyFriend
Messages: 4
Registered: March 2019
Junior Member
Oh... so I have to disconnect on everything. This solved the issue. Thank you very much!
Re: ConnectException on consecutive execution [message #1811316 is a reply to message #1804177] Fri, 30 August 2019 14:26 Go to previous message
rupayan nath is currently offline rupayan nathFriend
Messages: 8
Registered: July 2019
Junior Member
Hi,

I too have the same concern. Jubula does not close my swing application and hence i cannot have a sequential test execution. The code i tried to close the application is :

aut.disconnect();
autagent.stopAUT(autidentifier);
autagent.disconnect();

Also tried by putting some static wait but only to fail:(
Please let me know if there is any suggestion.
Previous Topic:problems with checktextwithcellspec in Jubula 8.7.1.046
Next Topic:Error is coming on RCP AUT integration for Jubula
Goto Forum:
  


Current Time: Sun Nov 17 04:45:46 GMT 2019

Powered by FUDForum. Page generated in 0.02372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top