Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:40:55+00:00 2026-06-13T10:40:55+00:00

I am trying to get a simple example of a Atmosphere chat program working

  • 0

I am trying to get a simple example of a Atmosphere chat program working with Glassfish and Jersery.

So far I have a basic maven webapp archetype with the following structure:

project setup

The chat resource file is just a simple REST service using the Atmosphere annotations:

package core;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.atmosphere.annotation.Broadcast;
import org.atmosphere.annotation.Suspend;

@Path("/")
public class ChatResource {

    @Suspend(contentType = "application/json")
    @GET
    public String suspend() {
        return "";
    }

    @Broadcast(writeEntity = false)
    @POST
    @Produces("application/json")
    public Response broadcast(Message message) {
        return new Response(message.author, message.message);
    }
}

The message and response classes are just simple POJO wrappers. The index.jsp, application.js, jquery.atmosphere.js and jquery.js are copied directly from the example project (found here).

My web.xml is set to the following:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Archetype Created Web Application</display-name>
    <servlet>
        <description>AtmosphereServlet</description>
        <servlet-name>AtmosphereServlet</servlet-name>
        <servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>AtmosphereServlet</servlet-name>
        <url-pattern>/chat/*</url-pattern>
    </servlet-mapping>
</web-app>

When navigating to the page, I receive the following error:

Sorry, but there’s some problem with your socket or the server is down

If I navigate to the path the page is trying to access (http://localhost:8080/…/chat), I get the following message:

org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler
found. Make sure you define it inside META-INF/atmosphere.xml or
annotate using @AtmosphereHandlerService

I must be missing a file or setup configuration, but I can’t seem to find where (the above message says the atmosphere.xml is missing, but this doesn’t appear in the example). Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:40:56+00:00Added an answer on June 13, 2026 at 10:40 am

    By default the web socket protocol is not enabled in Glassfish.

    You can enable it with the following command:

    asadmin set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.websockets-support-enabled=true
    

    This is what I needed to get my connection working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a simple winsock program working, so I create my socket
So i am trying to get a simple system working where i have an
I'm trying to get a simple example working using gSoap, for VS2008. I've done
I have been trying to get a simple example of the jquery-ui autocomplete to
I'm trying to get a simple example working with GCDAsyncSocket, and am discovering that
I am trying to get a simple example working from an assembly book I
I'm trying to get a simple send and receive UDP program working, but I'm
I'm trying to get the following simple Delegate example working. According to a book
I am trying to get a simple example of the Quartz scheduler working in
I'm trying to get bootstrap tool tips working in a simple example. Here's a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.