RemoteAccessException when closing java application

65 views
Skip to first unread message

pominnz

unread,
Aug 29, 2011, 12:48:01 AM8/29/11
to robotframework-users
Hi

I've been using the RemoteApplication library to start a java
application and manipulate it using the Swinglibrary.

The application has a File|Exit menu which if I select using "Select
From Main Menu", the application closes, but I then get the following
RemoteAccessException

RemoteAccessException: Could not access remote service [rmi://
localhost:2511/SwingLibrary]; nested exception is
java.rmi.UnmarshalException: Error unmarshaling return header; nested
exception is: java.net.SocketException: Connection reset

If I use RemoteApplication.Close Application, everything appears to
work ok, but I'd really like to close the application gracefully.

Cheers
Paul

Mikko Korpela

unread,
Aug 29, 2011, 2:50:37 AM8/29/11
to apom...@gmail.com, robotframework-users
Hello Paul,

Could it be that the tested system closes it self with System.exit(0);
when you use File|Exit?
This will kill everything in the same JVM (including the remote
library and the socket it uses). If this will happen in the middle of
the keyword execution, Robot will get an error from the rmi-socket it
uses to communicate with the remote library.

If you want to close your tested system this way then I suggest that
you use Run Keyword And Expect Error to run the closing keyword.

Kind Regards,
Mikko Korpela

2011/8/29 pominnz <apom...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
>
>

pominnz

unread,
Aug 30, 2011, 9:59:15 PM8/30/11
to robotframework-users
Hi Mikko

Thanks for your response.

I have implemented the suggested Run Keyword And Expect Error, and
this appears to work, although we still need to run the
RemoteApplication.Close Application to free up the alias.

Cheers
Paul

On Aug 29, 6:50 pm, Mikko Korpela <mikko.korp...@gmail.com> wrote:
> Hello Paul,
>
> Could it be that the tested system closes it self with System.exit(0);
> when you use File|Exit?
> This will kill everything in the same JVM (including the remote
> library and the socket it uses). If this will happen in the middle of
> the keyword execution, Robot will get an error from the rmi-socket it
> uses to communicate with the remote library.
>
> If you want to close your tested system this way then I suggest that
> you use Run Keyword And Expect Error to run the closing keyword.
>
> Kind Regards,
> Mikko Korpela
>
> 2011/8/29pominnz<apomi...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages