Wrong WebTarget implementation SseEventSource

淺唱寂寞╮ 提交于 2019-12-24 00:37:37

问题


I have implemented a method to receive live notification from OpenHab in my application through SSE events. Previously I used glassfish server to deploy my application. But I needed to switch to Payara and now the sse connection won't be established. I am getting following error:

Argument fish.payara.requesttracing.jaxrs.client.decorators.JaxrsWebTargetDecorator@45>314ad8 is not a valid JerseyWebTarget instance. SseEventSource does not support other WebTarget implementations.

When switching back to glassfish server the code runs perfectly. And I can establish a sse connection.

WebTarget wt =  requestHelper.buildTarget(
                "/events",
                new String[0],
                new Object[0],
                new String[]{"topics"},
                new String[]{String.format("smarthome/%s/%s/%s", "items", itemName, "statechanged")});

        eventSource = SseEventSource
                .target(wt)
                .build();

This is my Webtarget building. In the .build It checks if webTarget is instance of JerseyWebTarget, but in my case it is JaxrsWebTargetDecorator and I can't explain why. Does anyone know where the issue is?

来源:https://stackoverflow.com/questions/55397191/wrong-webtarget-implementation-sseeventsource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!