Atmosphere Framework

238 views
Skip to first unread message

Ibrahim Khatib

unread,
Oct 11, 2015, 7:39:26 PM10/11/15
to manydesigns-portofino
Hi ,

I am trying to test the Atmosphere Framework Notification service included but when I make a call to subscribe to an item I get the following error in the logs

2015-10-12 02:33:29,094 WARN  o.a.websocket.DefaultWebSocketProcessor    Failed invoking AtmosphereFramework.doCometSupport()
org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /m/atmosphere/services/chat
        at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:366) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:161) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:108) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2262) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:566) [atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:220) [atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:223) [atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138) [tomcat-websocket.jar:8.0.26]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:701) [tomcat-coyote.jar:8.0.26]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526) [tomcat-coyote.jar:8.0.26]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482) [tomcat-coyote.jar:8.0.26]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.26]
        at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]
2015-10-12 02:33:29,094 WARN  o.a.w.protocol.SimpleHttpProtocol          org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /m/atmosphere/services/chat. Unable to deliver the websocket messages to installed component. Status 500 Message Server Error


Any help will be much appreciated.


Regards,

Ibrahim

Alessio Stalla

unread,
Oct 14, 2015, 8:11:18 AM10/14/15
to manydesign...@googlegroups.com
Hi,
where does "/m/atmosphere/services/chat" come from? How do you subscribe to the service?
In Portofino, there is already an Atmosphere resource configured that you can leverage if you don't have specific needs, freeing you from having to learn about Atmosphere configuration options.

Look at /m/atmosphere/js/notifications.js (client side) and NotificationsService (server side) that you can inject into your actions or Quartz jobs with @Inject(AtmosphereModule.NOTIFICATION_SERVICE). If you're still stuck, let us know!

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

Ibrahim Khatib

unread,
Oct 14, 2015, 7:53:14 PM10/14/15
to manydesigns-portofino
Hi Alessio,

Thank-you for your reply. Yes this is what I am using. I have included notifications.js on my client, but this has a function called "subscribe" which I assume I need to call at some point. I am doing this when my page has loaded - see below.

<script language="javascript" type="text/javascript">

$( document ).ready(function() {
  // Handler for .ready() called.
            portofino.notifications.subscribe(portofino.notifications.createSubscription("chat"));
           
           
});
          
</script>


This is where I am putting the "chat" topic , because I need to call "subscribe"  with a subscription object and that needs to have a topicName!.

Also on the server-side how do I use the NotificationService after I have injected it into my code. It has 3 functions "subscribe" ,"getTopic" and "sendNotification". I am assuming that I need to call sendNofication if I want to send a message but  "sendNotification"  needs a topicName ( So where do I define this !)


Thankyou in advance.

Regards,

Ibrahim
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-portofino+unsub...@googlegroups.com.

Alessio Stalla

unread,
Oct 15, 2015, 3:17:46 AM10/15/15
to manydesign...@googlegroups.com
Hi,

topicName is "chat" in your case.

To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.

Ibrahim Khatib

unread,
Oct 15, 2015, 3:32:53 AM10/15/15
to manydesigns-portofino
Hi Alessio,


This is what I use as the topicName name but when the page loads I get the error on the server as below ( It seems like it does not know where to deliver the message )  - Thanks for you reply
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-portofino+unsub...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-portofino+unsub...@googlegroups.com.

Ibrahim Khatib

unread,
Oct 15, 2015, 3:35:26 AM10/15/15
to manydesigns-portofino
Sorry error is as below:


2015-10-15 09:15:11,027 WARN  o.a.websocket.DefaultWebSocketProcessor    Failed invoking AtmosphereFramework.doCometSupport()
org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /m/atmosphere/services/notifications/topic

        at org.atmosphere.cpr.AsynchronousProcessor.map(AsynchronousProcessor.java:366) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:161) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:108) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2262) ~[atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:566) [atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.websocket.DefaultWebSocketProcessor.open(DefaultWebSocketProcessor.java:220) [atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.atmosphere.container.JSR356Endpoint.onOpen(JSR356Endpoint.java:223) [atmosphere-runtime-2.3.4.jar:2.3.4]
        at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:138) [tomcat-websocket.jar:8.0.26]
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:701) [tomcat-coyote.jar:8.0.26]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526) [tomcat-coyote.jar:8.0.26]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482) [tomcat-coyote.jar:8.0.26]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.26]
        at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]
2015-10-15 09:15:11,028 WARN  o.a.w.protocol.SimpleHttpProtocol          org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler maps request for /m/atmosphere/services/notifications/chat. Unable to deliver the websocket messages to installed component. Status 500 Message Server Error

Alessio Stalla

unread,
Oct 15, 2015, 10:58:13 AM10/15/15
to manydesign...@googlegroups.com
Works for me on stock Tomcat 7. I have in my jsp

<script>
portofino.notifications.subscribe(portofino.notifications.createSubscription("chat"));
</script>

and in my Quartz job

@Inject(AtmosphereModule.NOTIFICATION_SERVICE)
NotificationService notificationService;

void execute(JobExecutionContext context) {
    notificationService.sendNotification("chat", "foo" + new Date());
}




To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.

To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.

Ibrahim Khatib

unread,
Oct 15, 2015, 1:35:15 PM10/15/15
to manydesigns-portofino
Thanks Alessio for taking time to look at this. I will try from a Quartz job.

Regards,

Ibrahim
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-portofino+unsub...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-portofino+unsub...@googlegroups.com.

To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-portofino+unsub...@googlegroups.com.

Alessio Stalla

unread,
Oct 16, 2015, 4:16:03 AM10/16/15
to manydesign...@googlegroups.com
Quartz Job or Portofino PageAction should make no difference. I used a job only because I had one at hand.

To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.

To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.

To post to this group, send email to manydesign...@googlegroups.com.
Visit this group at http://groups.google.com/group/manydesigns-portofino.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "manydesigns-portofino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manydesigns-port...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages