I’ve integrated the Box Java SDK (v4.11.1) into my Spring Boot application:
<dependency> <groupId>com.box</groupId> <artifactId>box-java-sdk</artifactId> <version>4.11.1</version> </dependency>
All required configuration properties (OAuth2 credentials, PEM key, client ID/secret, etc.) have been supplied, but the application fails to start with the following exception:
… 33 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate acom.box.sdk.BoxAPIConnection]: Factory method ‘boxAPIConnection’ threw exception; nested exception is java.lang.NullPointerException: Cannot invoke “org.bouncycastle.openssl.PEMKeyPair.getPrivateKeyInfo()” because “keyPair” is null at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) … 47 common frames omitted
I would appreciate any guidance on troubleshooting this NullPointerException
during the BoxAPIConnection
bean instantiation. Thank you for your assistance.