On May 22, 2008, at 4:00 AM, Rick McGuire wrote:

I'm thinking perhaps the problem might be you're getting a ClassCastException on the throwable line itself. The line

  cause = new EJBException(re.getMessage(), (Exception) detail);

will cause a ClassCastException because detail is an instance of AbstractMethodError, which is not a subclass of Exception.

Yea, that's it. I came to that conclusion as well at the end of my last email and was sort of kicking myself for missing it.

Unfortunately, you can't just remove the (Exception) cast, because that's the type specified on the constructor. It looks like the initClause() form is the only way to get what you want out of this.


I'd love to know the rationale behind not allowing it to accept throwable in the constructor. Seems like awfully arbitrary restriction.

-David


Reply via email to