title: How to handle MongoDB codec error when decoding an inherited generics list of lists in java?
body: <p>I keep getting the following error when trying to deserialize an object containing a generic <code>List&lt;List&lt;T&gt;&gt;</code>: </p>
  
  <p><code>org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.lang.Object</code></p>
  
  <p>I found that the exception is thrown when trying to deserialize the list, however if I change the field to be <code>List&lt;T&gt;</code>, it works. Please see the code below.</p>
  
  <p>I have the following Java pojos (with getters and setters):</p>
  
  <pre><code>public class A&lt;T&gt; {
      private List&lt;List&lt;T&gt;&gt; values;
  }
  
  public class B extends A&lt;Float&gt;{
      @BsonId
      private Integer id;
  }
  </code></pre>
  
  <p>My MongoDB client is configured with the following codec registry:</p>
  
  <pre><code>CodecRegistry codecRegistry = fromRegistries(MongoClientSettings.getDefaultCodecRegistry(),
          fromProviders(PojoCodecProvider.builder()
              .conventions(Collections.singletonList(Conventions.ANNOTATION_CONVENTION))
              .automatic(true)
              .build()));
  </code></pre>
  
  <p>When I change the classes to the following structure, everything works:</p>
  
  <pre><code>public class A&lt;T&gt; {
      private List&lt;T&gt; values;
  }
  
  
  public class B extends A&lt;List&lt;Float&gt;&gt;{
      @BsonId
      private Integer id;
  }
  </code></pre>
  
  <p>I excpect Mongo to support Generics at any level, but instead I get the following stacktrace:</p>
  
  <pre><code>Caused by: org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class java.lang.Object.
      at org.bson.codecs.configuration.CodecCache.getOrThrow(CodecCache.java:46)
      at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:63)
      at org.bson.codecs.configuration.ProvidersCodecRegistry.get(ProvidersCodecRegistry.java:37)
      at org.bson.codecs.pojo.FallbackPropertyCodecProvider.get(FallbackPropertyCodecProvider.java:38)
      at org.bson.codecs.pojo.PropertyCodecRegistryImpl.get(PropertyCodecRegistryImpl.java:44)
      at org.bson.codecs.pojo.CollectionPropertyCodecProvider.get(CollectionPropertyCodecProvider.java:37)
      at org.bson.codecs.pojo.PropertyCodecRegistryImpl.get(PropertyCodecRegistryImpl.java:44)
      at org.bson.codecs.pojo.CollectionPropertyCodecProvider.get(CollectionPropertyCodecProvider.java:37)
      at org.bson.codecs.pojo.PropertyCodecRegistryImpl.get(PropertyCodecRegistryImpl.java:44)
      at org.bson.codecs.pojo.PojoCodecImpl.addToCache(PojoCodecImpl.java:211)
      at org.bson.codecs.pojo.PojoCodecImpl.specialize(PojoCodecImpl.java:80)
  </code></pre>