-
-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-detection of atmosphere handlers fails in specific deployments #1157
Comments
@OliverO2 As a workaround, annotate your Handler with |
Workaround, define in web.xml <init-param>
<param-name>org.atmosphere.cpr.packages</param-name>
<param-value><<YOUR PACKAGE>></param-value>
</init-param> |
Since the Using the annotation is a good way to make the configuration more explicit, and offering too many methods to configure the same thing might confuse users. |
Fully agree! One thing I can do is output a warning message at deployment time...but I cannot remove the mechanism as too many framework running on top of Atmosphere may get broken :-) |
IMO it's OK to keep the mechanism for legacy users. A warning at deployment time should probably state that the mechanism does not work in all environments so that users know the risk involved even if it works in their current situation. What I would consider very valuable is prominently stating the deprecation in the code and in the documentation so that new users don't waste time on solutions for which there are better alternatives. I happen to like Google Guavas philosophy in that respect (see section Iteration here, and you might consider an idea graveyard like this in the docs). |
I like the Guava idea...I will spend time and see what can be done. Thanks for the link! |
OK, added an entry in the documentation. Closing. |
AtmosphereFramework.autoDetectAtmosphereHandlers
uses [ServletContext.getRealPath
](http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String\)) whose documentation states:[
ServletContext.getResource
](http://docs.oracle.com/javaee/7/api/javax/servlet/ServletContext.html#getResource(java.lang.String\)), which is used as a backup, may also return null and is not guaranteed to work on directories as I understand it.In cases where both methods return null, auto-detection fails.
For example, if Tomcat/7.0.37 is started via the tomcat7-maven-plugin:run goal in a multi-module Maven project,
ServletContext.getRealPath
andServletContext.getResource
both return null. No atmosphere handlers are detected.The text was updated successfully, but these errors were encountered: