search

Home  >  Q&A  >  body text

无法转换为java.lang.Throwable

java: 不兼容的类型: org.exolab.castor.xml.MarshalException无法转换为java.lang.Throwable

            try{
                marshaller.marshal(rpic);
            }catch (MarshalException e) {
                
            } catch (ValidationException e) {
               
            }

这两个异常都无法通过catch捕获,是这两个异常无法转化为java.lang.Throwable。

阿神阿神2803 days ago1205

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-18 10:58:37

    Look at the source code of this class. How can it be called Exception if it is not inherited from Throwable?
    Additional:
    I tried it specially and there is no problem. It is recommended to check the code and configuration

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:58:37

    The castor-core-1.3.3.jar that this jar depends on is not fully downloaded in the local maven repository.

    reply
    0
  • Cancelreply