Results 1 to 4 of 4

Thread: ThrowsAdvice can only soften to runtime exception?

  1. #1
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default ThrowsAdvice can only soften to runtime exception?

    I'm getting:

    java.lang.reflect.UndeclaredThrowableException
    at $Proxy0.fileOperation(Unknown Source)

    Just to remove a remote possibility that I'm not misinterpreting an error in my code; my understanding is that in a ThrowsAdvice's afterThrowing method, one can only change the exception to a RunTimeException class or subclass. Correct?

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Ofc, otherwise you have a checked exception which had to be declared catched at compilation time.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    Yes, you can't use Spring AOP to change method signatures.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  4. #4
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    Quote Originally Posted by Rod Johnson
    Yes, you can't use Spring AOP to change method signatures.
    Thanks, as I found out the hard way a while back, you can't do "dynamic casts" in Java.

Similar Threads

  1. Replies: 3
    Last Post: Oct 5th, 2005, 08:39 AM
  2. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  3. Odd behaviour when injecting TransactionTemplate
    By damon311 in forum Container
    Replies: 3
    Last Post: Jul 23rd, 2005, 11:21 AM
  4. Replies: 0
    Last Post: Jul 11th, 2005, 05:49 PM
  5. Replies: 3
    Last Post: Nov 8th, 2004, 07:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •