Junit failure : org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class [Ljava.lang.String;

For the assignment , getMoviesByCountry method in MovieDao.java

but junit fails with below error :slight_smile:

org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for class [Ljava.lang.String;.

on this line of code which i have written :slight_smile:
moviesCollection.find(queryFilter).projection(projection).iterator().forEachRemaining(movies::add);

Hi @REX_ALLWYN_JEGAN_XAVIER_PRINCE_85158,

This error is usually because of issues with the query filters you might have created. Please check the whole query and variables used.

Kanika

I passed by same problem.

Hi @daaneto,

Please share the query you used.

Kanika

My solution was:

Bson queryFilter = new Document(“countries”, new Document("$all", Arrays.asList(country)));

Now it’s working.

Thank’s.