Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No suitable ServiceConnectorCreator found #26

Closed
ryanjbaxter opened this issue Apr 30, 2014 · 2 comments
Closed

No suitable ServiceConnectorCreator found #26

ryanjbaxter opened this issue Apr 30, 2014 · 2 comments

Comments

@ryanjbaxter
Copy link

I am using the Cloud.getServiceConnector API to get an instance of MongoServiceInfo in a non-spring app deployed to CF but the API is throwing an exception saying no suitable ServiceConnectorCreator found. When I call cloud.getServiceInfo() I see the service in the list with the correct id and I can cast it to an an instance of MongoServiceInfo. Any idea why I would be getting this error?

@ramnivas
Copy link
Contributor

@ryanjbaxter Cloud.getServiceConnector() isn't meant to be used to get a ServiceInfo, but rather a service connector (such as MongoDbFactory) without the need to access ServiceInfo (typical Spring usage). If you need just the MongoServiceInfo, then getServiceInfos(MongoServiceInfo.class) is the way to go.

If you are trying to create a service connector other than MongoDbFactory (say from a non-spring library) and don't want to access ServiceInfo directly, you may register your own creator. Follow the trail starting at https://github.com/spring-projects/spring-cloud/blob/master/spring-service-connector/src/main/resources/META-INF/services/org.springframework.cloud.service.ServiceConnectorCreator (spring-cloud's extensibility mechanism)

@ryanjbaxter
Copy link
Author

OK makes more sense. Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants