下午在試用JDom操作XML時(shí),老是跑出一個(gè)異常:
org.jdom.JDOMException: java.lang.VerifyError: (class: org/jaxen/jdom/DocumentNavigator, method: getTextStringValue signature: (Ljava/lang/Object;)Ljava/lang/String;) Incompatible object argument for function call: (class: org/jaxen/jdom/DocumentNavigator, method: getTextStringValue signature: (Ljava/lang/Object;)Ljava/lang/String;) Incompatible object argument for function call
查了好久,終于找到下面一段話,指出方向:
原文截取:
Now, I tried to find the class TransformServlet... not an easy one to find,
since we don't
know the package name... is it org.apache.xml, org.apache.xalan, javax.xml,
javax.servlet, etc...
I haven't been able to find it on my system....
My guess is that you have two copies of this file... but I am not sure
where...
I wouldn't suggest replacing a FILE inside a jar... but figuring out which
jar is causing the conflict
and seeing if you can (temporarily) remove that conflicting jar to get the
problem to go away...
since we don't
know the package name... is it org.apache.xml, org.apache.xalan, javax.xml,
javax.servlet, etc...
I haven't been able to find it on my system....
My guess is that you have two copies of this file... but I am not sure
where...
I wouldn't suggest replacing a FILE inside a jar... but figuring out which
jar is causing the conflict
and seeing if you can (temporarily) remove that conflicting jar to get the
problem to go away...
原來是因?yàn)榭赡艽嬖诙鄠€(gè)JDom.jar引起的方法調(diào)用不清.再回過頭查下項(xiàng)目的path設(shè)置,果然存在另一個(gè)jdom.jar(63k),而我的項(xiàng)目下的jdom.jar是150k.原來版本不同,將原來的包覆蓋,再運(yùn)行,一切正常.
這么個(gè)問題,花了1個(gè)多小時(shí),搞死了.