title: EhCache No serializer found
body: <p>I am initializing my cache in the following way:</p>
  <pre><code>CacheManager cacheManager;
  
  cacheManager = CacheManagerBuilder.newCacheManagerBuilder().build();
  cacheManager.init();
  
  Cache&lt;String, SmsMessageDto&gt; myCache = cacheManager.createCache(&quot;myCache&quot;, CacheConfigurationBuilder.newCacheConfigurationBuilder(String.class, SmsMessageDto.class)
      .withExpiry(Expirations.timeToLiveExpiration(new Duration(cacheDuration, TimeUnit.MINUTES)))
      .build());
      
  </code></pre>
  <p>Which gives me the following warning:</p>
  <pre><code>org.ehcache.core.EhcacheManager - Could not create serializers for myCache
  org.ehcache.spi.serialization.UnsupportedTypeException: No serializer found for type 'com.example.dto.SmsMessageDto'
      at org.ehcache.impl.internal.spi.serialization.DefaultSerializationProvider$AbstractProvider.getClassFor(DefaultSerializationProvider.java:271) ~[ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.impl.internal.spi.serialization.DefaultSerializationProvider$TransientProvider.createSerializer(DefaultSerializationProvider.java:149) ~[ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.impl.internal.spi.serialization.DefaultSerializationProvider$AbstractProvider.createValueSerializer(DefaultSerializationProvider.java:239) ~[ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.impl.internal.spi.serialization.DefaultSerializationProvider.createValueSerializer(DefaultSerializationProvider.java:96) ~[ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.core.EhcacheManager.getStore(EhcacheManager.java:455) [ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.core.EhcacheManager.createNewEhcache(EhcacheManager.java:308) [ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.core.EhcacheManager.createCache(EhcacheManager.java:261) [ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at org.ehcache.core.EhcacheManager.createCache(EhcacheManager.java:240) [ehcache-3.0.0.rc1.jar:3.0.0.rc1]
      at at.xcard.helper.SmsFailedCache.init(SmsFailedCache.java:45) [classes/:na]
      at at.xcard.SmsWorker.&lt;init&gt;(SmsWorker.java:49) [classes/:na]
      at at.xcard.Main.main(Main.java:36) [classes/:na]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]
      at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na]
              
  </code></pre>
  <p>How can I convince EhCache to use my <code>toString</code> method of the <code>com.example.dto.SmsMessageDto</code> object?</p>