Details
-
Bug
-
Resolution: Done
-
Major
-
2.0-beta-3
-
None
Description
The RESTEasy -CDI integration doesn't work on Google App Engine because GAE doesn't support JNDI. There are several other popular web containers that do not support JNDI (Jetty has been mentioned on the mailing list).
There are no standard ways to obtain a BeanManager besides JNDI, however, it would be great if Weld's mechanism was supported. The Weld BeanManager can be found in the ServletContext attributes with a key like this:
BeanManager mgr = (BeanManager)servletContext.getAttribute(BeanManager.class.getName());
By modifying CdiInjectorFactory so that lookupBeanManager() is protected rather than private, I have created a factory that successfully obtains the BeanManager. HOWEVER, injection still fails on Google App Engine (and reportedly other forms of Jetty). At this point it's a mystery to me.
You can find a sample project here: http://scratchmonkey.googlecode.com/svn/appengine/weld/
Check it out with Eclipse + the GAE plugin. Resteasy-cdi snapshot has been modified to fix visibility of lookupBeanManager but otherwise it's trunk as of yesterday.
Attachments
Issue Links
- relates to
-
RESTEASY-471 BeanManager name in ServletContext for CDI integration is incorrect
- Resolved