java.lang.LinkageError: ClassCastException

前端 未结 3 2050
-上瘾入骨i
-上瘾入骨i 2020-12-19 00:59

I do experience a really annoying problem with TestNG and RESTeasy.

I do have a class that runs several tests against an API class which uses the RESTeasy framework

3条回答
  •  时光取名叫无心
    2020-12-19 01:38

    Unfortunately I can't tell you why this happened, but I can tell you how to get around this issue.

    The problem was, that PowerMockito scanned tha class path and also added the RESTeasy classes (which are located within the package 'javax.ws.*'. Therefor the above mentioned RuntimeDelegate was loaded by the PowerMockito classloader and caused later the issue, that the class was compared against one from a different classloader.

    To get around this issue, tell PowerMockito to ignore the javax.ws package when scanning for classes:

    @PowerMockIgnore({"javax.ws.*"})
    

提交回复
热议问题