I figured out the problem. I'm placing a note here for others, in case if they face the same problem as I did.
In the JBoss Configuration Settings in Eclipse, I have set the port as 8079, because I also had a
Tomcat Installation, which I intended to run on 8080. (It is currently inactive though). When I run JBoss externally, JBoss runs in port 8080. When I set the port in Eclipse to 8080, it worked.
Anyway, I would like to the procedure to change the port which JBoss run. Thanks.