Add null check in TypeManagerImpl
Add ehcache.xml

To eliminate warning logs.
The configuration is default and doesn't affect DAO service caches.
Fix bug of the same value in sorting