websocket study notes

Websocket study notes

 

1.      websocket tomcat build

a)        eclipse tomcat8 puglin setup

(1)    download elipse wtp toolsinstall package( now last version is 3.6) and unzip to eclipse_home ,thenreboot eclipse;  if invalid, you canrestart eclipse add parameter is –clean for eclise reload puglins;

lol copy(hasimage to make sure)

 

(2)     in my machine, when done setp 1, it can createtomcat8 server,but add tomcat 8 server runtime environment for eclipse projectis not success. So I modify tomcat config to do it. Frist copy tomcat 8 installnamed tomcat 8 to tomcat 7 directory. And then modify tomcat config in tomcat 8to tomcat 7 /lib/ catalina.jar . I user zip tools(Chinese tools named haozip ),  replasce catalina.jar!/org/apache/catalina/util/ServerInfo.properties  version 8 to  7 ; like this

And then save it.  ThenAdd eclipse server runtime environment for this.

So we can add eclipse project server Runtime Lib withtomcat 8;

 

 

ref : http://stackoverflow.com/questions/17868232/how-to-use-tomcat-8-in-eclipse

wtp website : http://download.eclipse.org/webtools/downloads/

 

b)        add tomcat example to websocket-tomcat8project

like this;

 

All java filecopy form tomcat8_home/webapp/examples/WEB0-INFO/classes;

 

Notices: now ifyou find your project has error, some class lose. You can include juli in yourpom file.

<dependency>

                   <groupId>org.apache.tomcat</groupId>

                   <artifactId>juli</artifactId>

                   <version>6.0.39</version>

         </dependency>

 

 

c)        Then create tomcat 8 server andadd preoject into it; start it;then open tomcat_home/ \webapps\examples\websocket/echo.xhtmluse chrome;

 

Now start yourtravel in websocket world.

 

Remark:

(1)               Do not includejavax.websocke.api if you have tomcat included!

in your websocket project doesn’t includejavax.websocke.api jar. It’s maven dependency like this:

<dependency>

       <groupId>javax.websocket</groupId>

       <artifactId>javax.websocket-api</artifactId>

       <version>1.0</version>

</dependency>

 

Actually tomcat-websocket jar dependency it, soyou don’t include it;

(2)               tomcat 8 websocket introductionin office website :

http://tomcat.apache.org/tomcat-8.0-doc/web-socket-howto.html

 

and other userful information list:

Tomcat 8 Examples: Missing Configuration Step

http://stackoverflow.com/questions/20723818/tomcat-8-examples-missing-configuration-step

Deploying WebSocket on tyrus server

https://tyrus.java.net/documentation/1.3.3/index/deployment.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值