Uncatchable exception in LookupLocatorDiscovery.
"Rawlings, Bill A" <[email protected]> Mon, 15 Dec 2008 08:48:41 -0700
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--Boundary_(ID_X2Q1RMPe0+LbKCrq5LiEWw)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7BIT
Nice to see all the discussion going on about River. However, some of
us are still wrestling with the code.
I'm trying to develop an administration app. I want to be able to see
if a LUS is running on a particular machine.
I'm using the LookupLocatorDiscovery class...
try
{
LookupLocator[] locs = new LookupLocator[] {new
LookupLocator("jini://localhost/")};
LookupLocatorDiscovery lld = new LookupLocatorDiscovery(locs);
lld.addDiscoveryListener(this);
}
catch(Exception ex)
{
System.out.println("Error discovering LUS");
ex.printStackTrace();
}
If there is NOT a LUS running on "localhost", I get this:
Dec 15, 2008 8:35:17 AM
net.jini.discovery.LookupLocatorDiscovery$LocatorReg tryGetProxy
INFO: exception occured during unicast discovery to xxx.xx.xx.xxx:4160
with constraints InvocationConstraints[reqs: {}, prefs: {}]
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:516)
at java.net.Socket.connect(Socket.java:466)
at
com.sun.jini.discovery.internal.MultiIPDiscovery.getSingleResponse(Multi
IPDiscovery.java:134)
at
com.sun.jini.discovery.internal.MultiIPDiscovery.getResponse(MultiIPDisc
overy.java:83)
at
net.jini.discovery.LookupLocatorDiscovery$LocatorReg.doUnicastDiscovery(
LookupLocatorDiscovery.java:505)
at
net.jini.discovery.LookupLocatorDiscovery$LocatorReg.tryGetProxy(LookupL
ocatorDiscovery.java:474)
at
net.jini.discovery.LookupLocatorDiscovery.regTryGetProxy(LookupLocatorDi
scovery.java:1271)
at
net.jini.discovery.LookupLocatorDiscovery.access$800(LookupLocatorDiscov
ery.java:308)
at
net.jini.discovery.LookupLocatorDiscovery$DiscoveryTask.tryOnce(LookupLo
catorDiscovery.java:703)
at com.sun.jini.thread.RetryTask.run(RetryTask.java:131)
at
com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331)
It doesn't get caught in that try/catch block. It doesn't get caught if
I try to catch "Throwable" instead of "Exception", it doesn't get caught
if I throw it out of the method and try to catch it in the calling
block.
Is there a better way of determining if a LUS is running on a particular
machine? If I could catch the exception, I could "conclude" there is no
LUS, but I can't catch it.
Bill
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
Community Web Site: http://jini.org
jini-users Archive: http://archives.java.sun.com/archives/jini-users.html
Unsubscribing: email "signoff JINI-USERS" to [email protected]
--Boundary_(ID_X2Q1RMPe0+LbKCrq5LiEWw)
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7BIT
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Nice to see all the discussion going on about River.
However, some of us are still wrestling with the code.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’m trying to develop an administration app. I
want to be able to see if a LUS is running on a particular machine.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’m using the LookupLocatorDiscovery class…<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal> try <o:p></o:p></p>
<p class=MsoNormal> {<o:p></o:p></p>
<p class=MsoNormal> LookupLocator[] locs = new
LookupLocator[] {new LookupLocator("jini://localhost/")};<o:p></o:p></p>
<p class=MsoNormal> LookupLocatorDiscovery lld =
new LookupLocatorDiscovery(locs);<o:p></o:p></p>
<p class=MsoNormal>
lld.addDiscoveryListener(this);<o:p></o:p></p>
<p class=MsoNormal> }<o:p></o:p></p>
<p class=MsoNormal> catch(Exception ex)<o:p></o:p></p>
<p class=MsoNormal> {<o:p></o:p></p>
<p class=MsoNormal> System.out.println(“Error
discovering LUS”);<o:p></o:p></p>
<p class=MsoNormal> ex.printStackTrace();<o:p></o:p></p>
<p class=MsoNormal> }<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>If there is NOT a LUS running on “localhost”, I
get this:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Dec 15, 2008 8:35:17 AM
net.jini.discovery.LookupLocatorDiscovery$LocatorReg tryGetProxy<o:p></o:p></p>
<p class=MsoNormal>INFO: exception occured during unicast discovery to xxx.xx.xx.xxx:4160
with constraints InvocationConstraints[reqs: {}, prefs: {}]<o:p></o:p></p>
<p class=MsoNormal>java.net.ConnectException: Connection refused: connect<o:p></o:p></p>
<p class=MsoNormal> at
java.net.PlainSocketImpl.socketConnect(Native Method)<o:p></o:p></p>
<p class=MsoNormal> at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)<o:p></o:p></p>
<p class=MsoNormal> at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)<o:p></o:p></p>
<p class=MsoNormal> at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)<o:p></o:p></p>
<p class=MsoNormal> at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)<o:p></o:p></p>
<p class=MsoNormal> at
java.net.Socket.connect(Socket.java:516)<o:p></o:p></p>
<p class=MsoNormal> at
java.net.Socket.connect(Socket.java:466)<o:p></o:p></p>
<p class=MsoNormal> at
com.sun.jini.discovery.internal.MultiIPDiscovery.getSingleResponse(MultiIPDiscovery.java:134)<o:p></o:p></p>
<p class=MsoNormal> at
com.sun.jini.discovery.internal.MultiIPDiscovery.getResponse(MultiIPDiscovery.java:83)<o:p></o:p></p>
<p class=MsoNormal> at
net.jini.discovery.LookupLocatorDiscovery$LocatorReg.doUnicastDiscovery(LookupLocatorDiscovery.java:505)<o:p></o:p></p>
<p class=MsoNormal> at
net.jini.discovery.LookupLocatorDiscovery$LocatorReg.tryGetProxy(LookupLocatorDiscovery.java:474)<o:p></o:p></p>
<p class=MsoNormal> at
net.jini.discovery.LookupLocatorDiscovery.regTryGetProxy(LookupLocatorDiscovery.java:1271)<o:p></o:p></p>
<p class=MsoNormal> at
net.jini.discovery.LookupLocatorDiscovery.access$800(LookupLocatorDiscovery.java:308)<o:p></o:p></p>
<p class=MsoNormal> at
net.jini.discovery.LookupLocatorDiscovery$DiscoveryTask.tryOnce(LookupLocatorDiscovery.java:703)<o:p></o:p></p>
<p class=MsoNormal> at
com.sun.jini.thread.RetryTask.run(RetryTask.java:131)<o:p></o:p></p>
<p class=MsoNormal> at
com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331)<o:p></o:p></p>
<p class=MsoNormal><o:p></o:p></p>
<p class=MsoNormal>It doesn’t get caught in that try/catch block.
It doesn’t get caught if I try to catch “Throwable” instead
of “Exception”, it doesn’t get caught if I throw it out of
the method and try to catch it in the calling block.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Is there a better way of determining if a LUS is running on
a particular machine? If I could catch the exception, I could “conclude”
there is no LUS, but I can’t catch it.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Bill<o:p></o:p></p>
</div>
</body>
</html>
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
Community Web Site: http://jini.org
jini-users Archive: http://archives.java.sun.com/archives/jini-users.html
Unsubscribing: email "signoff JINI-USERS" to [email protected]
--Boundary_(ID_X2Q1RMPe0+LbKCrq5LiEWw)--