0

This question is in relation to my previous question.

I want to implement the new HTML5 WebSocket feature in WildFly 8.2.1 in OpenShift. My previous post has my java class (which is the server) and a html client and the pom.xml file. The problem was whenever I made opened the MyTest.html, the WebSocket connection would immediately disconnect.

I was reading this article on how to implement WebSockets on OpenShift using WildFly 8.2.1. It said that you actually have to start the wildfly server by action hooks and by doing so in the terminal. I have no clue what they are talking about. Could you please assist me in this manner as I am new to this.

Thank you for your help!

Community
  • 1
  • 1
user5139637
  • 775
  • 3
  • 10
  • 29

1 Answers1

2

First, I think you should continue with your previous question. I see that there's some confusion about that the server needs to be bound to port 8080 and the client should be connecting to 8000 when using websockets.

Second, the article you are referring is using a DIY cartridge to run the WilDFly server. There are better options how to do that now - using one of the available OpenShift cartridges (WilDfly 8.2.1 is among them). That way you don't need to worry about the initial setup that much. If you have not used one of the WildFly cartridges, this guide could be helpful.

I think, that after following up the above, you may no longer need this, but as you've asked, here is a guide on how to manage WildFly server on OpenShift (that includes suspend, resume). You will need to use rhc port-forward <your_wildfly_app> in order to access it using your web browser. (The WildFly admin runs on the 9990 port.)

Community
  • 1
  • 1
Jiri Fiala
  • 1,400
  • 7
  • 10
  • I read this guide: https://developers.openshift.com/en/wildfly-getting-started.html. But I couldn't find anything about websockets and how to configure the server for that. So do I have to go to my admin (as you have said) and manually start the server or to make it available so the client can access it at port 8000? – user5139637 Nov 09 '15 at 13:18
  • I read the tutorials and I (am using eclipse) and it generated a war file for me, and I put it under /deployments as one of the article says. But I am still having the same problem. – user5139637 Nov 10 '15 at 04:06
  • Do I have to go to Jboss modules as your article points out, and manually add my APIs and the java web socket class there? – user5139637 Nov 10 '15 at 04:22
  • If you use a WildFly cartridge, there is no need to manually start the server afterwards the cartridge is started. You can check that by visiting the application URL it presents to you. I will comment re the the endpoint connect/disconnect problem in your other question... – Jiri Fiala Nov 10 '15 at 11:49