Hi,
I have been trying to get Atmosphere to work inside a Jira Plugin, but with no luck so far.
Looking through the documentation at the Atmosphere wiki I haven't found any examples that apply and work in my case
I have read that some of you have managed to get it working in Jira.
What was your setup/code like ?
I have tried using code from the chat sample
I have tried setting up AmosphereServlet defining it in atlassian-plugin.xml and with annotations in the javacode
<servlet name="AtmosphereServlet" key="atmosphereServlet" class="org.atmosphere.cpr.AtmosphereServlet"> <description>AtmosphereServlet</description> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> <url-pattern>/chat/*</url-pattern> </servlet>
package com.example.chat; import org.atmosphere.config.service.ManagedService; @Config @ManagedService(path = "/chat", atmosphereConfig = MAX_INACTIVE + "=120000") public class ResourceChat { ... }
This all results in an error when requesting HTTP GET /jira/plugins/servlet/chat/test
Unable to create new reference LazyLoadedServletReference{descriptor=com.exaple.chat:atmosphereServlet (AtmosphereServlet), servletConfig=org.apache.catalina.core.StandardWrapperFacade@4b61540c} com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.AbstractMethodError: com.atlassian.plugin.servlet.PluginServletContextWrapper.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
I have published the example project on github at https://github.com/ankakaak/jira-atmosphere-example
Community moderators have prevented the ability to post new answers.
Interested in this too... did you make any progress?
Hi there,
any complete example of this somwhere??
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems problem is old JIRA's servlet's API. It call method com.atlassian.plugin.servlet.PluginServletContextWrapper.getServletRegistration but for servlet's api version 2.4 (provided with JIRA 6.x) there's no such method (check https://developer.atlassian.com/static/javadoc/plugins/2.4/reference/com/atlassian/plugin/servlet/PluginServletContextWrapper.html), but it appeared in Servlet 3.0 API (check https://docs.atlassian.com/atlassian-plugins-servlet/3.1.0-m5/atlassian-plugins-servlet/apidocs/com/atlassian/plugin/servlet/PluginServletContextWrapper.html) so, it seems it should work with JIRA 7 because of servlet's API was updated to version 3.0.1
UPD:
Tried with JIRA 7, I got error 500:
Servlet.service() for servlet [servlet-module-container-servlet] in context with path [] threw exception org.atmosphere.cpr.AtmosphereMappingException: No AtmosphereHandler found. Make sure you define it inside WEB-INF/atmosphere.xml or annotate using @___Service at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:147)
It seems it needs web.xml or atmosphere.xml config at WEB-INF, Atlassian-plugin.xml is insufficiently for service registration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good point Ferenc. I changed the atlassian-plugin.xml to:
<servlet name="AtmosphereServlet" key="atmosphereServlet" class="org.atmosphere.cpr.AtmosphereServlet"> <url-pattern>/chat*</url-pattern> </servlet>
Unfortunately the error message remains the same :-/
I have now published the example project on github at https://github.com/ankakaak/jira-atmosphere-example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Andreas, I think your server definition is not correct. It resembles to the what you'd write to web.xml, not to atlassian-plugin.xml.
For example <load-on-startup> and
<async-supported> are not supported by the servlet pluin module type!
Double check the XML!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.