0

I 've spent the whole night trying to run a simple echo test on Tomcat 7.

The test I try to run runs locally as expected. But when deployed to the openshift the connection opens and then immediately closed. I've been looking for the right setup on the internet and found questions and answers for them for exactly the same problem but the solutions don't work for me.

The example of what I have as a test can be checked at http://pureikka-belgampaul.rhcloud.com/pi-8/index.html

At the bottom of the viewarea there's a debug console reporting the statsus of the websocket.

So I feel like I have not made a simple mistake in the setup and it runs locally with only the change of the host name and the port number for the websocket.

Could it be a routing trouble after the upgrade of the connection?

I deploy my war file directly to the webapps directory. I also think I got websockets working at one moment but i'm not so sure anymore. I could be looking at the localhost after all.

Eventually I decided to try wildfly8 gear because it ships with support for websockets. I checked out the https://github.com/javaee-samples/javaee7-samples repo and deployed the chat demo to the local wildfly8 and the example worked from the first run as it is supposed. Great. But the same war file fails to work correctly on the openshift (http://wildfly8-belgampaul.rhcloud.com/chat3/)

I tried to use ports 80 or 8000 in both setups. Need someone's help? advice or question to send me back to the right direction

Maybe someone has solved a similar issue?

1
  • it's not like i've solved the issue more like there's a workaround to get websockets working on openshift in java. i've followed the instructions from github.com/shekhargulati/wildfly-openshift-quickstart. it uses a DIY gear. eventually i could run <artifactId>javaee7-samples</artifactId> examples demonstrating websockets by just deploying the same war files as i used to test with in two other setups. Websockets work over port 8000. in the end i think it's a routing issue on the wildfly8 gear. still curious what is wrong.
    – ioikka
    May 10, 2014 at 21:14

2 Answers 2

0

Web Sockets on OpenShift work over ports 8000 for ws and 8443 for wss, it is not a "work around" it's the way websockets work on this system.

1
  • by workaround I meant the fact that I expected to work websockets on the existing not DIY gears out-of-the-box. It could be red hat restriction or my config is wrong somewhere but on not-DIY boxes I've struggled and failed to set websockets up. Anyway, thank you for making it clear about the ports.
    – ioikka
    May 11, 2014 at 19:25
0

Here are the most useful links providing just enough light about the problem

  1. https://www.openshift.com/blogs/paas-websockets (general info about websockets on openshift)
  2. https://www.openshift.com/blogs/deploy-websocket-web-applications-with-jboss-wildfly (diy example)

to summarize: websocket support out-of-the-box is the most reliable with node.js.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.