Why the NPE using static method of DatatypeConverter?

前端 未结 3 1469
醉话见心
醉话见心 2020-12-07 01:11

I have stared at this short code too long, and cannot for the life of me see how it can throw a NullPointerException on line 6. Why the NPE?

cl         


        
3条回答
  •  离开以前
    2020-12-07 01:50

    It seems as though there are bugs in JAXB within JDK7 right now, as evidenced by this issue on Camel:

    https://issues.apache.org/jira/browse/CAMEL-4893

    which ultimately links to this issue https://github.com/javaee/jaxb-v2/issues/860 in the JAXB project on java.net.

    I'm not entirely sure if you are running into this same thing or not, but perhaps try using JDK6 with the latest JAXB version there and see if the same NPE happens or not.

提交回复
热议问题