Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-392

RESTEasy + CDI doesn't work on Google App Engine (and several other servers)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.0-beta-3
    • 2.0-beta-3
    • jaxrs
    • 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

          Activity

            People

              rhn-engineering-jharting Jozef Hartinger
              lhoriman_jira Robert Dobbs (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: