我最近发现了一个在AdapterSecurityContext中存储mobilefirst 8服务器数据的问题。我们在自定义安全检查下使用方法getClientRegistrationData将受保护的用户数据存储在AdapterSecurityContext中。它在Mobilefirst DevKit服务器上工作正常
ClientData clientData = adapterSecurityCheck.getClientRegistrationData();
clientData.getPublicAttributes().put(key, "hello");
adapterSecurityCheck.storeClientRegistrationData(clientData);
但是当我在Liberty服务器或我们安装的Was服务器上运行相同的适配器时,它给出了下面的错误
com.ibm.mfp.server.core.sha冲突: 409;headers= MFP-red.MFPRESTException=并发故障;body={}
at com.ibm.mfp.server.registration.internal.RegistrationServiceImpl.stor eClient(RegistrationServiceImpl.java:235)
at sun.reflect.GeneratedMethodAccessor965.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti on(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo inpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( ReflectiveMethodInvocation.java:157)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doP roceed(DelegatingIntroductionInterceptor.java:133)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.inv oke(DelegatingIntroductionInterceptor.java:121)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami cAopProxy.java:207)
at com.sun.proxy.$Proxy219.storeClient(Unknown Source)
at com.ibm.mfp.server.security.internal.services.AdapterSecurityContextI mpl.storeClientRegistrationData(AdapterSecurityContextImpl.java:91)
at com.pscu.ServiceAdapterResource.setSecureData(ServiceAdapterResource. java:2321)
at com.pscu.ServiceAdapterResource.setAllCardsInToSecuredStore(ServiceAd apterResource.java:2332)
at com.pscu.ServiceAdapterResource.getPostLoginData(ServiceAdapterResour ce.java:250)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(Abst ractInvoker.java:181)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker .java:97)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInv okerInterceptor.java:59)
发布于 2018-05-28 18:26:31
请参考https://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.apiref.doc/html/refjava-mfp-server/html/com/ibm/mfp/server/security/external/resource/AdapterSecurityContext.html。必须通过AdapterSecurityContext.getClientRegistrationData(),AdapterSecurityContext.getClientRegistrationData(String),或AdapterSecurityContext.findClientRegistrationData(ClientSearchCriteria).获取ClientData实例如果注册数据在通过该请求获得后被并发请求修改,则此方法将抛出运行时异常,该异常将自动报告给客户端为HTTP状态409 (冲突)。
https://stackoverflow.com/questions/49485382
复制相似问题