问题
When I run a Junit test and it fails, if the stacktace is super long, Intellij always cuts it off a the end with "... x More". How can I make IntelliJ show the entire stacktrace?
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
回答1:
I think, the "... x more" message occurs only when you have exceptions which are wrapped by the previous exception. it means that the last x lines of the initial exception are the same as x lines missing in the caused by exception. It has nothing todo with IntelliJ. The jvm avoids repeating the trace info, as it does not provide new info.
see also this answer
来源:https://stackoverflow.com/questions/17216411/make-intellij-show-full-stack-trace-during-failed-junit-test