Announcement Announcement Module
No announcement yet.
RuntimeException throwed during invocation of MBeanProxyFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • RuntimeException throwed during invocation of MBeanProxyFactoryBean

    I have bean exported via MBeanExporter, and have client obtaining reference on exported bean via MBeanProxyFactoryBean.
    As I call proxy method, and unchecked exception throwed inside my bean, I get InvocationFailureException on client, not original exception?
    Is there any way to get original RuntimeException on client?

  • #2
    You can try doing a getCause but however, if you look at the javadoc for InvocationFailureException you get:
    Thrown when trying to invoke an operation on a proxy that is not exposed by the proxied resource's management interface.
    This exception is not a wrapper but actually an exception per-se.


    • #3
      So write an aspect converting InvocationFailureException to getCause exception? Is there any in spring distribution? Or I have to write custom one?


      • #4
        First of all make sure that you actually get a nested exception - again, the exception seems to be thrown if you invoke a non-proxied method.
        If you have a nested exception, then you'll have to write an aspect of your own, I'm not aware of any advice which provides such functionality out of the box.