我的java应用程序在类org.apache.htrace.shaded.commons.logging.impl.LogFactoryImpl
上强制转换class not exception
,从IDEA中我可以看到这个类可以在我的依赖项中找到:
但是当我进入jar时,包org.apache.htrace.shaded.commons.logging
中只剩下一些类,并且没有impl
包:
jar -tf GIS-1.0-SNAPSHOT.jar | fgrep org/apache/htrace/shaded/commons
org/apache/htrace/shaded/commons/
org/apache/htrace/shaded/commons/logging/
org/apache/htrace/shaded/commons/logging/Log.class
org/apache/htrace/shaded/commons/logging/LogConfigurationException.class
org/apache/htrace/shaded/commons/logging/LogFactory$1.class
org/apache/htrace/shaded/commons/logging/LogFactory$2.class
org/apache/htrace/shaded/commons/logging/LogFactory$3.class
org/apache/htrace/shaded/commons/logging/LogFactory$4.class
org/apache/htrace/shaded/commons/logging/LogFactory$5.class
org/apache/htrace/shaded/commons/logging/LogFactory$6.class
org/apache/htrace/shaded/commons/logging/LogFactory.class
此外,一些和其他类存在,这是不是在上面的图片。和类我想要的LogFactoryImpl
不存在,所以class not found
异常发生。
我已经分析了Maven的依赖关系,并确定没有冲突。我可以做些什么来解决这个问题?
1条答案
按热度按时间wpx232ag1#
我已经修好了。
这是由于maven阴影插件的版本的东西。
我在pom.xml中没有设置
version
,所以出现了一些奇怪的情况,设置了version
之后,问题就解决了。