com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'bad sort specification' on server localhost:27017]

Hot problem!
This exception has a lot of traffic. You can help 11 users by writing a short tip.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Google Groups by srinivas seema, 1 year ago
Query failed with error code 2 and error message 'bad sort specification' on server localhost:27017]
com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'bad sort specification' on server localhost:27017
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:493)
at com.mongodb.operation.FindOperation$1.call(FindOperation.java:483)
at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:241)
at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:214)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:483)
at com.mongodb.operation.FindOperation.execute(FindOperation.java:80)
at com.mongodb.Mongo.execute(Mongo.java:818)
at com.mongodb.Mongo$2.execute(Mongo.java:805)
at com.mongodb.OperationIterable.iterator(OperationIterable.java:47)
at com.mongodb.OperationIterable.forEach(OperationIterable.java:70)
at com.mongodb.FindIterableImpl.forEach(FindIterableImpl.java:158)
at com.nazara.ngdp.TableauServiceHelper.MongoDataAccessor.readCollection(MongoDataAccessor.java:70)
at com.nazara.ngdp.TableauServiceHelper.ScheduleTableauJob.execute(ScheduleTableauJob.java:68)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

Users with the same issue

Once, 6 months ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.