maven 项目 nested exception is java.lang.RuntimeException: error trying to sc

018-12-06 08:55:37,246-INFO-RMI TCP Connection(2)-127.0.0.1-DruidDataSource.java-close-1712:{dataSource-1} closed
2018-12-06 08:55:37,250-ERROR-RMI TCP Connection(2)-127.0.0.1-ContextLoader.java-initWebApplicationContext-331:Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [config/spring/aContext_db.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: error trying to scan <jar-file>: file:/E:/ideaworkspace/YunPayService_realtimerptdata_20181205/target/YunPayService/WEB-INF/classes/
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)

错误信息如上图,前提简介:

项目jar:hibernate+struts2+spring,jar包采用maven管理。项目在别的其它同事机器上运行没有任何问题,在出错同事的eclipse上运行也没有问题,就是在他的idea上运行有问题。

从错误信息上看,创建entityManagetFactory错误,利用idea maven help插件分析冲突插件并没有发现jar包冲突。随后在google上搜索相关错误 error trying to scan <jar-file>,并进行相关尝试,第一篇帖子看到如下:

搜索项目中,发现这个包在hibernate-code 和struts-core中均存在,将struts-code中的给排除掉,再次启动正常运行了。在次回来分析问题:在其它同事(windows)和我本地(linux)运行均没有出现上述错误,但是在这哥们这出现了,idea\tomcat\jdk版本均一致,只有maven版本不一致,尝试升级maven版本,运行还是上述错误。然后就先暂时将将struts-code中的 javassist给排除掉。

猜你喜欢

转载自blog.csdn.net/shenchengxinsunwei/article/details/84849533