Unable to fetch movies in M220J

After successful installation ,and running the mflix application in STS IDE.When am trying to run the local host:5000 am getting the unable to fetch the movie list in the UI page.

Can someone help

Hi @Sai_69467,

Please check the console log for errors, also make sure your cluster has the data in it.

Kanika

@Kanika

I have attached my console logs here
675 INFO 8436 — [nio-5000-exec-6] org.mongodb.driver.cluster : Cluster description not yet available. Waiting for 30000 ms before timing out
2019-08-28 12:35:11.679 INFO 8436 — [nio-5000-exec-7] org.mongodb.driver.cluster : Cluster description not yet available. Waiting for 30000 ms before timing out
2019-08-28 12:35:41.735 ERROR 8436 — [nio-5000-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path threw exception [Request processing failed; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address:27017=cluster0-shard-00-01-azgkk.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]] with root cause

com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address:27017=cluster0-shard-00-01-azgkk.mongodb.net, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]
at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:179) ~[mongodb-driver-core-3.9.1.jar:na]
at com.mongodb.internal.connection.SingleServerCluster.getDescription(SingleServerCluster.java:41) ~[mongodb-driver-core-3.9.1.jar:na]
at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:136) ~[mongodb-driver-sync-3.9.1.jar:na]
at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:94) ~[mongodb-driver-sync-3.9.1.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:249) ~[mongodb-driver-sync-3.9.1.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:172) ~[mongodb-driver-sync-3.9.1.jar:na]
at com.mongodb.client.internal.MongoIterableImpl.execute(MongoIterableImpl.java:132) ~[mongodb-driver-sync-3.9.1.jar:na]
at com.mongodb.client.internal.MongoIterableImpl.iterator(MongoIterableImpl.java:86) ~[mongodb-driver-sync-3.9.1.jar:na]

And also in the application properties

spring.mongodb.uri=mongodb://username:password@cluster0-*********.mongodb.net:27017

Please check the connection string in application.properties file. Also make sure that you are able to connect to the cluster from your system.

Kanika

@Kanika
Thanks now its working