Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-7454

Disable Surefire/Failsafe trimStackTrace to show full stacktraces

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 9.0.0.CR1, 9.0.0.Final
    • None
    • None

    Description

      Surefire/Failsafe does not show full stack traces by default.

      To give an example, by default stacktraces are being trimmed so in ISPN-7453, the cause was being hidden:

      org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl
          at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
          at java.lang.Class.getDeclaredMethods0(Native Method)
          at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
          at java.lang.Class.privateGetPublicMethods(Class.java:2902)
          at java.lang.Class.getMethods(Class.java:1615)
          at org.infinispan.commons.util.Util.getFactoryMethod(Util.java:220)
          at org.infinispan.commons.util.Util.getInstanceStrict(Util.java:259)
          at org.infinispan.commons.util.Util.getInstance(Util.java:238)
          at org.infinispan.persistence.factory.LocalClassLoaderCacheStoreFactory.createInstance(LocalClassLoaderCacheStoreFactory.java:25)
          at org.infinispan.persistence.factory.CacheStoreFactoryRegistry.createInstance(CacheStoreFactoryRegistry.java:39)
          at org.infinispan.persistence.manager.PersistenceManagerImpl.createLoadersAndWriters(PersistenceManagerImpl.java:592)
          at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:148)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
          at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:867)
          at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:633)
          at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:622)
          at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:547)
          at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:231)
          at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:803)
          at org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:411)
          at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:638)
          at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:586)
          at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:450)
          at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:429)
          at org.infinispan.all.embedded.EmbeddedAllTest.testAllEmbeddedJpaStore(EmbeddedAllTest.java:102)
      

      Surefire/Failsafe plugin have an option called trimStackTrace which is enabled by default. When this option is disabled, the full stacktrace is reported:

      testAllEmbeddedJpaStore(org.infinispan.all.embedded.EmbeddedAllTest)  Time elapsed: 0.013 sec  <<< ERROR!
      org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.persistence.manager.PersistenceManagerImpl.start() on object of type PersistenceManagerImpl
      	at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:172)
      	at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:867)
      	at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:633)
      	at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:622)
      	at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:547)
      	at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:231)
      	at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:803)
      	at org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:411)
      	at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:638)
      	at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:586)
      	at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:450)
      	at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:429)
      	at org.infinispan.all.embedded.EmbeddedAllTest.testAllEmbeddedJpaStore(EmbeddedAllTest.java:102)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      Caused by: java.lang.NoClassDefFoundError: org/hibernate/criterion/Projection
      	at java.lang.Class.getDeclaredMethods0(Native Method)
      	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      	at java.lang.Class.privateGetPublicMethods(Class.java:2902)
      	at java.lang.Class.getMethods(Class.java:1615)
      	at org.infinispan.commons.util.Util.getFactoryMethod(Util.java:220)
      	at org.infinispan.commons.util.Util.getInstanceStrict(Util.java:259)
      	at org.infinispan.commons.util.Util.getInstance(Util.java:238)
      	at org.infinispan.persistence.factory.LocalClassLoaderCacheStoreFactory.createInstance(LocalClassLoaderCacheStoreFactory.java:25)
      	at org.infinispan.persistence.factory.CacheStoreFactoryRegistry.createInstance(CacheStoreFactoryRegistry.java:39)
      	at org.infinispan.persistence.manager.PersistenceManagerImpl.createLoadersAndWriters(PersistenceManagerImpl.java:592)
      	at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:148)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
      	... 38 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.criterion.Projection
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 54 more
      
      
      Results :
      
      Tests in error:
        EmbeddedAllTest.testAllEmbeddedJpaStore:102 » Cache Unable to invoke method pu...
      

      Change all surefire/failsafe definitions to have trimStackTrace disable

      Attachments

        Issue Links

          Activity

            People

              gzamarre Galder Zamarreño
              gzamarre Galder Zamarreño
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: