The Artima Developer Community
Sponsored Link

Java Answers Forum
chained exception doubt

1 reply on 1 page. Most recent reply: Sep 27, 2005 11:29 PM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
kiranreddy

Posts: 2
Nickname: kiranreddy
Registered: Sep, 2005

chained exception doubt Posted: Sep 27, 2005 7:52 PM
Reply to this message Reply
Advertisement
Hi friends,

This is a peculiar problem where in the websphere created stub file for my stateless session ejb is creating a
copy of my app's exception(which has chained backtraces due to exception chaining)[i believe that it is doing this for

portability purposes] and setting those backtraces to null, so that by the time i catch this exception in the web tier, i

have no stack trace!


In the stub file for my stateless session ejb auto-generated by websphere 5.1, inside the business method,
Also, am using Local Communication, so the else gets executed.

//if remote communication with ejbs,
if (!Util.isLocal(this)) {
}


else //if local communication with ejbs
{

try {
//some exception occurs...
} catch (Throwable ex) {
//The throwable "ex" which is being used to make a copy has chained tracebacks.
//But now, the below statement is creating a copy of "ex" with all the tracebacks being set to null in the chain!

Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());

if (exCopy instanceof myappException) {
throw (myappException)exCopy; // throwing the copy with the tracebacks set to null to the web tier!
}
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}

thanks a lot


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: chained exception doubt Posted: Sep 27, 2005 11:29 PM
Reply to this message Reply
Your code is really messy please format and repost.
Its discouraging to even look at.

Flat View: This topic has 1 reply on 1 page
Topic: Query on Facade Pattern Previous Topic   Next Topic Topic: java 2 exe

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use