14

当我运行 Junit 测试但它失败时,如果 stacktace 超长,Intellij 总是用“... x More”将其切断。如何让 IntelliJ 显示整个堆栈跟踪?

Caused by: java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
    at org.hibernate.ejb.util.LogHelper.logPersistenceUnitInfo(LogHelper.java:38)
    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:526)
    at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:257)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
    ... 54 more


Process finished with exit code 255
4

1 回答 1

2

我认为,只有当您有被前一个异常包装的异常时,才会出现“... x more”消息。这意味着初始异常的最后 x 行与由异常引起的缺失 x 行相同。它与 IntelliJ 无关。jvm 避免重复跟踪信息,因为它不提供新信息。

另见这个答案

于 2018-12-27T21:28:50.603 回答