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 7083209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:08:59+00:00 2026-05-28T07:08:59+00:00

I have a servlet that has a suspending method and a broadcasting one: @GET

  • 0

I have a servlet that has a suspending method and a broadcasting one:

  @GET
  @Path("/notification")
  @Produces( { "application/x-javascript", MediaType.APPLICATION_JSON })
  @Suspend
  public JSONWithPadding getNextNotification(
    @QueryParam("callback") @DefaultValue("callback") String callback) {

    Random random = new Random();

    Notification n = new Notification();
    n.setMessage("Message is " + Long.toHexString(random.nextLong()));
    n.setMessage("S-" + Long.toHexString(random.nextLong()));

    return new JSONWithPadding(n, callback);

  }

I invoke this from a browser and see the following nice output in my browser:

<!-- ---------------------------------------------------------------- http://github.com/Atmosphere ------------------------------------------------------------------------ -->
<!-- Welcome to the Atmosphere Framework.....
<!-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->
<!-- EOD -->callback({"message":"S-c897404ad5703dcc","sender":null}

So my object is nicely serialized to JSONP.

Now I call my broadcaster method:

  @Context Broadcaster bc;

  @Broadcast({JsonpFilter.class})
  @GET
  @Path("/broadcast5")
  public Broadcastable broadcast5() {
    Random random = new Random();
    Notification n = new Notification();
    n.setMessage("Message is " + Long.toHexString(random.nextLong()));
    n.setMessage("S-" + Long.toHexString(random.nextLong()));
    return new Broadcastable(new JSONWithPadding(n, "callback111"), bc);
  }

On the server side I get the following exception and nothing is broadcasted:

[#|2012-01-19T17:28:30.483+0100|WARNING|glassfish3.1.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_Thr
eadID=20;_ThreadName=http-thread-pool-8080(5);|StandardWrapperValve[AtmosphereServlet]: PWC1406: Servlet.service() for s
ervlet AtmosphereServlet threw exception
java.lang.RuntimeException: javax.servlet.ServletException: Throwable
        at org.atmosphere.handler.ReflectorServletProcessor.onRequest(ReflectorServletProcessor.java:154)
        at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:219)
        at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:154)
        at org.atmosphere.container.GrizzlyCometSupport.service(GrizzlyCometSupport.java:103)
        at org.atmosphere.container.GlassFishWebSocketSupport.service(GlassFishWebSocketSupport.java:101)
        at org.atmosphere.cpr.AtmosphereServlet.doCometSupport(AtmosphereServlet.java:1212)
        at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:1171)
        at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:1157)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
        at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:444)
        at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:308)
        at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:87)
        at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:171)
        at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:143)
        at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:94)
        at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
        at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
        at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
        at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:204)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:662)
Caused by: javax.servlet.ServletException: Throwable
        at org.atmosphere.util.AtmosphereFilterChain.doFilter(AtmosphereFilterChain.java:165)
        at org.atmosphere.util.AtmosphereFilterChain.invokeFilterChain(AtmosphereFilterChain.java:116)
        at org.atmosphere.handler.ReflectorServletProcessor$FilterChainServletWrapper.service(ReflectorServletProcessor.
java:293)
        at org.atmosphere.handler.ReflectorServletProcessor.onRequest(ReflectorServletProcessor.java:151)
        ... 41 more
Caused by: java.lang.AbstractMethodError: org.atmosphere.commons.jersey.JsonpFilter.filter(Ljava/lang/Object;Ljava/lang/
Object;)Lorg/atmosphere/cpr/BroadcastFilter$BroadcastAction;
        at org.atmosphere.cpr.BroadcasterConfig.filter(BroadcasterConfig.java:447)
        at org.atmosphere.cpr.DefaultBroadcaster.filter(DefaultBroadcaster.java:890)
        at org.atmosphere.cpr.DefaultBroadcaster.broadcast(DefaultBroadcaster.java:875)
        at org.atmosphere.jersey.AtmosphereFilter$Filter.broadcast(AtmosphereFilter.java:632)
        at org.atmosphere.jersey.AtmosphereFilter$Filter.filter(AtmosphereFilter.java:468)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1416)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.atmosphere.util.AtmosphereFilterChain.doFilter(AtmosphereFilterChain.java:155)
        ... 44 more
|#]

How could I make my broadcaster work? Do I need to return JSONWithPadding object or only the POJO?

  • 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-05-28T07:09:00+00:00Added an answer on May 28, 2026 at 7:09 am

    You get an AbstractMethodError. Do you have atmosphere-commons on your classpath?

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

Sidebar

Related Questions

I have a spring app with one servlet that has url-mapping of *.html. Everything
I'm working on an application. I have a servlet (writeDataBase.class) that writes some information
I have checked out a java servlet project from subversion that has a strange
I have a web project that has a \META-INF\services\javax.servlet.ServletContainerInitializer file with its content pointing
I have a use case where a servlet (that has reasonably high concurrent use)
I have a form that has values prefilled for usability/hints - unfortunately one of
I have this web application that has grown to an unmanageable mess. I want
I have a simple GWT project in Eclipse, it has a servlet that calls
I am writing an application in Eclipse, that has a servlet, and an android
I have one Servlet that does insertion into my database. This is working fine.

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.