为什么Java仍然找到旧方法,即使我将及其库库更新为较新版本?
我需要在项目中迁移第三方库 - 让我们称其为myProject
。
myproject ---使用--->企业库a ---使用---> mule-core v3.4
我正在使用maven,我将所有m子依赖项排除在库a中,而是用mule-core
v3.9代替。不过,即使生成的胖罐仅包含mule-core
v3.9,我仍然看到该应用程序加载了org.mule.util.util.attributeevaluator 课。
看来,该类,用mule-core v3.4
用于包含以下方法:
public void initialize(final ExpressionManager expressionManager)
在mule-core 3.9中,该方法将其签名更改为以下:
public AttributeEvaluator initialize(final ExpressionManager expressionManager)
由于此更改,因此企业库一个错误的失败:
Caused by: java.lang.NoSuchMethodError: org.mule.util.AttributeEvaluator.initialize(
Lorg/mule/api/expression/ExpressionManager;)V
我发现唯一可以使用的解决方案是将企业库A的源代码带入我的项目的源代码,并以正确的依赖性对mule-core再次编译。 v3.9
,但我敢肯定有一种更好的方法。
你有什么建议吗?
I need to migrate a third party library in a project - let's call it MyProject
.
MyProject ---uses---> Enterprise library A ---uses---> mule-core v3.4
I'm using Maven and I excluded all mule dependencies from library A, replacing it with mule-core
v3.9 instead. Still, even if the fat jar that's generated contains only mule-core
v3.9, I still see that the application loads an old version of the org.mule.util.AttributeEvaluator
class.
It seems that this class, in mule-core v3.4
used to contain the following method:
public void initialize(final ExpressionManager expressionManager)
In mule-core 3.9, the method changed its signature to the following:
public AttributeEvaluator initialize(final ExpressionManager expressionManager)
Because of this change, the enterprise library A fails with the following error:
Caused by: java.lang.NoSuchMethodError: org.mule.util.AttributeEvaluator.initialize(
Lorg/mule/api/expression/ExpressionManager;)V
The only solution that I found to be working was to bring the source code of Enterprise Library A into the source code of my project and to compile it again with the correct dependency to mule-core v3.9
, but I'm sure that there is a better way.
Do you have any suggestions ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论