Article View: comp.lang.java.corba
Article #56checking object deletion
From: donalmurtagh
Date: Wed, 17 Jan 2007 15:38
Date: Wed, 17 Jan 2007 15:38
58 lines
3233 bytes
3233 bytes
Hi,
I'm writing a Java CORBA client, and am using the following code to
check if a pair of remote object references are still valid:
try {
if (workOrderInterface._non_existent() ||
eventFilterInterface._non_existent()) {
doSessionRefresh();
}
} catch (RuntimeException rex) {
//
// The _non_existent() calls above may have been throwing
NullPointerExceptions
// This handler should ensure that if anything unexpected happens,
we'll forcibly
// refresh the session
//
LOG.error("Error checking session validity. Session will be
forcibly refreshed", rex);
doSessionRefresh();
}
I added the try-catch, because _non_existent() was throwing a
NullPointerException. The evidence was provided by the following stack
trace I found in my logs:
Caused by: java.lang.NullPointerException
at com.inprise.vbroker.orb.ORB.getThreadLocalObject(Unknown Source)
at com.inprise.vbroker.qos.PolicyHelper.get_client_policy(Unknown
Source)
at com.inprise.vbroker.orb.DelegateImpl.get_policy(Unknown Source)
at org.omg.CORBA.portable.ObjectImpl._get_policy(ObjectImpl.java:310)
at com.inprise.vbroker.GIOP.ProtocolConnector.doServiceContext(Unknown
Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.doServiceContext(Unknown
Source)
at com.inprise.vbroker.IIOP.ProtocolConnector.doServiceContext(Unknown
Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.request(Unknown Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.pseudoRequest(Unknown
Source)
at com.inprise.vbroker.GIOP.ProtocolConnector.non_existent(Unknown
Source)
at com.inprise.vbroker.orb.DelegateImpl.non_existent(Unknown Source)
at
org.omg.CORBA.portable.ObjectImpl._non_existent(ObjectImpl.java:137)
at
com.acecomm.parentpatrol.surePay.SurePaySession.refreshSessionIfNecessary(SurePaySession.java:335)
Anyway, my question is this.....is there a better way to check whether
a remote object reference is still valid? Preferably, one which doesn't
throw any runtime exceptions :)
Thanks in Advance,
DM
Technical Details
Message-ID:
<1169048280.865387.210000@11g2000cwr.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!11g2000cwr.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 108bbb,66c48e24908717e6,start X-Google-Thread: 109156,66c48e24908717e6,start X-Google-Attributes: gid108bbb,gid109156,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!11g2000cwr.googlegroups.com!not-for-mail From: donalmurtagh@yahoo.co.uk Newsgroups: comp.lang.java.corba,borland.public.visibroker Subject: checking object deletion Date: 17 Jan 2007 07:38:00 -0800 Organization: http://groups.google.com Lines: 59 Message-ID: <1169048280.865387.210000@11g2000cwr.googlegroups.com> NNTP-Posting-Host: 216.13.50.116 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1169048295 23580 127.0.0.1 (17 Jan 2007 15:38:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 17 Jan 2007 15:38:15 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: 11g2000cwr.googlegroups.com; posting-host=216.13.50.116; posting-account=S2ECIAwAAAAoNqiUN1QpoHiXo33plG9k