September 19, 2017
Happy Coding now has server tutorials!
This is a companion discussion topic for the original entry at http://happycoding.io/blog/server-tutorials
September 19, 2017
Happy Coding now has server tutorials!
First of all, thank you for doing this. Itâs a very helpful resource of information. Your way of presenting these ideas and concepts is very straightforward and clean. I was looking for this kind of resource for very long time.
Regarding the âServer Tutorialâ: I try to complete the tutorial that explains how the âServletâ is working. Iâve successfully compiled the class, created the folder structure inside the âwebappsâ folder, created the web.xml file. But when I go to âhttp://localhost:8080/HelloWorldWebApp/index.htmlâ I get this error message: âService unavailableâ.
If possible, please explain what is the reason for this.
Thanks so much! Thatâs so awesome to hear!
First off, this is actually good news- it means youâre successfully running your server (because youâve got the âPowered by Jettyâ message at the bottom). Now we just need to figure out your web app.
Can you the contents of your web.xml
file? And maybe a screenshot of your directory structure?
Hmm what you have looks correct, and I just verified that it works for me.
How exactly are you running Jetty? Maybe try restarting it?
Googling âjetty service unavailableâ returns a bunch of results. These offer some possible explanations:
It looks like the most common causes of the error are problems in your web.xml
file, or running Jetty from an IDE instead of the command line.
You should also check the logs
directory of your Jetty installation. That might contain errors that will tell you whatâs going on.
Keep me updated, Iâll be very curious to see what the problem was, so I can make it more clear in the tutorials.
Not sure why, but itâs working today. Nothing had been changed. Itâs strange.
Yes, I was running it from the command line. And I did check the StackOverflow and other resources the same day before going to help to the forum.
Anyway, thanks for the help. I will continue to learn the examples and tutorials.
Heh, gotta love bugs that just go away on their own.
One thing worth remembering is that Jekyll doesnât always automatically refresh. So if you started Jekyll and then made a change to web.xml
for example, it might not have picked up on that change. Restarting Jekyll often fixes problems like this.
Let me know if you have any other questions!