在Java适配器中,当我们使用Push Tag (POST)创建新标记时,我们总是得到一个"目标资源' PushTag'已存在" 409响应和日志中的错误,即使成功创建了新标记
这是一个已知问题吗?有解决办法吗?
在日志中,序列是这样的;
[INFO ] 2017-10-16-07:51:48.318 [1363] PostRequest.call http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags/TAG2203137
GET
Authorization: Bearer eyJhbGci...
[ERROR ] FPWSE0010E: Internal server error. FPWSE0001E: Not Found - The target resource 'PushTag' does not exist. Check the 'TAG2203137' parameter.
[ERROR ] FPWSE0010E: Internal server error. FPWSE0001E: Not Found - The target resource 'PushTag' does not exist. Check the 'TAG2203137' parameter.
http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags/TAG2203137
GET
404
{OkHttp-Sent-Millis=1508158308325, Date=Mon, 16 Oct 2017 12:51:48 GMT, Content-Length=125, OkHttp-Received-Millis=1508158308332, Connection=Close, Content-Type=application/json, X-Powered-By=Servlet/3.1}
{"message":"Not Found - The target resource 'PushTag' does not exist. Check the 'TAG2203137' parameter.","code":"FPWSE0001E"}
[INFO ] 2017-10-16-07:51:48.333 [1363] PostRequest.call http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags
POST
Authorization: Bearer eyJhbGci...
Content-Type: application/json
{"description":"TAG2203137","name":"TAG2203137"}
[err] com.ibm.mfp.push.server.exceptions.PushWorksEntityExistsException: FPWSE0002E: Conflict - The target resource 'PushTag' already exists. Check the 'TAG2203137' parameter.
[err] at com.ibm.mfp.push.server.rest.resources.TagResource.createTag(TagResource.java:283)
[err] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[err] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[err] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[err] at java.lang.reflect.Method.invoke(Method.java:606)
[err] at org.apache.wink.server.internal.handlers.InvokeMethodHandler.handleRequest(InvokeMethodHandler.java:63)
[err] at org.apache.wink.server.handlers.AbstractHandler.handleRequest(AbstractHandler.java:33)
[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:26)
[err] at org.apache.wink.server.handlers.RequestHandlersChain.handle(RequestHandlersChain.java:22)
[err] at org.apache.wink.server.handlers.AbstractHandlersChain.doChain(AbstractHandlersChain.java:67)
etc, etc
[err] at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1287)
[err] at [internal classes]
[err] at com.ibm.mfp.push.server.rest.SecurityFilter.doFilter(SecurityFilter.java:93)
[err] at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
[err] at [internal classes]
[err] at com.ibm.mfp.push.server.rest.filter.RequestDetailLogger.doFilter(RequestDetailLogger.java:94)
[err] at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
[err] at [internal classes]
[err] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[err] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[err] at java.lang.Thread.run(Thread.java:745)
[ERROR ] FPWSE0010E: Internal server error. FPWSE0002E: Conflict - The target resource 'PushTag' already exists. Check the 'TAG2203137' parameter.
http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags
POST
409
{OkHttp-Sent-Millis=1508158308345, Date=Mon, 16 Oct 2017 12:51:48 GMT, Content-Length=124, OkHttp-Received-Millis=1508158308372, Connection=Close, Content-Type=application/json, X-Powered-By=Servlet/3.1}
{"message":"Conflict - The target resource 'PushTag' already exists. Check the 'TAG2203137' parameter.","code":"FPWSE0002E"}
[err] java.io.IOException: Could not create http://localhost:9080/imfpush/v1/apps/com.ibm.mfpstartercordova/tags
[err] at com.onemain.mfp.push.PushMessage$oauthInstance.pushToTag(PushMessage.java:153)
[err] at com.onemain.mfp.push.pushAdapterApplication.handleMessage(pushAdapterApplication.java:99)
[err] at com.onemain.mfp.push.pushAdapterApplication.waitForMessage(pushAdapterApplication.java:127)
[err] at com.onemain.mfp.push.pushAdapterApplication.pollLocalMQ(pushAdapterApplication.java:158)
[err] at com.onemain.mfp.push.pushAdapterApplication.access$200(pushAdapterApplication.java:48)
[err] at com.onemain.mfp.push.pushAdapterApplication$1.run(pushAdapterApplication.java:255)