java - SAP Hybris 辅助服务模块 (ASM) - 双重登录
问题描述
我遇到了 ASM 模块的问题 - 有时会发生在登录操作之后,站点被刷新并且 ASM 未显示。
我发现在我登录的时候,请求同时发送了两次。然后它会导致在 DB 中找到重复键的错误。我认为主要问题是双重登录,但我不知道是什么原因造成的。
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [AssistedServiceFacade] Agent [user] has been loged in using login form
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [DefaultGUIDCookieStrategy] Setting guid cookie and session attribute: xxx
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [AssistedServiceFacade] Agent [user] has been loged in using login form
[RQ-XXX/user-POST /custom/cs/assisted-service/login] [ip] [DefaultGUIDCookieStrategy] Setting guid cookie and session attribute: yyy
ERROR [RQ-end] [page] Error 200 shown
Req: null
User:user
Session:xxx | msg:
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:468)
.
.
这是关键错误,但我不确定这是问题的主要原因。
ModelSavingException: [de.hybris.platform.servicelayer.interceptor.impl.UniqueAttributesInterceptor@2f9e23c2]:Ambiguous unique keys {key=CxActionResults_XXX} for model CxResultsModel (<unsaved>) – found 1 item(s) using the same keys
我试图用 .js 来防止这种情况,但没有帮助:
$("#asmLoginForm").on('submit', function (e) {
e.preventDefault();
})
它不会每次都发生。
解决方案
Turns out there was bad wro
configuration. I had the .js
files from ASM module twice on the site, once compiled in all_responsive.js
file and once again in the addons/responsive part. So everytime I did submit, both two functions sent the request.
推荐阅读
- javascript - 使用 jQuery 或 js 在导航链接点击时开始和停止背景视频?
- mysql - 在 WHERE 条件中使用 UNION 语句插入选择
- php - 动态更改(或用户更改)Wordpress 中的列数
- typescript - 打字稿检查对象是否可迭代
- angular - 将值设置为没有 NgModel、反应式表单的表单控件?
- python - 来自lxml python的fromstring函数出错
- python - 如何根据阈值在 Python 中对多列进行分组并创建新列
- vue.js - Vue中的迷你枢轴网格,没有外部库
- python - 如何在相当平衡的二元分类中解决非常高的误报率?
- angular - 在组件之间共享变量 angular