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);
}
}
}


//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