Skip to content
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

[OSGI] Annotation Scanning Broken #1539

Closed
jfarcand opened this issue Mar 29, 2014 · 9 comments
Closed

[OSGI] Annotation Scanning Broken #1539

jfarcand opened this issue Mar 29, 2014 · 9 comments

Comments

@jfarcand
Copy link
Member

[org.atmosphere.cpr.AtmosphereFramework] autoConfigureService Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
[org.atmosphere.cpr.DefaultAnnotationProcessor] configure AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$BytecodeBasedAnnotationProcessor being used
[org.atmosphere.cpr.DefaultAnnotationProcessor] scanForAnnotation Package org.atmosphere.annotation scanned for @AtmosphereAnnotation
[org.atmosphere.cpr.AtmosphereFramework] autoConfigureService
java.lang.AssertionError: Not a File: /org/atmosphere/annotation
at org.atmosphere.util.annotation.AnnotationDetector.detect(AnnotationDetector.java:352)
at org.atmosphere.cpr.DefaultAnnotationProcessor.scanForAnnotation(DefaultAnnotationProcessor.java:147)
at org.atmosphere.cpr.DefaultAnnotationProcessor.configure(DefaultAnnotationProcessor.java:133)
at org.atmosphere.cpr.AtmosphereFramework.autoConfigureService(AtmosphereFramework.java:2268)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:707)
at org.atmosphere.cpr.AtmosphereFramework.init(AtmosphereFramework.java:614)
at org.atmosphere.cpr.AtmosphereServlet.configureFramework(AtmosphereServlet.java:91)
at org.atmosphere.cpr.AtmosphereServlet.init(AtmosphereServlet.java:80)
@pires
Copy link

pires commented Jun 5, 2014

+1

@jfarcand
Copy link
Member Author

jfarcand commented Jun 5, 2014

@pires Can you try with 2.2.0-SNAPSHOT

@pires
Copy link

pires commented Jun 5, 2014

@jfarcand is RC1 enough? Latest available version in central maven.

@pires
Copy link

pires commented Jun 5, 2014

Seems not. Building latest commit in master. Will come back after some testing!

@pires
Copy link

pires commented Jun 5, 2014

Doesn't work.

@slovdahl
Copy link
Contributor

slovdahl commented Jun 6, 2014

Hint: If you don't want to build SNAPSHOTs yourself, try https://github.com/Atmosphere/atmosphere/wiki/Downloading-Atmosphere%27s-SNAPSHOT

@metamorph
Copy link

+1 on this as well. Any progress?

@jfarcand
Copy link
Member Author

@metamorph Contribution welcomed...it's a missing features so someone will have to jump in and do the work :-)

@paulbakker
Copy link

Classpath scanning is considered a bad practice in OSGi. Each bundle has it's own class loader, and there is no API to reliably scan within the "classpath" of these class loaders. In other words, I don't think this can be fixed in a non-hacky way.

A much better mechanism would be to register annotated classes in the service registry. A listener can pick up new registrations in the registry and register those classes to Atmosphere. In the Amdatu project we did something similar for JAX-RS: https://bitbucket.org/amdatu/amdatu-web/src/226d62c00ff28f9e4bf78ea3f5687865a9390caf/org.amdatu.web.rest/?at=master
I'm not familiar enough with Atmosphere to come with a more detailed approach yet, but with a bit of help with someone who is I guess it shouldn't be too difficult to get something like this working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants