Skip to content

java.lang.NullPointerException at org.springframework.test.web.servlet.result.MockMvcResultHandlers.<clinit>(MockM‌​vcResultHandlers.java:44) [SPR-13802] #18375

@spring-projects-issues

Description

@spring-projects-issues

Matthew D'Andrea opened SPR-13802 and commented

java.lang.NullPointerException at org.springframework.test.web.servlet.result.MockMvcResultHandlers.<clinit>(MockM‌​vcResultHandlers.java:44)

is thrown when making use of MockMvcResultHandlers.print() in one of my JUnit 4.11 tests.

Line 44 of MockM‌​vcResultHandlers looks like this:
private static final Log logger = LogFactory.getLog(MockMvcResultHandlers.class.getPackage().getName());

I've confirmed that it is the getPackage() call that is returning null.

From what I've read, it might be due to how the class loading works with the maven-surefire-plugin when a forkCount of 0. Unfortunately, I can't update to 1 to verify if that will help getPackage() not return null.


Affects: 4.2.3

Reference URL: http://stackoverflow.com/questions/34316917/spring-4-2-java-lang-noclassdeffounderror-could-not-initialize-class-org-sprin/34318307#34318307

Referenced from: commits 935c0a4

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions