Azure / Azure/azure-relay-java

The library doesn't work properly with Tomcat server

Open
#51 3 comments 0 reactions 2 assignees Claimed by @kalkeea View on GitHub
Bug customer-reported Relay
Dominant language
Java
Stars
8
Forks
15
PR merge metrics
No merged PRs in 30d

Description

HybridConnectionListener throws exceptions when using it on a tomcat:

`19-Jul-2019 13:48:07.248 SEVERE [autoshutdown-pool-1-thread-3] com.microsoft.azure.relay.RelayLogger.throwingException ClientWebSocket(TrackingId:de9dd33c-7433-49c0-978d-07e191f35798_G16_G10, Address:sb://statelink-relay.servicebus.windows.net) is throwing an Exception:
javax.websocket.DeploymentException: Cannot use POJO class [com.microsoft.azure.relay.ClientWebSocket] as it is not annotated with @ClientEndpoint
at org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:124)
at com.microsoft.azure.relay.ClientWebSocket.lambda$connectAsync$0(ClientWebSocket.java:121)
at com.microsoft.azure.relay.CompletableFutureUtil.lambda$futureToCompletableFuture$1(CompletableFutureUtil.java:62)
at com.microsoft.azure.relay.AutoShutdownScheduledExecutor.lambda$submit$0(AutoShutdownScheduledExecutor.java:60)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
19-Jul-2019 13:48:07.250 SEVERE [autoshutdown-pool-1-thread-3] com.microsoft.azure.relay.RelayLogger.throwingException HybridConnectionListener(TrackingId:92aa61bb-a431-4230-aa5f-a56bf29d0960, Address:sb://statelink-relay.servicebus.windows.net) is throwing an Exception:
java.util.concurrent.CompletionException: java.lang.RuntimeException: javax.websocket.DeploymentException: Cannot use POJO class [com.microsoft.azure.relay.ClientWebSocket] as it is not annotated with @ClientEndpoint
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
at java.util.concurrent.CompletableFuture.uniRun(CompletableFuture.java:700)
at java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:687)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at com.microsoft.azure.relay.CompletableFutureUtil.lambda$futureToCompletableFuture$1(CompletableFutureUtil.java:68)
at com.microsoft.azure.relay.AutoShutdownScheduledExecutor.lambda$submit$0(AutoShutdownScheduledExecutor.java:60)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: javax.websocket.DeploymentException: Cannot use POJO class [com.microsoft.azure.relay.ClientWebSocket] as it is not annotated with @ClientEndpoint
at com.microsoft.azure.relay.RelayLogger.throwingException(RelayLogger.java:77)
at com.microsoft.azure.relay.RelayLogger.throwingException(RelayLogger.java:53)
at com.microsoft.azure.relay.ClientWebSocket.lambda$connectAsync$0(ClientWebSocket.java:127)
at com.microsoft.azure.relay.CompletableFutureUtil.lambda$futureToCompletableFuture$1(CompletableFutureUtil.java:62)
... 8 more
`

If I add an annotation, receives other ClassNotFoundException and ClassCastException. I'd like to be able to use this library on any server not only jetty

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.