The Artima Developer Community
Sponsored Link

Java Answers Forum
chained exception--websphere doubt

1 reply on 1 page. Most recent reply: Sep 28, 2005 10:13 PM by Matthias Neumair

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--websphere doubt Posted: Sep 28, 2005 8:25 AM
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 (!Util.isLocal(this)) {
}
else {
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);
}
}
}


//Inside the business implementation class for my stateless session ejb,
public mybusinessmethod () throws myappException{

try {
//some exception occurs....

} catch (Exception e) {
throw new myappException(e);
}
}

So, how to preserve my backtraces from being set to null by websphere's generated stub files and pass them to the web-tier??

thanks a lot


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: chained exception--websphere doubt Posted: Sep 28, 2005 10:13 PM
Reply to this message Reply
Repost with [ java ] tags, so we might actually be able to read the code.

Flat View: This topic has 1 reply on 1 page
Topic: Directory Conents from URL Previous Topic   Next Topic Topic: StyleConstants.isXXX() error with JEditorPane

Sponsored Links



Google
  Web Artima.com   

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