IllegalAccessException on Embeddable ID after serializing Getter in cache key

Description

In our production environment we periodically(and often) have some exceptions like:

stack example1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 15:59:16,670 ERROR [InvocationContextInterceptor] (default task-118) ISPN000136: Error executing command GetKeyValueCommand, writing keys []: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private java.lang.Long ru.argustelecom.system.personal.model.WorksiteWorkerPK.workerId] by reflection for persistent property [ru.argustelecom.system.personal.model.WorksiteWorkerPK#workerId] : ru.argustelecom.system.personal.model.WorksiteWorkerPK@e0b06848 at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:43) at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:58) at org.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:419) at org.hibernate.type.ComponentType.isEqual(ComponentType.java:183) at org.hibernate.cache.internal.OldCacheKeyImplementation.equals(OldCacheKeyImplementation.java:83) at org.hibernate.internal.util.compare.EqualsHelper.equals(EqualsHelper.java:31) at org.hibernate.type.descriptor.java.AbstractTypeDescriptor.areEqual(AbstractTypeDescriptor.java:70) at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:182) at org.hibernate.cache.infinispan.TypeEquivalance.equals(TypeEquivalance.java:29) at org.infinispan.commons.util.concurrent.jdk8backported.EquivalentConcurrentHashMapV8.get(EquivalentConcurrentHashMapV8.java:952) at org.infinispan.container.DefaultDataContainer.get(DefaultDataContainer.java:188) at org.infinispan.container.EntryFactoryImpl.innerGetFromContainer(EntryFactoryImpl.java:288) at org.infinispan.container.EntryFactoryImpl.getFromContainer(EntryFactoryImpl.java:258) at org.infinispan.container.EntryFactoryImpl.wrapEntryForReading(EntryFactoryImpl.java:64) at org.infinispan.interceptors.EntryWrappingInterceptor.visitDataReadCommand(EntryWrappingInterceptor.java:132) at org.infinispan.interceptors.EntryWrappingInterceptor.visitGetKeyValueCommand(EntryWrappingInterceptor.java:123) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataReadCommand(NonTransactionalLockingInterceptor.java:31) at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitGetKeyValueCommand(AbstractLockingInterceptor.java:77) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.CacheMgmtInterceptor.visitDataReadCommand(CacheMgmtInterceptor.java:103) at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:91) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107) at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:76) at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:85) at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:40) at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:411) at org.infinispan.cache.impl.CacheImpl.get(CacheImpl.java:403) at org.infinispan.cache.impl.AbstractDelegatingCache.get(AbstractDelegatingCache.java:286) at org.hibernate.cache.infinispan.access.PutFromLoadValidator.acquirePutFromLoadLock(PutFromLoadValidator.java:279) at org.hibernate.cache.infinispan.access.InvalidationCacheAccessDelegate.putFromLoad(InvalidationCacheAccessDelegate.java:106) at org.hibernate.cache.infinispan.entity.ReadOnlyAccess.putFromLoad(ReadOnlyAccess.java:57) at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:208) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:128) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1132) at org.hibernate.loader.Loader.processResultSet(Loader.java:992) at org.hibernate.loader.Loader.doQuery(Loader.java:930) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:306) at org.hibernate.loader.Loader.loadCollection(Loader.java:2320) at org.hibernate.loader.collection.plan.LegacyBatchingCollectionInitializerBuilder$LegacyBatchingCollectionInitializer.initialize(LegacyBatchingCollectionInitializerBuilder.java:88) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:682) at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:75) at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1991) at org.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:550) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:248) at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:546) at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:133) at org.hibernate.collection.internal.AbstractPersistentCollection$1.doWork(AbstractPersistentCollection.java:162) at org.hibernate.collection.internal.AbstractPersistentCollection$1.doWork(AbstractPersistentCollection.java:147) at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:248) at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:146) at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:143) at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030) at ru.argustelecom.system.personal.model.Worksite.getWorkers(Worksite.java:419) at sun.reflect.GeneratedMethodAccessor4145.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:79) at ru.argustelecom.system.personal.model.Worksite_$$_jvst375_127.getWorkers(Worksite_$$_jvst375_127.java) at ru.argustelecom.wfm.wfmorder.WfmOrderViewModel.isCanUndertake(WfmOrderViewModel.java:347) at sun.reflect.GeneratedMethodAccessor4144.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at javax.el.BeanELResolver.getValue(BeanELResolver.java:241) at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) at com.sun.el.parser.AstValue.getValue(AstValue.java:139) at com.sun.el.parser.AstValue.getValue(AstValue.java:203) at com.sun.el.parser.AstNot.getValue(AstNot.java:63) at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226) at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) at javax.faces.component.html.HtmlCommandButton.isDisabled(HtmlCommandButton.java:190) at org.primefaces.component.commandbutton.CommandButton.resolveStyleClass(CommandButton.java:322) at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeMarkup(CommandButtonRenderer.java:71) at org.primefaces.component.commandbutton.CommandButtonRenderer.encodeEnd(CommandButtonRenderer.java:54) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:114) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:890) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:890) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:114) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:890) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:84) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:71) at org.primefaces.extensions.component.layout.LayoutPaneRenderer.encodeBegin(LayoutPaneRenderer.java:148) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:81) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:71) at org.primefaces.extensions.component.layout.LayoutPaneRenderer.encodeBegin(LayoutPaneRenderer.java:152) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at ru.argustelecom.system.inf.exception.RenderExceptionResponseResetFilter.doFilter(RenderExceptionResponseResetFilter.java:59) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at ru.argustelecom.system.inf.transaction.EmergencyRollbackFilter.doFilter(EmergencyRollbackFilter.java:61) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at ru.argustelecom.system.inf.io.DontCacheDynamicContentFilter.doFilter(DontCacheDynamicContentFilter.java:45) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at ru.argustelecom.system.inf.logging.LogResponseFilter.doFilter(LogResponseFilter.java:80) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at ru.argustelecom.system.inf.logging.LogRequestRaisonDetreFilter.doFilter(LogRequestRaisonDetreFilter.java:70) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.omnifaces.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:122) at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:108) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at ru.argustelecom.system.inf.io.AdditionalSecurityConstraintsHandler.handleRequest(AdditionalSecurityConstraintsHandler.java:48) at ru.argustelecom.system.inf.logging.httpsessionhistory.AuthenticationEventHandler.handleRequest(AuthenticationEventHandler.java:37) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.MetricsHandler.handleRequest(MetricsHandler.java:62) at io.undertow.servlet.core.MetricsChainHandler.handleRequest(MetricsChainHandler.java:59) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalAccessException: Class org.hibernate.property.access.spi.GetterFieldImpl can not access a member of class ru.argustelecom.system.personal.model.WorksiteWorkerPK with modifiers "private" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) at java.lang.reflect.Field.get(Field.java:390) at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:39) ... 170 more

stack2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Caused by: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private ru.argustelecom.rms.resource.account.AccountScope ru.argustelecom.rms.resource.act.usecase.TransferUseCaseKey.destinationScope] by reflection for persistent property [ru.argustelecom.rms.resource.act.usecase.TransferUseCaseKey#destinationScope] : TransferUseCaseKey [transferType=[TransferType id=21], sourceScope=[AccountScope id=6], destinationScope=[AccountScope id=6]] at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:43) at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:58) at org.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:419) at org.hibernate.type.ComponentType.isEqual(ComponentType.java:183) at org.hibernate.cache.internal.OldCacheKeyImplementation.equals(OldCacheKeyImplementation.java:83) at org.hibernate.internal.util.compare.EqualsHelper.equals(EqualsHelper.java:31) at org.hibernate.type.descriptor.java.AbstractTypeDescriptor.areEqual(AbstractTypeDescriptor.java:70) at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:182) at org.hibernate.cache.infinispan.TypeEquivalance.equals(TypeEquivalance.java:29) at org.infinispan.commons.util.concurrent.jdk8backported.EquivalentConcurrentHashMapV8.get(EquivalentConcurrentHashMapV8.java:952) at org.infinispan.container.DefaultDataContainer.peek(DefaultDataContainer.java:183) at org.infinispan.container.EntryFactoryImpl.innerGetFromContainer(EntryFactoryImpl.java:278) at org.infinispan.container.EntryFactoryImpl.getFromContainer(EntryFactoryImpl.java:258) at org.infinispan.container.EntryFactoryImpl.wrapEntryForWriting(EntryFactoryImpl.java:132) at org.infinispan.interceptors.EntryWrappingInterceptor.wrapEntryForPutIfNeeded(EntryWrappingInterceptor.java:204) at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:197) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:96) at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:62) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107) at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:76) at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1672) at org.infinispan.cache.impl.CacheImpl.putIfAbsentInternal(CacheImpl.java:1163) at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:1151) at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:1770) at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:278) at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:246) at org.hibernate.cache.infinispan.access.PutFromLoadValidator.registerPendingPut(PutFromLoadValidator.java:493) at org.hibernate.cache.infinispan.access.InvalidationCacheAccessDelegate.get(InvalidationCacheAccessDelegate.java:63) at org.hibernate.cache.infinispan.entity.ReadOnlyAccess.get(ReadOnlyAccess.java:44) at org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:32) at org.hibernate.event.internal.DefaultLoadEventListener.getFromSharedCache(DefaultLoadEventListener.java:651) at org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:595) at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:462) at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219) at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278) at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1129) at org.hibernate.internal.SessionImpl.access$2600(SessionImpl.java:164) at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2696) at org.hibernate.internal.SessionImpl.get(SessionImpl.java:975) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:1075) ... 178 more Caused by: java.lang.IllegalAccessException: Class org.hibernate.property.access.spi.GetterFieldImpl can not access a member of class ru.argustelecom.rms.resource.act.usecase.TransferUseCaseKey with modifiers "private" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) at java.lang.reflect.Field.get(Field.java:390) at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:39) ... 231 more

stack3

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 Caused by: org.hibernate.property.access.spi.PropertyAccessException: Error accessing field [private ru.argustelecom.system.contact.model.CodeDir ru.argustelecom.supportservice.integration.eco.model.CRMEco.codeDir] by reflection for persistent property [ru.argustelecom.supportservice.integration.eco.model.CRMEco#codeDir] : [CRMEco id=null] at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:43) at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:58) at org.hibernate.type.ComponentType.getPropertyValue(ComponentType.java:419) at org.hibernate.type.ComponentType.isEqual(ComponentType.java:183) at org.hibernate.cache.internal.OldCacheKeyImplementation.equals(OldCacheKeyImplementation.java:83) at org.hibernate.internal.util.compare.EqualsHelper.equals(EqualsHelper.java:31) at org.hibernate.type.descriptor.java.AbstractTypeDescriptor.areEqual(AbstractTypeDescriptor.java:70) at org.hibernate.type.AbstractStandardBasicType.isEqual(AbstractStandardBasicType.java:182) at org.hibernate.cache.infinispan.TypeEquivalance.equals(TypeEquivalance.java:29) at org.infinispan.commons.util.concurrent.jdk8backported.EquivalentConcurrentHashMapV8.get(EquivalentConcurrentHashMapV8.java:952) at org.infinispan.container.DefaultDataContainer.peek(DefaultDataContainer.java:183) at org.infinispan.container.EntryFactoryImpl.innerGetFromContainer(EntryFactoryImpl.java:278) at org.infinispan.container.EntryFactoryImpl.getFromContainer(EntryFactoryImpl.java:258) at org.infinispan.container.EntryFactoryImpl.wrapEntryForWriting(EntryFactoryImpl.java:132) at org.infinispan.interceptors.EntryWrappingInterceptor.wrapEntryForPutIfNeeded(EntryWrappingInterceptor.java:204) at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:197) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitNonTxDataWriteCommand(AbstractLockingInterceptor.java:96) at org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor.visitDataWriteCommand(NonTransactionalLockingInterceptor.java:40) at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:62) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:191) at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:177) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99) at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107) at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:76) at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:43) at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:74) at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336) at org.infinispan.cache.impl.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1672) at org.infinispan.cache.impl.CacheImpl.putIfAbsentInternal(CacheImpl.java:1163) at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:1151) at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:1770) at org.infinispan.cache.impl.CacheImpl.putIfAbsent(CacheImpl.java:278) at org.infinispan.cache.impl.AbstractDelegatingCache.putIfAbsent(AbstractDelegatingCache.java:246) at org.hibernate.cache.infinispan.access.PutFromLoadValidator.registerPendingPut(PutFromLoadValidator.java:493) at org.hibernate.cache.infinispan.access.InvalidationCacheAccessDelegate.get(InvalidationCacheAccessDelegate.java:63) at org.hibernate.cache.infinispan.entity.ReadOnlyAccess.get(ReadOnlyAccess.java:44) at org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:32) at org.hibernate.event.internal.DefaultLoadEventListener.getFromSharedCache(DefaultLoadEventListener.java:651) at org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:595) at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:462) at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:219) at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:278) at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1129) at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1022) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:632) at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:252) at org.hibernate.cache.internal.StandardQueryCache.assembleCachedResult(StandardQueryCache.java:205) at org.hibernate.cache.internal.StandardQueryCache.get(StandardQueryCache.java:190) at org.hibernate.loader.Loader.getResultFromQueryCache(Loader.java:2535) at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2443) at org.hibernate.loader.Loader.list(Loader.java:2415) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483) ... 249 more Caused by: java.lang.IllegalAccessException: Class org.hibernate.property.access.spi.GetterFieldImpl can not access a member of class ru.argustelecom.supportservice.integration.eco.model.CRMEco with modifiers "private" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) at java.lang.reflect.Field.get(Field.java:390) at org.hibernate.property.access.spi.GetterFieldImpl.get(GetterFieldImpl.java:39) ... 313 more

It happens only on distributed env with cluster-wide load. It happens not only private field/class keys, but on package-private class too. We use OldCacheKeyImplementation due to HHH-10287.

Now we fix`em through public modifiers addition, but it seems that this is bug in hibernate-core – earlier hibernate never paid attention on access modifiers of mapped field or class.

May be this bug not catched because OldCacheKeyImplementation used rarely.

We already jumped onto WF 10.1.0.Final/hibernate 5.0.10, but not yet on production. It seems that this not fixed on this environment too

Looks like fix is simple – add field.setAccessible call to GetterFieldImpl#get:

possible fix

1 2 3 4 5 6 @Override public Object get(Object owner) { try { field.setAccessible(true); ///!!! fix? return field.get( owner ); }

but may be I don`t understand something? GetterMethodImpl#get have no setAccessible call, but it works (no any IllegalAccessException with GetterMethodImpl in stack). OldCacheKeyImplementation and infinispan in stack also confusing me.

Environment

wildfly 10.0.0.Final
hibernate 5.0.7.Final
infinispan 8.1.0.Final
OldCacheKeyImplementation used (see HHH-10287)
@Embeddable component key used
distributed entity cache: invalidation-cache
distributed timestamps cache: replicated-cache

Status

Assignee

Gail Badner

Reporter

kostd

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.7

Priority

Major