»»»»

org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run errorsSpring TestContext Framework

Top patterns

  1. NPE when use @SpringBootTest and @WebAppConfiguration

    You don't need @WebAppConfiguration with @SpringBootTest support.

    So just delete @WebAppConfiguration, and then...

    • if you want a mocked WebApplicationContext -- for example, to use MockMvc -- use @SpringBootTest with the default webEnvironment (which is WebEnvironment.MOCK).
    • if you want your web application to actually be deployed in an embedded Servlet container -- for example, to test with TestRestTemplate -- use @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) or @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
  2. Could not initialize class MockReset

    Need to check junit and mockito versions. This usually happens when there is a conflict between spring dependencies and junit and mockito.

    If you are using spring-boot-starter-test, you can remove junit and mockito dependencies because spring-boot-starter-test will provide the rights versions of these dependencies.

  3. SpringJUnit4ClassRunner has thrown a NoSuchMethodError

    Need to check spring versions. This usually happens when there is a conflict between spring-tx and spring-test

Error patternsExceptions
DescriptionException TypeEntry MethodWeb pages

NPE when use @SpringBootTest and @WebAppConfiguration

java.lang.NullPointerException
27 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
3Web pages
1Solution
IllegalStateExceptionSpringJUnit4ClassRunner.run3

Could not initialize class MockReset

java.lang.IllegalAccessError
17 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
2Web pages
1Solution
IllegalAccessErrorSpringJUnit4ClassRunner.run2

SpringJUnit4ClassRunner has thrown a NoSuchMethodError

java.lang.NoSuchMethodError
15 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
2Web pages
1Solution
NoSuchMethodErrorSpringJUnit4ClassRunner.run2

SpringJUnit4ClassRunner has thrown a NoClassDefFoundError

java.lang.NoClassDefFoundError
15 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
2Web pages
1Solution
NoClassDefFoundErrorSpringJUnit4ClassRunner.run2

Conflicting versions of spring-core and spring-boot

java.lang.IllegalAccessError
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
1Web pages
1Solution
IllegalAccessErrorSpringJUnit4ClassRunner.run1

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
23 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a BusinessException

com.agipi.commons.exception.BusinessException
40 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
BusinessExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
23 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
26 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
23 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a KotlinNullPointerException

kotlin.KotlinNullPointerException
27 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
KotlinNullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
47 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an UnsupportedOperationException

java.lang.UnsupportedOperationException
46 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
UnsupportedOperationExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an IllegalStateException

java.lang.IllegalStateException
47 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
IllegalStateExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
23 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
37 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AbstractMethodError

java.lang.AbstractMethodError
48 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AbstractMethodErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NoViableAltException

antlr.NoViableAltException
81 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NoViableAltExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an IllegalStateException

java.lang.IllegalStateException
48 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
IllegalStateExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
25 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an UnsupportedOperationException

java.lang.UnsupportedOperationException
46 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
UnsupportedOperationExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a JiscdRuntimeException

sk.jiscd.base.JiscdRuntimeException
46 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
JiscdRuntimeExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
35 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an IllegalStateException

java.lang.IllegalStateException
47 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
IllegalStateExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
25 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
25 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
23 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an IllegalArgumentException

java.lang.IllegalArgumentException
30 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
IllegalArgumentExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown an AssertionError

java.lang.AssertionError
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
AssertionErrorSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
24 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a SVNException

org.tmatesoft.svn.core.SVNException
27 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
SVNExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a NullPointerException

java.lang.NullPointerException
33 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
NullPointerExceptionSpringJUnit4ClassRunner.run0

SpringJUnit4ClassRunner.run() has thrown a CertificateException

java.security.cert.CertificateException
26 frames hidden
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run
0Web pages
CertificateExceptionSpringJUnit4ClassRunner.run0
Nothing to list here.