I want to experiment with WebSockets as a replacement for REST for a particular app. Supposedly, the Java WebSockets API is included in Java 7, but Eclipse cannot find the libraries so I manually added the import statements that I took from the book Java WebSocket Programing from Oracle press (shown below) but Eclipse can't resolve them.
I have googled looking for the WebSockets jarfile and I get hundreds of hits, but they are documentation and I've yet to find the jar or jars that I need.
Does anyone have the jar or jars and can zip them to me or better yet, a URL where I can find the actual jarfiles?
Good idea but Tomcat is not an EE complaint application and so the necessary jarfile is not there. But on the other hand, you got me to thinking. I have Tomee, which is an enhanced, EE compliant Tomcat, and yes I found the file websocket-api.jar. I was able to import the two packages and I'm off and running. Thanks for steering me in the right direction.
Good idea but Tomcat is not an EE complaint application and so the necessary jarfile is not there.
I'm not sure what you mean by "not JEE compliant" - it is not certified as such, but it is compliant with the JSR specifications it implements; those include WebSockets, and as such it does come with the required API jar file.
Tomcat may implement some EE features but is not a fully Java EE compliant server but is, in my opinion, the server of choice for servlets and JSPs. You're right in that he Tomcat page on the Apache site does indeed say that it implements websockets but it's wrong when it says version 7.0 and above. I have 7.0.29, and no that distro does not include the websocket-api.jar. But just for grins, I downloaded the current version, 7.0.54, and yes that distro does include websocket-api.jar, but there lots of EE features not implemented. The Apache folks are trying or have already succeeded in getting Tomee certified as Fully compiant.