jWebSocket Forum

[Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Installing in embedded mode  XML
Forum Index » Installation and Configuration
Author Message
Durin

jWebSocket Forum User

Joined: 31/05/2010 19:29:28
Messages: 11
Offline

Hi, first i have to say that this seems like a really interesting project, i have been looking for a good websocket "library" for some time now.

I have read through most of the documentation i have found on this site and i think i understand how this is supposed to work. I tried the server in standalone mode on both windows and ubuntu and now i want to embed it into my tomcat6 server on ubuntu, this however was not as easy. So the first thing i wonder is whether i have to set the JWEBSOCKET_HOME variable in embedded mode and if i do, what do i set it to?

Thanks
aschulze

jWebSocket Owner
[Avatar]

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline

Hi Durin,

the best way to embed jWebSocket into a Tomcat environment is to put the jWebSocketServer-Bundle.jar into Tomcat's lib folder and the jWebSocket.xml file into Tomcat's conf folder. jWebSocket does not require the JWEBSOCKET_HOME variable in this particular case because it also looks for CATALINA_HOME which should properly refer to your Tomcat 6.x base folder as usual.
In the source code package for jWebSocketAppServer you will find an example of how to start and stop jWebSocket in the ContextListener of your Web App. If you want to extend jWebSocket you can create a plug-in as described in our how-to section and also put the .jar into the Tomcat's lib folder (needs to restart Tomcat after that).
Let us know if you have further questions (and success as well . We'll get it running...

Best Regards
Alex
[WWW]
Durin

jWebSocket Forum User

Joined: 31/05/2010 19:29:28
Messages: 11
Offline

Thanks for fast response!

Alright i am trying to run the server with the demo apps following the instructions (which seems easy enough) and i have deployed the .war file using the manager in tomcat6 however when the application is loaded i get the following:

May 31 21:39:52 ubuntuserver jsvc.exec[12530]: 2010-05-31 21:39:52,882 DEBUG - JWebSocketFactory: Starting jWebSocket Server sub system...
May 31 21:39:52 ubuntuserver jsvc.exec[12530]: 2010-05-31 21:39:52,889 WARN - JWebSocketLoader: %JWEBSOCKET_HOME% variable not set.
May 31 21:39:52 ubuntuserver jsvc.exec[12530]: 2010-05-31 21:39:52,890 ERROR - JWebSocketFactory: jWebSocket Server sub system could not be initialized.

I have put the required jars in the lib folder of tomcat6 and the jWebSocket.xml in the conf folder, however i suspect that the distribution i am using (Ubuntu 9.10) does not use the default way to place the folders and stuff. So exactly where does the jWebSocket server look for the jWebSocket.xml file? Maybe i have to create that folder manually.

Or another solution could be do define the JWEBSOCKET_HOME anyway and just put the jWebSocket.xml there, dont know what the best solution is here...
stojadinovicp

jWebSocket Committer
[Avatar]

Joined: 16/03/2010 21:26:10
Messages: 30
Offline

It is possible that the problem is because of the OS specific settings in the .xml file. I am pretty sure that we didn't test our stuff on anything other than Windows.

This is of course not acceptable and we will surely provide adequate solutions for Mac and Linux asap.

I have an Ubuntu machine at home so I can play with this but not before Friday night as we are both at a Webinale conference in Berlin.

I will let you know as soon as I take a look.

This message was edited 1 time. Last update was at 01/06/2010 09:12:20


http://stojadinovic.net
aschulze

jWebSocket Owner
[Avatar]

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline

Hi Durin,

which version of jWebSocket do you use? From jWebSocket v0.9 the CATALINA_HOME variable is checked, what I can't see in the logs you sent. Did you already try the latest version? Maybe the "nightly build" v0.9.0.0528 from our download section? Let us know if you still experience issues, but anyway we will check on Ubuntu on Friday and fix if needed. Thanks in advance for your further feedback and for your patience.

Alex
[WWW]
Durin

jWebSocket Forum User

Joined: 31/05/2010 19:29:28
Messages: 11
Offline

Hi again,

which version of jWebSocket do you use?


The version i tried yesterday was the 0.9.0.0522 version from the downloads page, today i tried the 0.9.0.0528 version too but i still get the same 3 lines about JWEBSOCKET_HOME not being defined, and then nothing.

It is possible that the problem is because of the OS specific settings in the .xml file.


It seems to me that it does not find the .xml file at all, but i don't know really...

Anyway, thanks a lot for your help guys, i will wait for you to try it out on Ubuntu yourselves. In the meantime i will be using the stand alone server and read up on the examples and stuff

Hope you have a good time at the conference!
Durin

jWebSocket Forum User

Joined: 31/05/2010 19:29:28
Messages: 11
Offline

Any progress on this yet?
stojadinovicp

jWebSocket Committer
[Avatar]

Joined: 16/03/2010 21:26:10
Messages: 30
Offline

Not yet. My Ubuntu machine is not really mine but... long story...

I will have access to it tonight so I will take a look as soon as I get home from work...

Sorry for the delay...

http://stojadinovic.net
stojadinovicp

jWebSocket Committer
[Avatar]

Joined: 16/03/2010 21:26:10
Messages: 30
Offline

Ubuntu works like a charm

I simply downloaded and extracted the server and I then set the environment variable JWEBSOCKET_HOME and the server started without problems!

I had the same error before I set the JWEBSOCKET_HOME environment variable:


But the server started without problems after I did this:


There are two things to note here. One, I have used the full path for the variable and two, once the variable is set it is by default only a shell variable. In order to make it an environment variable you need to use the export command like above.

Here is the result after properly setting the JWEBSOCKET_HOME variable:


I hope this helps!

This message was edited 1 time. Last update was at 07/06/2010 17:40:43


http://stojadinovic.net
Durin

jWebSocket Forum User

Joined: 31/05/2010 19:29:28
Messages: 11
Offline

Well, it kind of works but if i start is as the normal user (non root) i get this somewhere in the middle of the output:

And if i run it like:

The JWEBSOCKET_HOME does not seem to be defined, and

does not work.

I guess that can be fixed in some way (will google it a bit later) but the main problem i had was that i cannot get the jWebSocket to run in embedded mode with Tomcat (see my earlier posts), and i still don't know how to make it work.

Anyway, thanks for your help

aschulze

jWebSocket Owner
[Avatar]

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline

Hi Durin,

although I'm not a Linux expert I just Google'd a bit and figured out that may you get the permission denied exception because the port 843 (FlashBridge) is already in use?
Please also refer to: http://www.java-forums.org/networking/1354-java-net-socketexception-permission-denied-listen-failed.html
Maybe you check that you run the JRE/JDK 1.6.10+ (check JAVA_HOME variable), please also refer to http://forums.sun.com/thread.jspa?threadID=5191462 which discusses issues with mutliple JRE's and/or embedded JRE's in third party environments.
Please also check your firewall for open port 843!

If it still does not run, don't hesitate to contact us again. We'll find a way...

Regards
Alex
[WWW]
Durin

jWebSocket Forum User

Joined: 31/05/2010 19:29:28
Messages: 11
Offline

Hi again

After an upgrade to Ubuntu 10.04 and latest version of jWebSocket (0.9.5) i managed to get the server running with tomcat6. However, the flashbridge does not start due to permission restrictions when trying to open ports < 1024. So my question is: is there a way to use another port for the flashbridge other than the default one? Via a config or something?

Thanks
/Durin
aschulze

jWebSocket Owner
[Avatar]

Joined: 16/03/2010 18:15:55
Messages: 375
Location: Germany, Herzogenrath
Offline

Hi Durin,

unfortunately we cannot control what Flash does under the hood, so we cannot change or configure the 843 port (its simply limited to Flash's API). Anyway, although we expect that the next official Browser versions all will support WebSockets natively (i.e. w/o the need of the FlashBridge fallback), of course, due to backward compatibility we will evaluate how to allow a certain user to use/access ports < 1024 in Ubuntu this week and get back to you ASAP. Thanks for your patience.

Alex
[WWW]
gimpel

jWebSocket Forum User

Joined: 29/07/2010 16:31:37
Messages: 2
Location: Jena, Germany
Offline

In Order to use ports below 1024 as non root user there is a tool called
"authbind" with packages available for debian / ubuntu and other distros (i'm using it successfully on archlinux)

in order to allow it to work root access is required once to
create an empty file called
/etc/authbind/byport/843
which must be readable for the user which wants to run programs listening on port 843

after that authbind can be used to launch java jars by this user:

$ authbind --deep java -Djava.net.preferIPv4Stack=true -jar [JARFILE TO RUN]

for further details try the quite extensive debian manpage (which I think should also be included in the ubuntu package)
$ man authbind
[ICQ]
himanshu1002

jWebSocket Forum User
[Avatar]

Joined: 17/03/2018 16:37:20
Messages: 1
Location: Mumbai 400 002 +91 7506996883
Offline

“Kanhai Jewels” is Mumbai based company established in 2001, We are manufacturer and wholesaler of Indian Jewellery and Western trendy jewellery, as well as Exporters of Traditional Indian Jewellery.
<a href='https://www.kanhaijewels.com/category/american-diamond-cz-jewellery'>Ad jewellery</a>
<a href='https://www.kanhaijewels.com/category/american-diamond-cz-jewellery'>CZ Jewellery</a>
<a href='https://www.kanhaijewels.com/category/american-diamond-cz-jewellery'>American diamond jewellery</a>
<a href='https://www.kanhaijewels.com/category/american-diamond-cz-jewellery'>Cubic zirconia jewellery</a>

Antique Jewellery
Traditional jewellery 
Bollywood jewellery 
Bridal Jewellery
[WWW]
 
Forum Index » Installation and Configuration
Go to:   
Powered by JForum 2.1.9 © JForum Team