Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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: 255
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 messageGo to next 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.
Re: ConnectException on consecutive execution [message #1827319 is a reply to message #1811316] Wed, 13 May 2020 02:35 Go to previous messageGo to next message
Naveen Reddy is currently offline Naveen ReddyFriend
Messages: 1
Registered: May 2020
Junior Member
Hi i am facing the same issue. I am not able to connect the aut even for the first time.
Agent is connected and application is opened. but
AUTAgent autagent = null;
AUTConfiguration autconfiguration = null;
AUTIdentifier id ;
AUT aut = null;
autagent = MakeR.createAUTAgent("localhost",60000);
autagent.connect();
String autId = "app123";
String name = "app";
autconfiguration = new
SwingAUTConfiguration(name, autId,"XXXXXXX.bat", "C:\\Users\\XXXXX\\Documents\\Software\\XXXXXX",null);

id = autagent.startAUT(autconfiguration);
if(id!=null) {
aut = autagent.getAUT(id, SwingComponents.getToolkitInformation());
aut.connect();
}
it fails @ aut.connect();
pls help
Re: ConnectException on consecutive execution [message #1828177 is a reply to message #1827319] Wed, 03 June 2020 10:12 Go to previous messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 255
Registered: March 2012
Senior Member
Is there any more information? Is the AUT started? because if not something with the start is not correct.

best regards
Marvin Mueller
Re: ConnectException on consecutive execution [message #1853615 is a reply to message #1828177] Mon, 11 July 2022 13:38 Go to previous message
Sachin Upadhyay is currently offline Sachin UpadhyayFriend
Messages: 8
Registered: January 2022
Junior Member
Hi Marvin, I am too stuck here.
I tried your implementation but my application doesn't closes, I can see that disconnect happens though. This is Strange. Due to this, I am not able to run multiple test suites
Previous Topic:Jubula Client API tutorial
Next Topic:Jubula Client API - Require Help!
Goto Forum:
  


Current Time: Fri Mar 29 13:25:23 GMT 2024

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

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

Back to the top