[ome-devel] loadOmero('localhost') from Matlab

Josh Moore josh at glencoesoftware.com
Wed Feb 1 19:10:55 GMT 2012


On Feb 1, 2012, at 4:57 PM, Munro, Ian wrote:

> Hi Josh

Hi Ian,

> Thanks for your reply
> The next thing I do is a call to createsSession.
> But unfortunately it looks to me as if it never returns from this call if the server doesn't exist.

When I try this with loadOmero('foo') or loadOmero('localhost') where the server isn't running I receive the error:

>> client = omero.client('foo');
>> client.createSession('foo','foo');
??? Java exception occurred:
Ice.ConnectionRefusedException
    error = 0
	at IceInternal.Network.doFinishConnect(Network.java:417)
	at IceSSL.TransceiverI.initialize(TransceiverI.java:37)
	at Ice.ConnectionI.initialize(ConnectionI.java:1536)
	at Ice.ConnectionI.socketReady(ConnectionI.java:1116)
	at Ice.ConnectionI$SocketReadyCallback.socketReady(ConnectionI.java:2299)
	at IceInternal.SelectorThread.run(SelectorThread.java:203)
	at IceInternal.SelectorThread$HelperThread.run(SelectorThread.java:273)
Caused by: java.net.ConnectException: Connection refused: no further information
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
	at IceInternal.Network.doFinishConnect(Network.java:393)
	... 6 more

within a few seconds. Is the server possibly running but not returning anything? You might try running jstack on the process id and send us the output:

C:\>jps -v
...
5256  -Xss512k -XX:PermSize=32M -Xms64m -XX:NewRatio=3 -XX:MaxPermSize=128M -Xmx196m -XX:MaxDirectMemorySize=2147400000 -Dsun.java2d.noddraw=true -Dsun.awt.nopixfmt=true -Xshare:off -Xmx128m -Djava.library.path=C:\Program Files\MATLAB\R2007b\bin\win64 vfprintf abort
...

C:\>jstack 5256
... lots of output ...

Cheers,
~Josh


> Ian
> 
> On 1 Feb 2012, at 13:12, Josh Moore wrote:
> 
>> 
>> On Feb 1, 2012, at 1:18 PM, Munro, Ian wrote:
>> 
>>> Hello
>>> 
>>> I'm curently developing  some Matlab code to access OMERO using a virtualbox server
>>> running on the development machine to do the testing.
>>> 
>>> when I call
>>> 
>>> client = loadOmero('localhost');
>>> 
>>> either when the server isn't running or with an invalid address
>>> it returns with no problem.
>>> 
>>> Is there a way of telling whether the value returned ( 'client' in the code snippet )
>>> represents a valid server or not?
>>> 
>>> The reason I want to know is that if the server isn't valid
>>> a subsequent call to
>>> 
>>> session = client.createSession(userName,passwd);
>>> 
>>> fails to return properly.
>> 
>> Hi Ian,
>> 
>> the only way to know whether or not the client will connect to the given server is to call createSession. If you call loadOmero with more than one return argument, however, createSession will be called for you:
>> 
>> properties = java.util.Properties();
>> properties.setProperty('omero.host', 'localhost');
>> properties.setProperty('omero.user', userName);
>> % etc.
>> [client, session] = loadOmero(properties);
>> % similarly with passing an Ice.Config file.
>> 
>> Cheers,
>> ~Josh
>> 
>>> Thanks
>>> Ian
>> 
> 



More information about the ome-devel mailing list