Original Reporter: lstanden
Environment: Not Specified
Version: 2.0.0
Migrated From: https://jira.spring.io//browse/LDAP-295
I was trying to leverage Spring LDAP 2.0 within a self contained JAR project (basically, a WAR which is packaged in a JAR file using the maven shade plugin). When doing so, I get the following exception:
Caused by: java.lang.NullPointerException: null
at org.springframework.ldap.odm.core.impl.DefaultObjectDirectoryMapper.isAtLeast30(DefaultObjectDirectoryMapper.java:80)
Tracing this back, I determined the following call was failing:
Original Reporter: lstanden Environment: Not Specified Version: 2.0.0 Migrated From: https://jira.spring.io//browse/LDAP-295 I was trying to leverage Spring LDAP 2.0 within a self contained JAR project (basically, a WAR which is packaged in a JAR file using the maven shade plugin). When doing so, I get the following exception:
Caused by: java.lang.NullPointerException: null at org.springframework.ldap.odm.core.impl.DefaultObjectDirectoryMapper.isAtLeast30(DefaultObjectDirectoryMapper.java:80)
Tracing this back, I determined the following call was failing:
{code} private boolean isAtLeast30() { return SpringVersion.getVersion().compareTo("3.0") > 0; } {code}
According to the Spring API documentation, it's perfectly valid for getVersion to return null, but this code doesn't check for that scenario.
There needs to be some fallback scenario for this code to handle that issue.