java.lang.IllegalArgumentException: contextLoader can not be null.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

If you're unit testing, you should instantiate only the service and mock the dependencies. If you're testing integration, you should add all the mocking to the configurations file.

Solutions on the web

via Spring JIRA by Chris Beams, 1 year ago
contextLoader can not be null.
via Spring JIRA by Chris Beams, 1 year ago
contextLoader can not be null.
via Stack Overflow by John
, 1 year ago
[Assertion failed] - this argument is required; it must not be null
via Spring JIRA by Karel Kremer, 1 year ago
'source' must not be null
java.lang.IllegalArgumentException: contextLoader can not be null.
at org.springframework.test.context.TestContext.buildApplicationContext(TestContext.java:176)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:216)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:58)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:205)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:109)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)

Users with the same issue

2 times, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
196 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.