Я использую версию «1.7.0_79». Получения следующего исключенияПолучение java.lang.ClassCastException со всеми классами сущности Hibernate для ehcache
2016-11-17 16:42:54,127 : ERROR: net.sf.ehcache.store.disk.DiskStorageFactory - Disk Write of
data_member_keys не удался: java.lang.ClassCastException: sun.reflect.GeneratedSerializationConstructorAccessor1 не может быть брошен к sun.reflect.SerializationConstructorAccessorImpl в sun.reflect.MethodAccessorGenerator.generateSerializationConstructor (MethodAccessorGenerator .java: 113) at
enter code here
sun.reflect.ReflectionFactory.newConstructorForSerialization (ReflectionFactory.java:331) at java.io.ObjectStreamClass.getSerializableConstructor (ObjectStreamClass.java:1376) at java.io.ObjectStreamClass.access $ 1500 (ObjectStreamClass.java:72) at java.io.ObjectStreamClass $ 2.run (ObjectStreamClass.java:493) at java.io.ObjectStreamClass $ 2.run (ObjectStreamClass.java:468) на java.security.AccessController.doPrivileged (нативный метод) на java.io.ObjectStreamClass. (ObjectStreamClass.java:468) в java.io.ObjectStreamClass.lookup (ObjectStreamClass.java:365) в java.io .ObjectOutputStream.writeObject0 (ObjectOutputStream.java:1133) в java.io.ObjectOutputStream.writeObject (ObjectOutputStream.java:347) в net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize (MemoryEfficientByteArrayOutputStream.java:97) в сети .sf.ehcache.store.disk.Disk StorageFactory.serializeElement (DiskStorageFactory.java:405) at net.sf.ehcache.store.disk.DiskStorageFactory.write (DiskStorageFactory.java:384) at net.sf.ehcache.store.disk.DiskStorageFactory $ DiskWriteTask.call (DiskStorageFactory.java:40) DiskStorageFactory.java:485) at net.sf.ehcache.store.disk.DiskStorageFactory $ PersistentDiskWriteTask.call (DiskStorageFactory.java:1088) at net.sf.ehcache.store.disk.DiskStorageFactory $ PersistentDiskWriteTask.call (DiskStorageFactory. Java: 1072) на java.util.concurrent.FutureTask.run (FutureTask.java:262) в java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201 (ScheduledThreadPoolExecutor.java:178) на java.util.concurrent .ScheduledThreadPoolExecutor $ ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:292) на java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145) на java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:615) на java.lang.Thread.run (Thread. Java: 745)
jpa.xml
<bean id="myEmf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="com.abc.xyz" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.connection.isolation">2</prop>
<!-- should be turned off in production -->
<prop key="hibernate.generate_statistics">false</prop>
<!-- This is the provider for Ehcache provided by Hibernate, using the "old" SPI -->
<prop key="hibernate.cache.provider_configuration_file_resource_path">/ehcache.xml</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop>
<prop key="hibernate.cache.use_second_level_cache">true"</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
</props>
</property>
</bean>
ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
<diskStore path="java.io.tmpdir"/>
<cache name="org.hibernate.cache.spi.UpdateTimestampsCache"
maxElementsInMemory="50000"
eternal="true"
overflowToDisk="true"/>
<cache name="org.hibernate.cache.internal.StandardQueryCache"
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
<defaultCache
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>
кто-нибудь знает какие-либо решения для этого.
Добро пожаловать в переполнение стека! Пожалуйста, напишите код, который вы используете, что создает проблему. –