Upon following the getting started guide (section 5 pg. 11) I receive the error below after entering mha_query(openmha,'','read:fshift_hilbert_live.cfg') into the matlab command window:
Error using mhactl_java (line 79)
Could not resolve host localhost or could not connect to localhost:59312
Any ideas? I posted a separate issue earlier but this particular error is using Matlab 2021a on a Windows 10 machine.
Thanks in advance.
JE
Error using mhactl_java
-
- Posts: 38
- Joined: Fri May 10, 2019 7:58 am
-
- Posts: 8
- Joined: Thu Feb 24, 2022 6:59 pm
Re: Error using mhactl_java
Yes, I did try this with the firewall disabled as well but still received the same error.
-
- Posts: 118
- Joined: Mon Jun 24, 2019 12:51 pm
Re: Error using mhactl_java
This can also happen when the openMHA has exited because of an error. In this case, the previous error message should be inspected. This seems to have been the case here. viewtopic.php?t=156
-
- Posts: 8
- Joined: Thu Feb 24, 2022 6:59 pm
Re: Error using mhactl_java
This particular computer it controlled by my organization's IT dept. I am wondering if there might be some firewall functionality that I am not able to disable. If I run the mha_query command twice it will indicate that it could not connect to localhost: XXXXX. Below is the what occurs in the Matlab command window.
>> openmha = mha_start;
>> mha_query(openmha,'','read:fshift_hilbert_live.cfg');
Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)
An error occured while sending to MHA server:
[1: '?read:fshift_hilbert_live.cfg'] java.net.SocketException: Connection reset
Error in mhactl_wrapper (line 42)
r = interface( handle, query );
Error in mha_query (line 17)
s = mhactl_wrapper( handle, [base '?' query] );
>> mha_query(openmha,'','read:fshift_hilbert_live.cfg');
Error using mhactl_java (line 79)
Could not resolve host localhost or could not connect to localhost:59822
Error in mhactl_wrapper>mhactl_wrapper_2 (line 57)
[r, state] = mhactl_java( h, 'eval', query );
Error in mhactl_wrapper (line 42)
r = interface( handle, query );
Error in mha_query (line 17)
s = mhactl_wrapper( handle, [base '?' query] );
>> openmha = mha_start;
>> mha_query(openmha,'','read:fshift_hilbert_live.cfg');
Error using mhactl_wrapper>mhactl_wrapper_2 (line 64)
An error occured while sending to MHA server:
[1: '?read:fshift_hilbert_live.cfg'] java.net.SocketException: Connection reset
Error in mhactl_wrapper (line 42)
r = interface( handle, query );
Error in mha_query (line 17)
s = mhactl_wrapper( handle, [base '?' query] );
>> mha_query(openmha,'','read:fshift_hilbert_live.cfg');
Error using mhactl_java (line 79)
Could not resolve host localhost or could not connect to localhost:59822
Error in mhactl_wrapper>mhactl_wrapper_2 (line 57)
[r, state] = mhactl_java( h, 'eval', query );
Error in mhactl_wrapper (line 42)
r = interface( handle, query );
Error in mha_query (line 17)
s = mhactl_wrapper( handle, [base '?' query] );
-
- Posts: 118
- Joined: Mon Jun 24, 2019 12:51 pm
Re: Error using mhactl_java
This may be the case, but a more likely explanation is that openMHA terminates while reading the config file because of some error. Two suggestions:
1) Verify that you can talk twice from Matlab to the openMHA instance before reading the configuration file, e.g.
2) Print the stdout and stderr of the openMHA instance (that most likely dies) for further analysis:
1) Verify that you can talk twice from Matlab to the openMHA instance before reading the configuration file, e.g.
Code: Select all
mha = mha_start
mha_get(mha,'state') % Without semicolon, should print return value 'unprepared'.
pause(2) % Network connection from Matlab to openMHA auto-closes when idle for 2 seconds IIRC.
mha_get(mha,'state') % Repeat with new connection.
Code: Select all
[mha,process] = mha_start
stdout = javaObject('de.hoertech.mha.control.StreamGobbler', ...
process.getInputStream, ... % InputStream is mha's stdout.
true); % Store received text.
stderr = javaObject('de.hoertech.mha.control.StreamGobbler', ...
process.getErrorStream(), true); % Store mha's stderr.
mha_query(mha,'','read:fshift_hilbert_live.cfg'); % Your error happens here.
stdout.get() % Display what openMHA printed to stdout.
stderr.get() % Display what openMHA printed to stderr.