Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Websocket Client Could not find an implementation class

I will preface this with I am not using any maven dependencies, yet I know that I am missing a jar file wls-api.jar (at least that is what I have read).

To remedy this I downloaded the oracle-weblogic-7.9.jar but the problem persists.

The exception is thrown at this line

 WebSocketContainer container = ContainerProvider.getWebSocketContainer();

Can anyone tell me why this line continuously fails?

UPDATE: upon further reading the examples I see use this dependency

<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.0</version>

I have javax.websocket-api.jar in the build path of the server and the client as it is required. What am I missing here?

Other update: I forgot to include the error thrown!

Exception in thread "main" java.lang.RuntimeException: Could not find an implementation class.
at javax.websocket.ContainerProvider.getWebSocketContainer(ContainerProvider.java:73)
at connect.<init>(connect.java:21)
at test.main(test.java:11)
like image 206
Michael Miner Avatar asked Jan 03 '15 04:01

Michael Miner


1 Answers

javax.websocket api is only the specification don't have full implementation you may need to take the jar file tyrus-standalone-client-1.9.jar and try the same example that should solve your problem. i tested with my example and it is working fine.

hope this will help you.

like image 157
Rajendar Reddy Avatar answered Oct 04 '22 04:10

Rajendar Reddy