我正在使用ehcache-core-ee-2.6.11.jar和ehcache-terracotta-ee-2.6.11.jar并获得以下异常: 还尝试了vm选项: - add-modules jdk.unsupported但不能正常工作。
Caused by: net.sf.ehcache.CacheException: java.lang.NoClassDefFoundError: sun/misc/VM
at net.sf.ehcache.CacheManager.init(CacheManager.java:401)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:259)
at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1037)
at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:818)
at net.sf.ehcache.CacheManager.create(CacheManager.java:799)
at net.sf.ehcache.CacheManager.getInstance(CacheManager.java:833)
at com.softwareag.ecp.cache.EhcacheEngine.<init>(EhcacheEngine.java:67)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
... 61 more
Caused by: java.lang.NoClassDefFoundError: sun/misc/VM
at org.terracotta.ehcachedx.util.Vm.maxDirectMemory(Vm.java:195)
at org.terracotta.license.ehcache.LicenseManager.verifyOffHeapUsage(LicenseManager.java:148)
at net.sf.ehcache.EnterpriseFeaturesManager.createStore(EnterpriseFeaturesManager.java:117)
at net.sf.ehcache.Cache.initialise(Cache.java:1103)
at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1306)
at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1337)
at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:758)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:459)
at net.sf.ehcache.CacheManager.init(CacheManager.java:377)
... 72 more
Caused by: java.lang.ClassNotFoundException: sun.misc.VM
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
... 81 more
答案 0 :(得分:0)
版本2.6.11真的很旧。最新版本可能有用。此外,您似乎使用企业功能。您应该查看有关如何解决Java 9的相应支持。