baidu_31945865
2018-03-15 12:54 阅读 16.2k

intellij idea下运行正常,用maven->package打包时失败,搞了半天没解决,求问

5

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/SystemException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]//字数限制,贴不完

还有一个:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:107) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]

结果:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.203 s <<< FAILURE! - in com.gdufs.mango.MangoApplicationTests
[ERROR] contextLoads(com.gdufs.mango.MangoApplicationTests) Time elapsed: 0.004 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/SystemException
Caused by: java.lang.NoClassDefFoundError: javax/transaction/SystemException
Caused by: java.lang.ClassNotFoundException: javax.transaction.SystemException

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • MonkeyBrothers 小猴子的技术笔记 2018-03-15 16:27

    你是不是点错了呢?idea好像是第一个目录里面的install

    点赞 评论 复制链接分享
  • Amo_lt Amo_lt 2018-03-16 02:05

    少了jta.jar包

    点赞 评论 复制链接分享
  • baidu_31945865 对韭当割_人生几何 2018-03-27 01:12

    感谢各位,问题已经解决了,我在pom.xml把一个不用的依赖干掉后,package就成功了。

    点赞 评论 复制链接分享

相关推荐