Pages

Saturday 14 September 2013

Chat Application in Java


This article provides chat application in java which shows list of online users and allows individual chatting and group chatting.The intention of project is to give good idea about how to create server push application using servlet and jsp.

This web-based chat application in java uses below technologies :

1)Jsp and Servlet 3
2)Comet
3)Javascript and jQuery
4)Apache tomcat 7
5)Eclipse IDE

The chat application provides below features :
1)Showing list of online users
2)Group chat
3)Chatting with individual online user.

Note* Chat application source code may need refactoring if want to improve further.

Pre-Requisites to execute this project :
1)Eclipse IDE
2)Java 1.5 or above
3)Apache tomcat 7.

Follow below steps to execute chat application project :

1)Download project from link given at the end.
2)Extract project and import in eclipse.
3)Right click on project and select run on server option
4)Open multiple tabs in browser and paste below link in each tab
http://localhost:8080/BasicChatApplication/jsp/ChatWindow.jsp
5)Now login with different user and start chatting.

Note*: You can also test it on LAN for better testing.


Below are some screen shots of the application :

Login screen of chat application start page.

Chat Application in Java-Login Screen
Chat application in java : Login screen


Online user list after login :

Chat Application in java - Group chat
Chat Application in java - Online users 


Chatting with online user screens :
Chat Application in java - Chatting with other users
Chat Application in java - Chatting with other users


Group chat screen :
Chat Application in java - Group chat
Chat Application in java - Group chat

Click here to download chat application in java eclipse project

If you find this post useful. Please comment and share. Thanks :)



39 comments:

  1. HI,

    web.xml and some library is missing from source code.i have downloaded your source code from above link

    ReplyDelete
  2. wonderfull, please more more, I want more about BIRT; can you do it please
    thnx

    ReplyDelete
  3. Replies
    1. can u pls send me the executed code to my mail kkumarbabu07@gmail.com
      thanx....

      Delete
  4. it's not working properly
    i am not getting list of online users even if multiple users are logged in

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. AsyncContext context can not resolved plz help me how can i resolve this error...

    ReplyDelete
    Replies
    1. Please provide more details.

      Delete
    2. Total 86 error in this project firstly install tomcat nd start then import this project in eclipse then show error one error like as asyncContext context can not can not resolved thia error show in every line where asyncContext is written in the code......resolve this my problm or send me correct working code on my mail...
      Kuldeepjain1990@gmail.com

      Delete
    3. These error are coming because you don't have target runtime set to apache tomcat 7. Use apache tomcat 7 and set target runtime to it, that will resolve compilation errors. Please take your time and read steps given above properly.

      Delete
  7. This comment has been removed by the author.

    ReplyDelete
  8. i run the project but can't chatting, only user 'me' can defined in this app.
    how to resolve?

    ReplyDelete
  9. i run the project but only user means "me" can chat and not getting a list of online users plzz tell me how to resolve this problem plzz help me on ingolemv@gmail.com

    ReplyDelete
  10. Project Far chan ahe Mitra,...............Jinkalas tu....

    pan tyacha code kuthe ahe......mala pathav
    email : amitssawarkar@gmail.com

    ReplyDelete
  11. I would totally recommend Photo4Tune as an alternative for Whatsapp and Snapchat. It has got amazing emoticons, simple user interface for photo sharing.

    ReplyDelete
  12. Hi its working fine in local ip but in public ip it showing following error .

    java.net.SocketException: Connection reset by peer: socket write error
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:371)
    at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:333)
    at org.apache.catalina.connector.Response.flushBuffer(Response.java:568)
    at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:306)


    how to solve it.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. hi, its Working fine in LAN but its getting failed in WAN. Can u suggest me a solution for this problem.

    ReplyDelete
  15. We have integrated this in one of our web application. This worked fine with all the expected functionalities while testing using our office network, where all the machines are connected in LAN (locally). We mapped a public IP to the server and tried to access it using public IP outside of our office network which showed up the problem. Whatever is sent from the internet is received in the machines logged in within our office network, however the messages sent from machines within our office network are not received in the machines connected outside of our network.

    We are hardly trying to find out some solution to fix this issue. Any help will be highly appreciable. Thanks in advance.

    ReplyDelete
  16. Replies
    1. my project is not working in any browser....how can I add user and start chatting?

      Delete
  17. is this run some function not working in chrome and some function not working in Firefox pls let me knw apt browser

    ReplyDelete
  18. can u please advice me best way to maintain the chat history

    ReplyDelete
  19. very good app it working well. but i have a question ,if i want to integrate with my project i have a registration form project with login all run but i want to integrate with this when i login i want to go to this chat room my project when i login i go to a blank page with only a welcome world

    ReplyDelete
  20. I tried to run this project as successfully but list online users shows repeatedly on the chat list. please help me to resolve this problem... my mail id is: raja.veerla28@gmail.com

    ReplyDelete
  21. I Would like to Share about GroupRocket.Net, I do work for GroupRocket, You May think, My Comment is bias but I do believe GroupRocket is helpful for communication at work or making chatting about work even better. - http://goo.gl/skXgvg

    ReplyDelete
  22. How can we maintain history of chat, with date and time??

    ReplyDelete
  23. Very nice app what have you used for deployment instead of web.xml

    ReplyDelete
  24. In this project web.xml is missing..no online users are showing in this chat application...please guide us how to add user so that they can start chat online..reply as soon as possible..

    ReplyDelete

  25. viKram can i question? i am korean student how can i convert chat app utf-8? i convert this app and run eclipse then charconversionexception error what's the problem?

    ReplyDelete
  26. Download link is not working. It is showing file not found

    ReplyDelete
  27. THERE is no file for downloading

    ReplyDelete
  28. This comment has been removed by the author.

    ReplyDelete
  29. Download link is not working. It is showing file not found

    ReplyDelete
  30. download link is not working

    ReplyDelete