rwinch / spring-ldap

Apache License 2.0
0 stars 0 forks source link

LDAP-295: DefaultObjectDirectoryMapper#isAtLeast30() produces NullPointerException when bundled into an uberjar #22

Closed rwinch closed 8 years ago

rwinch commented 10 years ago

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.

rwinch commented 10 years ago

tbeauvais said: Has this yet been pushed to the 2.0.1.CI-SNAPSHOT because I am still experiencing this error.

rwinch commented 10 years ago

rwinch said: Please try 2.0.1.RELEASE