Note that there are some explanatory texts on larger screens.

plurals
  1. POWebsocket client can not be deployed to Glassfish
    primarykey
    data
    text
    <p>Dear Stack Overflow Geeks,</p> <p>I'm trying to create a very basic Java client-server app using Java EE 7 and the intention is to send a message via websocket using JSR 356 implementation.</p> <p>I've programmed and deployed the server successfully following various blogs I've found out there and I was able to communicate a Javascript client with my java server.</p> <p>Now what I'm trying to do is to create an standalone java app that needs to communicate with the server and retrieve the same info. I read that JSR 356 implementation can be used in Java clients and that's exactly what I did. I also used Tyrus to create the client and keep it running using the latch mechanism, etc etc etc. Beautiful. The client is finally programmed, the server is up and running BUT when I try to run the client I get this error:</p> <pre class="lang-none prettyprint-override"><code>java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:446) at org.glassfish.appclient.client.AppClientFacade.main(AppClientFacade.java:166) Caused by: java.lang.NoClassDefFoundError: javax/websocket/CloseReason$CloseCode at Main.Main.main(Main.java:27) ... 6 more Caused by: java.lang.ClassNotFoundException: javax.websocket.CloseReason$CloseCode at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at org.glassfish.appclient.client.acc.ACCClassLoader.findClass(ACCClassLoader.java:237) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 7 more Java Result: 1 </code></pre> <p>I'm using Java EE 7 API + Tyrus in NetBeans 7.3 and deploying in a Glassfish 4 (which, from what I've read supports JSR 356 implementation) Now, why on earth is not finding the CloseReason class! :( It should not have compiled if that's the case, isn't it?</p> <p>Weird thing is that is not complaining about other classes related to websocket implementation (JSR 356) and, on the other hand, I deployed the server (web-app) and the websocket mechanism is working just fine. (I think I didn't implement the CloseReason there though.. but why it's complaining only about that! :@ )</p> <p>Any help provided will be much appreciated!!</p> <p>Cheers,</p> <p>Another Stack Overflow Geek seeking for help. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload