Reputation: 26
I am trying to deploy my Spring MVC app in CloudFoundry using a Redis service. I use Java Configuration where I call the Cloudfoundry CloudEnvironment getServiceInfo method for retrieving the instantiated Redis service. The app stages ok, but won't start giving a Nullpointer in the CF class:
Caused by: java.lang.NullPointerException
at org.cloudfoundry.runtime.env.CloudEnvironment.getServiceInfo(CloudEnvironment.java:150)
I searched a lot for clues on this problem, but was unable to find any. I bet I am missing something, and my experience is that the more puzzling an issue is, the more obvious the mistake. But I really could use some pointers. Any thoughts? Thanks.
Jeroen
Upvotes: 1
Views: 178
Reputation: 1270
I believe the answer to your issue was because your code was missing a postgres service as well! The nullpointer exception in your case wasn't for the redis server you binded to your app but for the postgres server.
You have to be sure all the required services for your app are created and binded to the app.
Upvotes: 1