I am using Ehcache as the query cache for hibernate, and following is my Ehcache config.
<cache alias="default-query-results-region">
<key-type>org.hibernate.cache.spi.QueryKey</key-type>
<value-type>java.lang.Object</value-type>
<expiry>
<ttl unit="seconds">30</ttl>
</expiry>
<resources>
<heap unit="MB">1</heap>
<offheap unit="MB">2</offheap>
</resources>
</cache>
I get following warning logged to the console when I execute my application.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.ehcache.sizeof.ObjectGraphWalker (file:/C:/Users/<my_username>/.m2/repository/org/ehcache/ehcache/3.9.4/ehcache-3.9.4.jar) to field java.util.ArrayList.elementData
WARNING: Please consider reporting this to the maintainers of org.ehcache.sizeof.ObjectGraphWalker
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
But I don't get a warning if I specify the heap unit as entries
.
<heap unit="entries">2</heap>
Below is the Ehcache version I am using.
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.9.4</version>
</dependency>
Below is from my hibernate config, where I have specified Ehcache as the cache provider.
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.jcache.JCacheRegionFactory</property>
<property name="hibernate.javax.cache.provider">org.ehcache.jsr107.EhcacheCachingProvider</property>
<property name="hibernate.javax.cache.uri">ehcache.xml</property>
I am using OpenJDK 11
.
What is the reason for this warning? Is there any way I can fix it?