java.lang.LinkageError: loader constraint violation: when resolving method

java.lang.LinkageError: loader constraint violation: when resolving method "com.liferay.portal.service.UserLocalServiceUtil.addUser(JJZLjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;JLjava/lang/String;Ljava/util/Locale;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIZIIILjava/lang/String;[J[J[J[JZLcom/liferay/portal/service/ServiceContext;)Lcom/liferay/portal/model/User;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, cn/gewut/portal/service/impl/DatasIncrementImpl, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for the method's defining class, com/liferay/portal/service/UserLocalServiceUtil, have different Class objects for the type com/liferay/portal/service/ServiceContext used in the signature

今天打开eclipse的时候,出现如下错误

java.lang.LinkageError: loader constraint violation: when resolving method "com.liferay.portal.service.UserLocalServiceUtil.addUser(JJZLjava/lang/String;Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;JLjava/lang/String;Ljava/util/Locale;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIZIIILjava/lang/String;[J[J[J[JZLcom/liferay/portal/service/ServiceContext;)Lcom/liferay/portal/model/User;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, cn/gewut/portal/service/impl/DatasIncrementImpl, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for the method's defining class, com/liferay/portal/service/UserLocalServiceUtil, have different Class objects for the type com/liferay/portal/service/ServiceContext used in the signature


这个错误通常是因为包冲突,比如tomcat加载的包和项目包冲突

经过排查,我这里是因为axis.jar和servlet-api.jar,这两个包冲突。将axis这个包删掉即可。


如果您觉得本文章对您有用,也为了更好的运营博客,您可以点击这里捐助

评论 抢沙发

昵称 (必填) 邮箱 (必填)
表情